From de7bbe277e88c8780d8f9cdf7760afa0f7cf58d6 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 10 Feb 2021 12:34:10 -0800 Subject: [PATCH] fixup! fixup! fixup! fixup! fixup! call connect_cb from isc_nm_httpconnect() asynchronously --- lib/isc/netmgr/http.c | 10 +++++----- lib/isc/netmgr/tlsstream.c | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/isc/netmgr/http.c b/lib/isc/netmgr/http.c index 3ae7b702b5..7f19c9a930 100644 --- a/lib/isc/netmgr/http.c +++ b/lib/isc/netmgr/http.c @@ -220,7 +220,7 @@ find_http_cstream(int32_t stream_id, isc_nm_http_session_t *session) { static isc_result_t new_http_cstream(isc_nmsocket_t *sock, http_cstream_t **streamp) { isc_mem_t *mctx = sock->mgr->mctx; - const char *uri; + const char *uri = NULL; bool post; http_cstream_t *stream = NULL; isc_result_t result; @@ -982,7 +982,7 @@ client_send(isc_nmhandle_t *handle, const isc_region_t *region) { isc_result_t result = ISC_R_SUCCESS; isc_nmsocket_t *sock = handle->sock; isc_mem_t *mctx = sock->mgr->mctx; - isc_nm_http_session_t *session; + isc_nm_http_session_t *session = NULL; http_cstream_t *cstream = NULL; REQUIRE(VALID_HTTP2_SESSION(session = handle->sock->h2.session)); @@ -1643,7 +1643,7 @@ void isc__nm_http_read(isc_nmhandle_t *handle, isc_nm_recv_cb_t cb, void *cbarg) { isc_result_t result; http_cstream_t *cstream = NULL; - isc_nm_http_session_t *session; + isc_nm_http_session_t *session = NULL; REQUIRE(VALID_NMHANDLE(handle)); @@ -1927,7 +1927,7 @@ clear_handlers(isc_nmsocket_t *sock) { RWLOCK(&sock->h2.lock, isc_rwlocktype_write); handler = ISC_LIST_HEAD(sock->h2.handlers); while (handler != NULL) { - isc_nm_httphandler_t *next; + isc_nm_httphandler_t *next = NULL; next = ISC_LIST_NEXT(handler, link); ISC_LIST_DEQUEUE(sock->h2.handlers, handler, link); @@ -1938,7 +1938,7 @@ clear_handlers(isc_nmsocket_t *sock) { httpcbarg = ISC_LIST_HEAD(sock->h2.handler_cbargs); while (httpcbarg != NULL) { - isc_nm_httpcbarg_t *next; + isc_nm_httpcbarg_t *next = NULL; next = ISC_LIST_NEXT(httpcbarg, link); ISC_LIST_DEQUEUE(sock->h2.handler_cbargs, httpcbarg, link); diff --git a/lib/isc/netmgr/tlsstream.c b/lib/isc/netmgr/tlsstream.c index 1bca64aab5..fc46bd1242 100644 --- a/lib/isc/netmgr/tlsstream.c +++ b/lib/isc/netmgr/tlsstream.c @@ -887,9 +887,11 @@ isc__nm_async_tlsconnect(isc__networker_t *worker, isc__netievent_t *ev0) { * failure, the callback will be called and the error code * passed to it. */ - (void)isc_nm_tcpconnect(worker->mgr, (isc_nmiface_t *)&ievent->local, - (isc_nmiface_t *)&ievent->peer, tcp_connected, - tlssock, tlssock->connect_timeout, 0); + result = isc_nm_tcpconnect(worker->mgr, (isc_nmiface_t *)&ievent->local, + (isc_nmiface_t *)&ievent->peer, + tcp_connected, tlssock, + tlssock->connect_timeout, 0); + update_result(tlssock, result); return; error: