The STATID_CONNECT and STATID_CONNECTFAIL statistics were used
incorrectly. The STATID_CONNECT was incremented twice (once in
the *_connect_direct() and once in the callback) and STATID_CONNECTFAIL
would not be incremented at all if the failure happened in the callback.
Closes: #3452
(cherry picked from commit
59e1703b50dc4a5c52e3d6ae13bdd873a677b03f)
REQUIRE(sock->tid == isc_nm_tid());
REQUIRE(req->cb.connect != NULL);
+ isc__nm_incstats(sock, STATID_CONNECTFAIL);
+
isc__nmsocket_timer_stop(sock);
uv_handle_set_data((uv_handle_t *)&sock->read_timer, sock);
isc__nm_incstats(sock, STATID_CONNECTFAIL);
goto done;
}
- isc__nm_incstats(sock, STATID_CONNECT);
uv_handle_set_data((uv_handle_t *)&sock->read_timer,
&req->uv_req.connect);
static void
tcp_connect_cb(uv_connect_t *uvreq, int status) {
- isc_result_t result;
+ isc_result_t result = ISC_R_UNSET;
isc__nm_uvreq_t *req = NULL;
isc_nmsocket_t *sock = uv_handle_get_data((uv_handle_t *)uvreq->handle);
struct sockaddr_storage ss;
&sock->uv_handle.tcp,
&req->peer.type.sa, tcp_connect_cb);
if (r != 0) {
- isc__nm_incstats(sock, STATID_CONNECTFAIL);
result = isc__nm_uverr2result(r);
goto error;
}
isc__nm_incstats(sock, STATID_CONNECTFAIL);
goto done;
}
- isc__nm_incstats(sock, STATID_CONNECT);
uv_handle_set_data((uv_handle_t *)&sock->read_timer,
&req->uv_req.connect);
static void
tcpdns_connect_cb(uv_connect_t *uvreq, int status) {
- isc_result_t result;
+ isc_result_t result = ISC_R_UNSET;
isc__nm_uvreq_t *req = NULL;
isc_nmsocket_t *sock = uv_handle_get_data((uv_handle_t *)uvreq->handle);
struct sockaddr_storage ss;
&req->uv_req.connect, &sock->uv_handle.tcp,
&req->peer.type.sa, tcpdns_connect_cb);
if (r != 0) {
- isc__nm_incstats(sock, STATID_CONNECTFAIL);
result = isc__nm_uverr2result(r);
goto error;
}
isc__nm_incstats(sock, STATID_CONNECTFAIL);
goto done;
}
- isc__nm_incstats(sock, STATID_CONNECT);
uv_handle_set_data((uv_handle_t *)&sock->read_timer,
&req->uv_req.connect);
static void
tlsdns_connect_cb(uv_connect_t *uvreq, int status) {
- isc_result_t result;
+ isc_result_t result = ISC_R_UNSET;
isc__nm_uvreq_t *req = NULL;
isc_nmsocket_t *sock = uv_handle_get_data((uv_handle_t *)uvreq->handle);
struct sockaddr_storage ss;
&req->uv_req.connect, &sock->uv_handle.tcp,
&req->peer.type.sa, tlsdns_connect_cb);
if (r != 0) {
- isc__nm_incstats(sock, STATID_CONNECTFAIL);
result = isc__nm_uverr2result(r);
goto error;
}