mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-06 15:30:29 -05:00
264. [func] Dispatch can not take TCP sockets in connecting
state. Set DNS_DISPATCHATTR_CONNECTED when calling
dns_dispatch_createtcp() for connected TCP sockets
or call dns_dispatch_starttcp() when the socket is
connected.
This commit is contained in:
parent
c05ebd0da7
commit
3c671ac666
5 changed files with 37 additions and 1 deletions
10
CHANGES
10
CHANGES
|
|
@ -1,3 +1,13 @@
|
|||
266. [bug] zone.c:save_nsrrset() node was not initalised.
|
||||
|
||||
265. [bug] dns_request_create() not works for TCP.
|
||||
|
||||
264. [func] Dispatch can not take TCP sockets in connecting
|
||||
state. Set DNS_DISPATCHATTR_CONNECTED when calling
|
||||
dns_dispatch_createtcp() for connected TCP sockets
|
||||
or call dns_dispatch_starttcp() when the socket is
|
||||
connected.
|
||||
|
||||
263. [func] New logging channel type 'stderr'
|
||||
|
||||
channel some-name {
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ my_accept(isc_task_t *task, isc_event_t *ev_in) {
|
|||
attrs = 0;
|
||||
attrs |= DNS_DISPATCHATTR_IPV4;
|
||||
attrs |= DNS_DISPATCHATTR_TCP;
|
||||
attrs |= DNS_DISPATCHATTR_CONNECTED;
|
||||
disp = NULL;
|
||||
RUNTIME_CHECK(dns_dispatch_createtcp(dispatchmgr, ev->newsocket,
|
||||
taskmgr, 4096, 64, 1024,
|
||||
|
|
|
|||
|
|
@ -1643,7 +1643,9 @@ dns_dispatch_addresponse(dns_dispatch_t *disp, isc_sockaddr_t *dest,
|
|||
request_log(disp, res, LVL(90),
|
||||
"attached to task %p", res->task);
|
||||
|
||||
startrecv(disp);
|
||||
if (((disp->attributes & DNS_DISPATCHATTR_UDP) != 0) ||
|
||||
((disp->attributes & DNS_DISPATCHATTR_CONNECTED) != 0))
|
||||
startrecv(disp);
|
||||
|
||||
UNLOCK(&disp->lock);
|
||||
|
||||
|
|
@ -1653,6 +1655,19 @@ dns_dispatch_addresponse(dns_dispatch_t *disp, isc_sockaddr_t *dest,
|
|||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
void
|
||||
dns_dispatch_starttcp(dns_dispatch_t *disp) {
|
||||
|
||||
REQUIRE(VALID_DISPATCH(disp));
|
||||
|
||||
dispatch_log(disp, LVL(90), "starttcp %p", disp->task);
|
||||
|
||||
LOCK(&disp->lock);
|
||||
disp->attributes |= DNS_DISPATCHATTR_CONNECTED;
|
||||
startrecv(disp);
|
||||
UNLOCK(&disp->lock);
|
||||
}
|
||||
|
||||
void
|
||||
dns_dispatch_removeresponse(dns_dispentry_t **resp,
|
||||
dns_dispatchevent_t **sockevent)
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ struct dns_dispatchevent {
|
|||
#define DNS_DISPATCHATTR_IPV6 0x00000010U
|
||||
#define DNS_DISPATCHATTR_ACCEPTREQUEST 0x00000020U
|
||||
#define DNS_DISPATCHATTR_MAKEQUERY 0x00000040U
|
||||
#define DNS_DISPATCHATTR_CONNECTED 0x00000080U
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
|
|
@ -258,6 +259,14 @@ dns_dispatch_detach(dns_dispatch_t **dispp);
|
|||
* < mumble >
|
||||
*/
|
||||
|
||||
void
|
||||
dns_dispatch_starttcp(dns_dispatch_t *disp);
|
||||
/*
|
||||
* Start processing of a TCP dispatch.
|
||||
*
|
||||
* Requires:
|
||||
* 'disp' is valid.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_dispatch_addresponse(dns_dispatch_t *disp, isc_sockaddr_t *dest,
|
||||
|
|
|
|||
|
|
@ -1036,6 +1036,7 @@ resquery_connected(isc_task_t *task, isc_event_t *event) {
|
|||
attrs = 0;
|
||||
attrs |= DNS_DISPATCHATTR_TCP;
|
||||
attrs |= DNS_DISPATCHATTR_PRIVATE;
|
||||
attrs |= DNS_DISPATCHATTR_CONNECTED;
|
||||
if (isc_sockaddr_pf(&query->addrinfo->sockaddr) ==
|
||||
AF_INET)
|
||||
attrs |= DNS_DISPATCHATTR_IPV4;
|
||||
|
|
|
|||
Loading…
Reference in a new issue