2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

netmgr refactoring: use generic functions when operating on sockets.

tcpdns used transport-specific functions to operate on the outer socket.
Use generic ones instead, and select the proper call in netmgr.c.
Make the missing functions (e.g. isc_nm_read) generic and add type-specific
calls (isc__nm_tcp_read). This is the preparation for netmgr TLS layer.
This commit is contained in:
Witold Kręcicki
2020-03-20 11:55:10 +01:00
committed by Witold Krecicki
parent aed3927592
commit 5fedd21e16
8 changed files with 114 additions and 41 deletions

View File

@@ -316,7 +316,7 @@ isc_nm_listentcpdns(isc_nm_t *mgr, isc_nmiface_t *iface, isc_nm_recv_cb_t cb,
}
void
isc_nm_tcpdns_stoplistening(isc_nmsocket_t *sock) {
isc__nm_tcpdns_stoplistening(isc_nmsocket_t *sock) {
REQUIRE(VALID_NMSOCK(sock));
REQUIRE(sock->type == isc_nm_tcpdnslistener);
@@ -326,7 +326,7 @@ isc_nm_tcpdns_stoplistening(isc_nmsocket_t *sock) {
sock->rcbarg = NULL;
if (sock->outer != NULL) {
isc_nm_tcp_stoplistening(sock->outer);
isc_nm_stoplistening(sock->outer);
isc_nmsocket_detach(&sock->outer);
}
}
@@ -494,7 +494,7 @@ isc__nm_tcpdns_send(isc_nmhandle_t *handle, isc_region_t *region,
*(uint16_t *)t->region.base = htons(region->length);
memmove(t->region.base + 2, region->base, region->length);
return (isc__nm_tcp_send(t->handle, &t->region, tcpdnssend_cb, t));
return (isc_nm_send(t->handle, &t->region, tcpdnssend_cb, t));
}
static void