mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
Allow listening on less than nworkers threads
For some applications, it's useful to not listen on full battery of threads. Add workers argument to all isc_nm_listen*() functions and convenience ISC_NM_LISTEN_ONE and ISC_NM_LISTEN_ALL macros.
This commit is contained in:
@@ -1163,9 +1163,9 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CHECK(isc_nm_listentcp(named_g_netmgr, &listener->address,
|
CHECK(isc_nm_listentcp(named_g_netmgr, ISC_NM_LISTEN_ONE,
|
||||||
control_newconn, listener, 5, NULL,
|
&listener->address, control_newconn, listener, 5,
|
||||||
&listener->sock));
|
NULL, &listener->sock));
|
||||||
#if 0
|
#if 0
|
||||||
/* XXX: no unix socket support yet */
|
/* XXX: no unix socket support yet */
|
||||||
if (type == isc_socktype_unix) {
|
if (type == isc_socktype_unix) {
|
||||||
|
@@ -266,19 +266,20 @@ run(void) {
|
|||||||
|
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
case UDP:
|
case UDP:
|
||||||
result = isc_nm_listenudp(netmgr, &sockaddr, read_cb, NULL,
|
result = isc_nm_listenudp(netmgr, ISC_NM_LISTEN_ALL, &sockaddr,
|
||||||
&sock);
|
read_cb, NULL, &sock);
|
||||||
break;
|
break;
|
||||||
case TCP:
|
case TCP:
|
||||||
result = isc_nm_listentcpdns(netmgr, &sockaddr, read_cb, NULL,
|
result = isc_nm_listentcpdns(netmgr, ISC_NM_LISTEN_ALL,
|
||||||
|
&sockaddr, read_cb, NULL,
|
||||||
accept_cb, NULL, 0, NULL, &sock);
|
accept_cb, NULL, 0, NULL, &sock);
|
||||||
break;
|
break;
|
||||||
case DOT: {
|
case DOT: {
|
||||||
isc_tlsctx_createserver(NULL, NULL, &tls_ctx);
|
isc_tlsctx_createserver(NULL, NULL, &tls_ctx);
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(netmgr, &sockaddr, read_cb, NULL,
|
result = isc_nm_listentlsdns(
|
||||||
accept_cb, NULL, 0, NULL, tls_ctx,
|
netmgr, ISC_NM_LISTEN_ALL, &sockaddr, read_cb, NULL,
|
||||||
&sock);
|
accept_cb, NULL, 0, NULL, tls_ctx, &sock);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#if HAVE_LIBNGHTTP2
|
#if HAVE_LIBNGHTTP2
|
||||||
@@ -294,8 +295,9 @@ run(void) {
|
|||||||
eps, ISC_NM_HTTP_DEFAULT_PATH, read_cb, NULL);
|
eps, ISC_NM_HTTP_DEFAULT_PATH, read_cb, NULL);
|
||||||
|
|
||||||
if (result == ISC_R_SUCCESS) {
|
if (result == ISC_R_SUCCESS) {
|
||||||
result = isc_nm_listenhttp(netmgr, &sockaddr, 0, NULL,
|
result = isc_nm_listenhttp(netmgr, ISC_NM_LISTEN_ALL,
|
||||||
tls_ctx, eps, 0, &sock);
|
&sockaddr, 0, NULL, tls_ctx,
|
||||||
|
eps, 0, &sock);
|
||||||
}
|
}
|
||||||
isc_nm_http_endpoints_detach(&eps);
|
isc_nm_http_endpoints_detach(&eps);
|
||||||
} break;
|
} break;
|
||||||
|
@@ -510,8 +510,9 @@ dispatch_timeout_tcp_response(void **state __attribute__((unused))) {
|
|||||||
&tcp_server_addr, -1, &dispatch);
|
&tcp_server_addr, -1, &dispatch);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(netmgr, &tcp_server_addr, noop_nameserver,
|
result = isc_nm_listentcpdns(netmgr, ISC_NM_LISTEN_ONE,
|
||||||
NULL, accept_cb, NULL, 0, NULL, &sock);
|
&tcp_server_addr, noop_nameserver, NULL,
|
||||||
|
accept_cb, NULL, 0, NULL, &sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
region.base = rbuf;
|
region.base = rbuf;
|
||||||
@@ -566,7 +567,8 @@ dispatch_tcp_response(void **state __attribute__((unused))) {
|
|||||||
&tcp_server_addr, -1, &dispatch);
|
&tcp_server_addr, -1, &dispatch);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(netmgr, &tcp_server_addr, nameserver, NULL,
|
result = isc_nm_listentcpdns(netmgr, ISC_NM_LISTEN_ONE,
|
||||||
|
&tcp_server_addr, nameserver, NULL,
|
||||||
accept_cb, NULL, 0, NULL, &sock);
|
accept_cb, NULL, 0, NULL, &sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
@@ -625,8 +627,8 @@ dispatch_timeout_udp_response(void **state __attribute__((unused))) {
|
|||||||
&dispatch);
|
&dispatch);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenudp(netmgr, &udp_server_addr, noop_nameserver,
|
result = isc_nm_listenudp(netmgr, ISC_NM_LISTEN_ONE, &udp_server_addr,
|
||||||
NULL, &sock);
|
noop_nameserver, NULL, &sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
region.base = rbuf;
|
region.base = rbuf;
|
||||||
@@ -682,8 +684,8 @@ dispatch_getnext(void **state) {
|
|||||||
/*
|
/*
|
||||||
* Create a local udp nameserver on the loopback.
|
* Create a local udp nameserver on the loopback.
|
||||||
*/
|
*/
|
||||||
result = isc_nm_listenudp(netmgr, &udp_server_addr, nameserver, NULL,
|
result = isc_nm_listenudp(netmgr, ISC_NM_LISTEN_ONE, &udp_server_addr,
|
||||||
&sock);
|
nameserver, NULL, &sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
region.base = rbuf;
|
region.base = rbuf;
|
||||||
|
@@ -231,8 +231,8 @@ isc_httpdmgr_create(isc_nm_t *nm, isc_mem_t *mctx, isc_sockaddr_t *addr,
|
|||||||
|
|
||||||
isc_refcount_init(&httpdmgr->references, 1);
|
isc_refcount_init(&httpdmgr->references, 1);
|
||||||
|
|
||||||
CHECK(isc_nm_listentcp(nm, addr, httpd_newconn, httpdmgr, 5, NULL,
|
CHECK(isc_nm_listentcp(nm, ISC_NM_LISTEN_ONE, addr, httpd_newconn,
|
||||||
&httpdmgr->sock));
|
httpdmgr, 5, NULL, &httpdmgr->sock));
|
||||||
|
|
||||||
httpdmgr->magic = HTTPDMGR_MAGIC;
|
httpdmgr->magic = HTTPDMGR_MAGIC;
|
||||||
*httpdmgrp = httpdmgr;
|
*httpdmgrp = httpdmgr;
|
||||||
|
@@ -28,6 +28,12 @@
|
|||||||
#define HAVE_SO_REUSEPORT_LB 1
|
#define HAVE_SO_REUSEPORT_LB 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Convenience macros to specify on how many threads should socket listen
|
||||||
|
*/
|
||||||
|
#define ISC_NM_LISTEN_ALL 0
|
||||||
|
#define ISC_NM_LISTEN_ONE 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Replacement for isc_sockettype_t provided by socket.h.
|
* Replacement for isc_sockettype_t provided by socket.h.
|
||||||
*/
|
*/
|
||||||
@@ -217,8 +223,8 @@ isc_nmhandle_netmgr(isc_nmhandle_t *handle);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listenudp(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nm_recv_cb_t cb,
|
isc_nm_listenudp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
void *cbarg, isc_nmsocket_t **sockp);
|
isc_nm_recv_cb_t cb, void *cbarg, isc_nmsocket_t **sockp);
|
||||||
/*%<
|
/*%<
|
||||||
* Start listening for UDP packets on interface 'iface' using net manager
|
* Start listening for UDP packets on interface 'iface' using net manager
|
||||||
* 'mgr'.
|
* 'mgr'.
|
||||||
@@ -324,7 +330,7 @@ isc_nm_send(isc_nmhandle_t *handle, isc_region_t *region, isc_nm_cb_t cb,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentcp(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentcp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
||||||
isc_quota_t *quota, isc_nmsocket_t **sockp);
|
isc_quota_t *quota, isc_nmsocket_t **sockp);
|
||||||
/*%<
|
/*%<
|
||||||
@@ -359,7 +365,7 @@ isc_nm_tcpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentcpdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentcpdns(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
||||||
int backlog, isc_quota_t *quota, isc_nmsocket_t **sockp);
|
int backlog, isc_quota_t *quota, isc_nmsocket_t **sockp);
|
||||||
@@ -383,7 +389,7 @@ isc_nm_listentcpdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentlsdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentlsdns(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
||||||
int backlog, isc_quota_t *quota, isc_tlsctx_t *sslctx,
|
int backlog, isc_quota_t *quota, isc_tlsctx_t *sslctx,
|
||||||
@@ -507,7 +513,7 @@ isc_nm_is_http_handle(isc_nmhandle_t *handle);
|
|||||||
#define ISC_NM_HTTP_DEFAULT_PATH "/dns-query"
|
#define ISC_NM_HTTP_DEFAULT_PATH "/dns-query"
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentls(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentls(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
||||||
isc_quota_t *quota, isc_tlsctx_t *sslctx,
|
isc_quota_t *quota, isc_tlsctx_t *sslctx,
|
||||||
isc_nmsocket_t **sockp);
|
isc_nmsocket_t **sockp);
|
||||||
@@ -523,8 +529,8 @@ isc_nm_httpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer,
|
|||||||
isc_tlsctx_t *ctx, unsigned int timeout);
|
isc_tlsctx_t *ctx, unsigned int timeout);
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listenhttp(isc_nm_t *mgr, isc_sockaddr_t *iface, int backlog,
|
isc_nm_listenhttp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_quota_t *quota, isc_tlsctx_t *ctx,
|
int backlog, isc_quota_t *quota, isc_tlsctx_t *ctx,
|
||||||
isc_nm_http_endpoints_t *eps, uint32_t max_concurrent_streams,
|
isc_nm_http_endpoints_t *eps, uint32_t max_concurrent_streams,
|
||||||
isc_nmsocket_t **sockp);
|
isc_nmsocket_t **sockp);
|
||||||
|
|
||||||
|
@@ -2461,8 +2461,8 @@ httplisten_acceptcb(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listenhttp(isc_nm_t *mgr, isc_sockaddr_t *iface, int backlog,
|
isc_nm_listenhttp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_quota_t *quota, isc_tlsctx_t *ctx,
|
int backlog, isc_quota_t *quota, isc_tlsctx_t *ctx,
|
||||||
isc_nm_http_endpoints_t *eps, uint32_t max_concurrent_streams,
|
isc_nm_http_endpoints_t *eps, uint32_t max_concurrent_streams,
|
||||||
isc_nmsocket_t **sockp) {
|
isc_nmsocket_t **sockp) {
|
||||||
isc_nmsocket_t *sock = NULL;
|
isc_nmsocket_t *sock = NULL;
|
||||||
@@ -2487,11 +2487,13 @@ isc_nm_listenhttp(isc_nm_t *mgr, isc_sockaddr_t *iface, int backlog,
|
|||||||
isc_nm_http_endpoints_attach(eps, &sock->h2.listener_endpoints);
|
isc_nm_http_endpoints_attach(eps, &sock->h2.listener_endpoints);
|
||||||
|
|
||||||
if (ctx != NULL) {
|
if (ctx != NULL) {
|
||||||
result = isc_nm_listentls(mgr, iface, httplisten_acceptcb, sock,
|
result = isc_nm_listentls(mgr, workers, iface,
|
||||||
backlog, quota, ctx, &sock->outer);
|
httplisten_acceptcb, sock, backlog,
|
||||||
|
quota, ctx, &sock->outer);
|
||||||
} else {
|
} else {
|
||||||
result = isc_nm_listentcp(mgr, iface, httplisten_acceptcb, sock,
|
result = isc_nm_listentcp(mgr, workers, iface,
|
||||||
backlog, quota, &sock->outer);
|
httplisten_acceptcb, sock, backlog,
|
||||||
|
quota, &sock->outer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
|
@@ -425,7 +425,7 @@ enqueue_stoplistening(isc_nmsocket_t *sock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentcp(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentcp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
||||||
isc_quota_t *quota, isc_nmsocket_t **sockp) {
|
isc_quota_t *quota, isc_nmsocket_t **sockp) {
|
||||||
isc_result_t result = ISC_R_SUCCESS;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
@@ -439,7 +439,9 @@ isc_nm_listentcp(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
|||||||
isc__nmsocket_init(sock, mgr, isc_nm_tcplistener, iface);
|
isc__nmsocket_init(sock, mgr, isc_nm_tcplistener, iface);
|
||||||
|
|
||||||
atomic_init(&sock->rchildren, 0);
|
atomic_init(&sock->rchildren, 0);
|
||||||
sock->nchildren = mgr->nworkers;
|
sock->nchildren = (workers == ISC_NM_LISTEN_ALL)
|
||||||
|
? (uint32_t)mgr->nworkers
|
||||||
|
: workers;
|
||||||
children_size = sock->nchildren * sizeof(sock->children[0]);
|
children_size = sock->nchildren * sizeof(sock->children[0]);
|
||||||
sock->children = isc_mem_get(mgr->mctx, children_size);
|
sock->children = isc_mem_get(mgr->mctx, children_size);
|
||||||
memset(sock->children, 0, children_size);
|
memset(sock->children, 0, children_size);
|
||||||
|
@@ -389,7 +389,7 @@ start_tcpdns_child(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nmsocket_t *sock,
|
|||||||
(isc__netievent_t *)ievent);
|
(isc__netievent_t *)ievent);
|
||||||
}
|
}
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentcpdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentcpdns(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
||||||
int backlog, isc_quota_t *quota, isc_nmsocket_t **sockp) {
|
int backlog, isc_quota_t *quota, isc_nmsocket_t **sockp) {
|
||||||
@@ -404,7 +404,9 @@ isc_nm_listentcpdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
|||||||
isc__nmsocket_init(sock, mgr, isc_nm_tcpdnslistener, iface);
|
isc__nmsocket_init(sock, mgr, isc_nm_tcpdnslistener, iface);
|
||||||
|
|
||||||
atomic_init(&sock->rchildren, 0);
|
atomic_init(&sock->rchildren, 0);
|
||||||
sock->nchildren = mgr->nworkers;
|
sock->nchildren = (workers == ISC_NM_LISTEN_ALL)
|
||||||
|
? (uint32_t)mgr->nworkers
|
||||||
|
: workers;
|
||||||
children_size = sock->nchildren * sizeof(sock->children[0]);
|
children_size = sock->nchildren * sizeof(sock->children[0]);
|
||||||
sock->children = isc_mem_get(mgr->mctx, children_size);
|
sock->children = isc_mem_get(mgr->mctx, children_size);
|
||||||
memset(sock->children, 0, children_size);
|
memset(sock->children, 0, children_size);
|
||||||
|
@@ -470,7 +470,7 @@ enqueue_stoplistening(isc_nmsocket_t *sock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentlsdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentlsdns(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
isc_nm_recv_cb_t recv_cb, void *recv_cbarg,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg,
|
||||||
int backlog, isc_quota_t *quota, isc_tlsctx_t *sslctx,
|
int backlog, isc_quota_t *quota, isc_tlsctx_t *sslctx,
|
||||||
@@ -486,7 +486,9 @@ isc_nm_listentlsdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
|||||||
isc__nmsocket_init(sock, mgr, isc_nm_tlsdnslistener, iface);
|
isc__nmsocket_init(sock, mgr, isc_nm_tlsdnslistener, iface);
|
||||||
|
|
||||||
atomic_init(&sock->rchildren, 0);
|
atomic_init(&sock->rchildren, 0);
|
||||||
sock->nchildren = mgr->nworkers;
|
sock->nchildren = (workers == ISC_NM_LISTEN_ALL)
|
||||||
|
? (uint32_t)mgr->nworkers
|
||||||
|
: workers;
|
||||||
children_size = sock->nchildren * sizeof(sock->children[0]);
|
children_size = sock->nchildren * sizeof(sock->children[0]);
|
||||||
sock->children = isc_mem_get(mgr->mctx, children_size);
|
sock->children = isc_mem_get(mgr->mctx, children_size);
|
||||||
memset(sock->children, 0, children_size);
|
memset(sock->children, 0, children_size);
|
||||||
|
@@ -642,7 +642,7 @@ tlslisten_acceptcb(isc_nmhandle_t *handle, isc_result_t result, void *cbarg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listentls(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
isc_nm_listentls(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
||||||
isc_quota_t *quota, SSL_CTX *sslctx, isc_nmsocket_t **sockp) {
|
isc_quota_t *quota, SSL_CTX *sslctx, isc_nmsocket_t **sockp) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
@@ -664,8 +664,8 @@ isc_nm_listentls(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
|||||||
* tlssock will be a TLS 'wrapper' around an unencrypted stream.
|
* tlssock will be a TLS 'wrapper' around an unencrypted stream.
|
||||||
* We set tlssock->outer to a socket listening for a TCP connection.
|
* We set tlssock->outer to a socket listening for a TCP connection.
|
||||||
*/
|
*/
|
||||||
result = isc_nm_listentcp(mgr, iface, tlslisten_acceptcb, tlssock,
|
result = isc_nm_listentcp(mgr, workers, iface, tlslisten_acceptcb,
|
||||||
backlog, quota, &tlssock->outer);
|
tlssock, backlog, quota, &tlssock->outer);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
atomic_store(&tlssock->closed, true);
|
atomic_store(&tlssock->closed, true);
|
||||||
isc__nmsocket_detach(&tlssock);
|
isc__nmsocket_detach(&tlssock);
|
||||||
|
@@ -146,8 +146,8 @@ enqueue_stoplistening(isc_nmsocket_t *sock) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
isc_nm_listenudp(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nm_recv_cb_t cb,
|
isc_nm_listenudp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
|
||||||
void *cbarg, isc_nmsocket_t **sockp) {
|
isc_nm_recv_cb_t cb, void *cbarg, isc_nmsocket_t **sockp) {
|
||||||
isc_result_t result = ISC_R_SUCCESS;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
isc_nmsocket_t *sock = NULL;
|
isc_nmsocket_t *sock = NULL;
|
||||||
size_t children_size = 0;
|
size_t children_size = 0;
|
||||||
@@ -162,7 +162,9 @@ isc_nm_listenudp(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nm_recv_cb_t cb,
|
|||||||
isc__nmsocket_init(sock, mgr, isc_nm_udplistener, iface);
|
isc__nmsocket_init(sock, mgr, isc_nm_udplistener, iface);
|
||||||
|
|
||||||
atomic_init(&sock->rchildren, 0);
|
atomic_init(&sock->rchildren, 0);
|
||||||
sock->nchildren = mgr->nworkers;
|
sock->nchildren = (workers == ISC_NM_LISTEN_ALL)
|
||||||
|
? (uint32_t)mgr->nworkers
|
||||||
|
: workers;
|
||||||
children_size = sock->nchildren * sizeof(sock->children[0]);
|
children_size = sock->nchildren * sizeof(sock->children[0]);
|
||||||
sock->children = isc_mem_get(mgr->mctx, children_size);
|
sock->children = isc_mem_get(mgr->mctx, children_size);
|
||||||
memset(sock->children, 0, children_size);
|
memset(sock->children, 0, children_size);
|
||||||
|
@@ -474,8 +474,9 @@ mock_doh_uv_tcp_bind(void **state) {
|
|||||||
result = isc_nm_http_endpoints_add(endpoints, ISC_NM_HTTP_DEFAULT_PATH,
|
result = isc_nm_http_endpoints_add(endpoints, ISC_NM_HTTP_DEFAULT_PATH,
|
||||||
noop_read_cb, NULL);
|
noop_read_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, NULL, NULL,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
endpoints, 0, &listen_sock);
|
&tcp_listen_addr, 0, NULL, NULL, endpoints,
|
||||||
|
0, &listen_sock);
|
||||||
assert_int_not_equal(result, ISC_R_SUCCESS);
|
assert_int_not_equal(result, ISC_R_SUCCESS);
|
||||||
assert_null(listen_sock);
|
assert_null(listen_sock);
|
||||||
|
|
||||||
@@ -495,8 +496,9 @@ doh_noop(void **state) {
|
|||||||
noop_read_cb, NULL);
|
noop_read_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, NULL, NULL,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
endpoints, 0, &listen_sock);
|
&tcp_listen_addr, 0, NULL, NULL, endpoints,
|
||||||
|
0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_nm_stoplistening(listen_sock);
|
isc_nm_stoplistening(listen_sock);
|
||||||
@@ -543,8 +545,9 @@ doh_noresponse(void **state) {
|
|||||||
noop_read_cb, NULL);
|
noop_read_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, NULL, NULL,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
endpoints, 0, &listen_sock);
|
&tcp_listen_addr, 0, NULL, NULL, endpoints,
|
||||||
|
0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
sockaddr_to_url(&tcp_listen_addr, false, req_url, sizeof(req_url),
|
sockaddr_to_url(&tcp_listen_addr, false, req_url, sizeof(req_url),
|
||||||
@@ -644,8 +647,9 @@ doh_timeout_recovery(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, NULL, NULL,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
endpoints, 0, &listen_sock);
|
&tcp_listen_addr, 0, NULL, NULL, endpoints,
|
||||||
|
0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -776,7 +780,8 @@ doh_recv_one(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, quotap,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
|
&tcp_listen_addr, 0, quotap,
|
||||||
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
||||||
endpoints, 0, &listen_sock);
|
endpoints, 0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
@@ -927,7 +932,8 @@ doh_recv_two(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, quotap,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
|
&tcp_listen_addr, 0, quotap,
|
||||||
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
||||||
endpoints, 0, &listen_sock);
|
endpoints, 0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
@@ -1047,7 +1053,8 @@ doh_recv_send(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, quotap,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
|
&tcp_listen_addr, 0, quotap,
|
||||||
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
||||||
endpoints, 0, &listen_sock);
|
endpoints, 0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
@@ -1160,7 +1167,8 @@ doh_recv_half_send(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, quotap,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
|
&tcp_listen_addr, 0, quotap,
|
||||||
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
||||||
endpoints, 0, &listen_sock);
|
endpoints, 0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
@@ -1270,7 +1278,8 @@ doh_half_recv_send(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, quotap,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
|
&tcp_listen_addr, 0, quotap,
|
||||||
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
||||||
endpoints, 0, &listen_sock);
|
endpoints, 0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
@@ -1380,7 +1389,8 @@ doh_half_recv_half_send(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, quotap,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
|
&tcp_listen_addr, 0, quotap,
|
||||||
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
atomic_load(&use_TLS) ? server_tlsctx : NULL,
|
||||||
endpoints, 0, &listen_sock);
|
endpoints, 0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
@@ -1489,8 +1499,9 @@ doh_bad_connect_uri(void **state) {
|
|||||||
doh_receive_request_cb, NULL);
|
doh_receive_request_cb, NULL);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
result = isc_nm_listenhttp(listen_nm, &tcp_listen_addr, 0, quotap,
|
result = isc_nm_listenhttp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
server_tlsctx, endpoints, 0, &listen_sock);
|
&tcp_listen_addr, 0, quotap, server_tlsctx,
|
||||||
|
endpoints, 0, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -633,8 +633,9 @@ mock_listenudp_uv_udp_open(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
WILL_RETURN(uv_udp_open, UV_ENOMEM);
|
WILL_RETURN(uv_udp_open, UV_ENOMEM);
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, noop_recv_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_not_equal(result, ISC_R_SUCCESS);
|
assert_int_not_equal(result, ISC_R_SUCCESS);
|
||||||
assert_null(listen_sock);
|
assert_null(listen_sock);
|
||||||
|
|
||||||
@@ -648,8 +649,9 @@ mock_listenudp_uv_udp_bind(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
WILL_RETURN(uv_udp_bind, UV_EADDRINUSE);
|
WILL_RETURN(uv_udp_bind, UV_EADDRINUSE);
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, noop_recv_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_not_equal(result, ISC_R_SUCCESS);
|
assert_int_not_equal(result, ISC_R_SUCCESS);
|
||||||
assert_null(listen_sock);
|
assert_null(listen_sock);
|
||||||
|
|
||||||
@@ -663,8 +665,9 @@ mock_listenudp_uv_udp_recv_start(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
WILL_RETURN(uv_udp_recv_start, UV_EADDRINUSE);
|
WILL_RETURN(uv_udp_recv_start, UV_EADDRINUSE);
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, noop_recv_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_not_equal(result, ISC_R_SUCCESS);
|
assert_int_not_equal(result, ISC_R_SUCCESS);
|
||||||
assert_null(listen_sock);
|
assert_null(listen_sock);
|
||||||
|
|
||||||
@@ -743,8 +746,9 @@ udp_noop(void **state __attribute__((unused))) {
|
|||||||
isc_result_t result = ISC_R_SUCCESS;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
isc_nmsocket_t *listen_sock = NULL;
|
isc_nmsocket_t *listen_sock = NULL;
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, noop_recv_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_nm_stoplistening(listen_sock);
|
isc_nm_stoplistening(listen_sock);
|
||||||
@@ -769,8 +773,9 @@ udp_noresponse(void **state __attribute__((unused))) {
|
|||||||
isc_result_t result = ISC_R_SUCCESS;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
isc_nmsocket_t *listen_sock = NULL;
|
isc_nmsocket_t *listen_sock = NULL;
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, noop_recv_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
@@ -830,8 +835,9 @@ udp_timeout_recovery(void **state __attribute__((unused))) {
|
|||||||
/*
|
/*
|
||||||
* Listen using the noop callback so that client reads will time out.
|
* Listen using the noop callback so that client reads will time out.
|
||||||
*/
|
*/
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, noop_recv_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -865,8 +871,9 @@ udp_recv_one(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
atomic_store(&nsends, 1);
|
atomic_store(&nsends, 1);
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, listen_read_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, listen_read_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
@@ -905,8 +912,9 @@ udp_recv_two(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
atomic_store(&nsends, 2);
|
atomic_store(&nsends, 2);
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, listen_read_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, listen_read_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
@@ -952,8 +960,9 @@ udp_recv_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, listen_read_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, listen_read_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -997,8 +1006,9 @@ udp_recv_half_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, listen_read_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, listen_read_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -1043,8 +1053,9 @@ udp_half_recv_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, listen_read_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, listen_read_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -1092,8 +1103,9 @@ udp_half_recv_half_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listenudp(listen_nm, &udp_listen_addr, listen_read_cb,
|
result = isc_nm_listenudp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, &listen_sock);
|
&udp_listen_addr, listen_read_cb, NULL,
|
||||||
|
&listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -1170,14 +1182,16 @@ stream_listen(isc_nm_accept_cb_t accept_cb, void *accept_cbarg, int backlog,
|
|||||||
|
|
||||||
#if HAVE_LIBNGHTTP2
|
#if HAVE_LIBNGHTTP2
|
||||||
if (stream_use_TLS) {
|
if (stream_use_TLS) {
|
||||||
result = isc_nm_listentls(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentls(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
accept_cb, accept_cbarg, backlog,
|
&tcp_listen_addr, accept_cb,
|
||||||
quota, tcp_listen_tlsctx, sockp);
|
accept_cbarg, backlog, quota,
|
||||||
|
tcp_listen_tlsctx, sockp);
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
result = isc_nm_listentcp(listen_nm, &tcp_listen_addr, accept_cb,
|
result = isc_nm_listentcp(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
accept_cbarg, backlog, quota, sockp);
|
&tcp_listen_addr, accept_cb, accept_cbarg,
|
||||||
|
backlog, quota, sockp);
|
||||||
|
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
@@ -1738,9 +1752,9 @@ tcpdns_noop(void **state __attribute__((unused))) {
|
|||||||
isc_result_t result = ISC_R_SUCCESS;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
isc_nmsocket_t *listen_sock = NULL;
|
isc_nmsocket_t *listen_sock = NULL;
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr, noop_recv_cb,
|
result = isc_nm_listentcpdns(
|
||||||
NULL, noop_accept_cb, NULL, 0, NULL,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, noop_recv_cb,
|
||||||
&listen_sock);
|
NULL, noop_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_nm_stoplistening(listen_sock);
|
isc_nm_stoplistening(listen_sock);
|
||||||
@@ -1766,9 +1780,9 @@ tcpdns_noresponse(void **state __attribute__((unused))) {
|
|||||||
isc_nmsocket_t *listen_sock = NULL;
|
isc_nmsocket_t *listen_sock = NULL;
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr, noop_recv_cb,
|
result = isc_nm_listentcpdns(
|
||||||
NULL, noop_accept_cb, NULL, 0, NULL,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, noop_recv_cb,
|
||||||
&listen_sock);
|
NULL, noop_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
isc_refcount_decrement(&active_cconnects);
|
isc_refcount_decrement(&active_cconnects);
|
||||||
isc_test_nap(1000);
|
isc_test_nap(1000);
|
||||||
@@ -1811,9 +1825,9 @@ tcpdns_timeout_recovery(void **state __attribute__((unused))) {
|
|||||||
* reads to time out.
|
* reads to time out.
|
||||||
*/
|
*/
|
||||||
noanswer = true;
|
noanswer = true;
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentcpdns(
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, listen_read_cb,
|
||||||
NULL, 0, NULL, &listen_sock);
|
NULL, listen_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1848,9 +1862,9 @@ tcpdns_recv_one(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
atomic_store(&nsends, 1);
|
atomic_store(&nsends, 1);
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentcpdns(
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, listen_read_cb,
|
||||||
NULL, 0, NULL, &listen_sock);
|
NULL, listen_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
@@ -1889,9 +1903,9 @@ tcpdns_recv_two(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
atomic_store(&nsends, 2);
|
atomic_store(&nsends, 2);
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentcpdns(
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, listen_read_cb,
|
||||||
NULL, 0, NULL, &listen_sock);
|
NULL, listen_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
@@ -1938,9 +1952,9 @@ tcpdns_recv_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentcpdns(
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, listen_read_cb,
|
||||||
NULL, 0, NULL, &listen_sock);
|
NULL, listen_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -1984,9 +1998,9 @@ tcpdns_recv_half_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentcpdns(
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, listen_read_cb,
|
||||||
NULL, 0, NULL, &listen_sock);
|
NULL, listen_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -2031,9 +2045,9 @@ tcpdns_half_recv_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentcpdns(
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, listen_read_cb,
|
||||||
NULL, 0, NULL, &listen_sock);
|
NULL, listen_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -2081,9 +2095,9 @@ tcpdns_half_recv_half_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentcpdns(
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
listen_nm, ISC_NM_LISTEN_ALL, &tcp_listen_addr, listen_read_cb,
|
||||||
NULL, 0, NULL, &listen_sock);
|
NULL, listen_accept_cb, NULL, 0, NULL, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -2318,8 +2332,9 @@ tlsdns_noop(void **state __attribute__((unused))) {
|
|||||||
isc_result_t result = ISC_R_SUCCESS;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
isc_nmsocket_t *listen_sock = NULL;
|
isc_nmsocket_t *listen_sock = NULL;
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr, noop_recv_cb,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, noop_accept_cb, NULL, 0, NULL,
|
&tcp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
noop_accept_cb, NULL, 0, NULL,
|
||||||
tcp_listen_tlsctx, &listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
@@ -2351,8 +2366,9 @@ tlsdns_noresponse(void **state __attribute__((unused))) {
|
|||||||
connect_addr = (isc_sockaddr_t){ .length = 0 };
|
connect_addr = (isc_sockaddr_t){ .length = 0 };
|
||||||
isc_sockaddr_fromin6(&connect_addr, &in6addr_loopback, 0);
|
isc_sockaddr_fromin6(&connect_addr, &in6addr_loopback, 0);
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr, noop_recv_cb,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, noop_accept_cb, NULL, 0, NULL,
|
&tcp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
noop_accept_cb, NULL, 0, NULL,
|
||||||
tcp_listen_tlsctx, &listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
@@ -2398,10 +2414,10 @@ tlsdns_timeout_recovery(void **state __attribute__((unused))) {
|
|||||||
* reads to time out.
|
* reads to time out.
|
||||||
*/
|
*/
|
||||||
noanswer = true;
|
noanswer = true;
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
&tcp_listen_addr, listen_read_cb, NULL,
|
||||||
NULL, 0, NULL, tcp_listen_tlsctx,
|
listen_accept_cb, NULL, 0, NULL,
|
||||||
&listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -2437,10 +2453,10 @@ tlsdns_recv_one(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
atomic_store(&nsends, 1);
|
atomic_store(&nsends, 1);
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
&tcp_listen_addr, listen_read_cb, NULL,
|
||||||
NULL, 0, NULL, tcp_listen_tlsctx,
|
listen_accept_cb, NULL, 0, NULL,
|
||||||
&listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
@@ -2480,10 +2496,10 @@ tlsdns_recv_two(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
atomic_store(&nsends, 2);
|
atomic_store(&nsends, 2);
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
&tcp_listen_addr, listen_read_cb, NULL,
|
||||||
NULL, 0, NULL, tcp_listen_tlsctx,
|
listen_accept_cb, NULL, 0, NULL,
|
||||||
&listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
@@ -2532,10 +2548,10 @@ tlsdns_recv_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
&tcp_listen_addr, listen_read_cb, NULL,
|
||||||
NULL, 0, NULL, tcp_listen_tlsctx,
|
listen_accept_cb, NULL, 0, NULL,
|
||||||
&listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -2579,10 +2595,10 @@ tlsdns_recv_half_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
&tcp_listen_addr, listen_read_cb, NULL,
|
||||||
NULL, 0, NULL, tcp_listen_tlsctx,
|
listen_accept_cb, NULL, 0, NULL,
|
||||||
&listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -2627,10 +2643,10 @@ tlsdns_half_recv_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
&tcp_listen_addr, listen_read_cb, NULL,
|
||||||
NULL, 0, NULL, tcp_listen_tlsctx,
|
listen_accept_cb, NULL, 0, NULL,
|
||||||
&listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -2678,10 +2694,10 @@ tlsdns_half_recv_half_send(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
SKIP_IN_CI;
|
SKIP_IN_CI;
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
listen_read_cb, NULL, listen_accept_cb,
|
&tcp_listen_addr, listen_read_cb, NULL,
|
||||||
NULL, 0, NULL, tcp_listen_tlsctx,
|
listen_accept_cb, NULL, 0, NULL,
|
||||||
&listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
memset(threads, 0, sizeof(threads));
|
memset(threads, 0, sizeof(threads));
|
||||||
@@ -2756,8 +2772,9 @@ tlsdns_connect_noalpn(void **state __attribute__((unused))) {
|
|||||||
connect_addr = (isc_sockaddr_t){ .length = 0 };
|
connect_addr = (isc_sockaddr_t){ .length = 0 };
|
||||||
isc_sockaddr_fromin6(&connect_addr, &in6addr_loopback, 0);
|
isc_sockaddr_fromin6(&connect_addr, &in6addr_loopback, 0);
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(listen_nm, &tcp_listen_addr, noop_recv_cb,
|
result = isc_nm_listentlsdns(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
NULL, noop_accept_cb, NULL, 0, NULL,
|
&tcp_listen_addr, noop_recv_cb, NULL,
|
||||||
|
noop_accept_cb, NULL, 0, NULL,
|
||||||
tcp_listen_tlsctx, &listen_sock);
|
tcp_listen_tlsctx, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
@@ -2823,9 +2840,9 @@ tlsdns_listen_noalpn(void **state __attribute__((unused))) {
|
|||||||
|
|
||||||
/* We use TLS stream listener here intentionally, as it does not
|
/* We use TLS stream listener here intentionally, as it does not
|
||||||
* try to do ALPN. */
|
* try to do ALPN. */
|
||||||
result = isc_nm_listentls(listen_nm, &tcp_listen_addr,
|
result = isc_nm_listentls(listen_nm, ISC_NM_LISTEN_ALL,
|
||||||
tls_accept_cb_noalpn, NULL, 0, NULL,
|
&tcp_listen_addr, tls_accept_cb_noalpn, NULL,
|
||||||
server_tlsctx_noalpn, &listen_sock);
|
0, NULL, server_tlsctx_noalpn, &listen_sock);
|
||||||
assert_int_equal(result, ISC_R_SUCCESS);
|
assert_int_equal(result, ISC_R_SUCCESS);
|
||||||
|
|
||||||
isc_refcount_increment0(&active_cconnects);
|
isc_refcount_increment0(&active_cconnects);
|
||||||
|
@@ -494,8 +494,9 @@ ns_interface_listenudp(ns_interface_t *ifp) {
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
/* Reserve space for an ns_client_t with the netmgr handle */
|
/* Reserve space for an ns_client_t with the netmgr handle */
|
||||||
result = isc_nm_listenudp(ifp->mgr->nm, &ifp->addr, ns__client_request,
|
result = isc_nm_listenudp(ifp->mgr->nm, ISC_NM_LISTEN_ALL, &ifp->addr,
|
||||||
ifp, &ifp->udplistensocket);
|
ns__client_request, ifp,
|
||||||
|
&ifp->udplistensocket);
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,8 +505,8 @@ ns_interface_listentcp(ns_interface_t *ifp) {
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
result = isc_nm_listentcpdns(
|
result = isc_nm_listentcpdns(
|
||||||
ifp->mgr->nm, &ifp->addr, ns__client_request, ifp,
|
ifp->mgr->nm, ISC_NM_LISTEN_ALL, &ifp->addr, ns__client_request,
|
||||||
ns__client_tcpconn, ifp, ifp->mgr->backlog,
|
ifp, ns__client_tcpconn, ifp, ifp->mgr->backlog,
|
||||||
&ifp->mgr->sctx->tcpquota, &ifp->tcplistensocket);
|
&ifp->mgr->sctx->tcpquota, &ifp->tcplistensocket);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR,
|
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR,
|
||||||
@@ -544,8 +545,8 @@ ns_interface_listentls(ns_interface_t *ifp, isc_tlsctx_t *sslctx) {
|
|||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
result = isc_nm_listentlsdns(
|
result = isc_nm_listentlsdns(
|
||||||
ifp->mgr->nm, &ifp->addr, ns__client_request, ifp,
|
ifp->mgr->nm, ISC_NM_LISTEN_ALL, &ifp->addr, ns__client_request,
|
||||||
ns__client_tcpconn, ifp, ifp->mgr->backlog,
|
ifp, ns__client_tcpconn, ifp, ifp->mgr->backlog,
|
||||||
&ifp->mgr->sctx->tcpquota, sslctx, &ifp->tcplistensocket);
|
&ifp->mgr->sctx->tcpquota, sslctx, &ifp->tcplistensocket);
|
||||||
|
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
@@ -590,9 +591,10 @@ ns_interface_listenhttp(ns_interface_t *ifp, isc_tlsctx_t *sslctx, char **eps,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (result == ISC_R_SUCCESS) {
|
if (result == ISC_R_SUCCESS) {
|
||||||
result = isc_nm_listenhttp(
|
result = isc_nm_listenhttp(ifp->mgr->nm, ISC_NM_LISTEN_ALL,
|
||||||
ifp->mgr->nm, &ifp->addr, ifp->mgr->backlog, quota,
|
&ifp->addr, ifp->mgr->backlog, quota,
|
||||||
sslctx, epset, max_concurrent_streams, &sock);
|
sslctx, epset,
|
||||||
|
max_concurrent_streams, &sock);
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_nm_http_endpoints_detach(&epset);
|
isc_nm_http_endpoints_detach(&epset);
|
||||||
|
Reference in New Issue
Block a user