Commit 9c11326b authored by Andreas Gustafsson's avatar Andreas Gustafsson
Browse files

237. [bug] If connect() returned ENOBUFS when the resolver was

                        initiating a TCP query, the socket didn't get destroyed,
                        and the server did not shut down cleanly.  [RT #107]
parent 5a75472f
237. [bug] If connect() returned ENOBUFS when the resolver was
initiating a TCP query, the socket didn't get destroyed,
and the server did not shut down cleanly.
236. [func] Added new listen-on-v6 config file statement.
235. [func] Consider it a config file error if a listen-on
......
......@@ -684,10 +684,8 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
INSIST(0);
}
result = isc_socket_bind(query->tcpsocket, &any);
if (result != ISC_R_SUCCESS) {
isc_socket_detach(&query->tcpsocket);
goto cleanup_query;
}
if (result != ISC_R_SUCCESS)
goto cleanup_socket;
/*
* A dispatch will be created once the connect succeeds.
......@@ -730,7 +728,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
&addrinfo->sockaddr, task,
resquery_connected, query);
if (result != ISC_R_SUCCESS)
goto cleanup_query;
goto cleanup_socket;
query->attributes |= RESQUERY_ATTR_CONNECTING;
QTRACE("connecting via TCP");
} else {
......@@ -743,8 +741,12 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
return (ISC_R_SUCCESS);
cleanup_socket:
isc_socket_detach(&query->tcpsocket);
cleanup_dispatch:
dns_dispatch_detach(&query->dispatch);
if (query->dispatch != NULL)
dns_dispatch_detach(&query->dispatch);
cleanup_query:
query->magic = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment