From 54fcac2b920c5af17584cce8b629d37ff4cb2dd8 Mon Sep 17 00:00:00 2001 From: Joseph Bryan Date: Thu, 11 Jan 2018 18:02:11 -0500 Subject: [PATCH] asan fix: initialize host before linking config to accept_ctx and adds hostname(s) TODO --- vere/http.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vere/http.c b/vere/http.c index 0841d746d5..0d32a0ee65 100644 --- a/vere/http.c +++ b/vere/http.c @@ -628,6 +628,12 @@ _http_init_h2o(u3_http* htp_u) memset(htp_u->fig_u, 0, sizeof(*htp_u->fig_u)); h2o_config_init(htp_u->fig_u); + // XX use u3_Host.ops_u.nam_c? Or ship.urbit.org? Multiple hosts? + // see https://github.com/urbit/urbit/issues/914 + htp_u->hos_u = h2o_config_register_host(htp_u->fig_u, + h2o_iovec_init(H2O_STRLIT("default")), + htp_u->por_w); + // wrapped for server backlink (wrapper unnecessary, just an example) htp_u->ctx_u = c3_malloc(sizeof(h2o_ctx_wrap)); memset(htp_u->ctx_u, 0, sizeof(h2o_ctx_wrap)); @@ -648,11 +654,6 @@ _http_init_h2o(u3_http* htp_u) htp_u->cep_u->ssl_ctx = tls_u; } - // XX read name from server? - htp_u->hos_u = h2o_config_register_host(htp_u->fig_u, - h2o_iovec_init(H2O_STRLIT("default")), - htp_u->por_w); - // XX attach to server? h2o_handler_t* han_u = h2o_create_handler(&htp_u->hos_u->fallback_path, sizeof(*han_u)); han_u->on_req = _http_handle_new_req;