Commit 26a93d77 authored by Mark Andrews's avatar Mark Andrews
Browse files

move maxbuffers test to allocate_udp_buffer

parent 011af4de
Pipeline #26334 passed with stages
in 28 minutes and 26 seconds
......@@ -915,6 +915,10 @@ allocate_udp_buffer(dns_dispatch_t *disp) {
void *temp;
LOCK(&disp->mgr->buffer_lock);
if (disp->mgr->buffers >= disp->mgr->maxbuffers) {
UNLOCK(&disp->mgr->buffer_lock);
return (NULL);
}
bpool = disp->mgr->bpool;
disp->mgr->buffers++;
UNLOCK(&disp->mgr->buffer_lock);
......@@ -1500,15 +1504,6 @@ startrecv(dns_dispatch_t *disp, dispsocket_t *dispsock) {
if (disp->recv_pending != 0 && dispsock == NULL)
return (ISC_R_SUCCESS);
if (disp->socktype == isc_sockettype_udp) {
LOCK(&disp->mgr->buffer_lock);
if (disp->mgr->buffers >= disp->mgr->maxbuffers) {
UNLOCK(&disp->mgr->buffer_lock);
return (ISC_R_NOMEMORY);
}
UNLOCK(&disp->mgr->buffer_lock);
}
if ((disp->attributes & DNS_DISPATCHATTR_EXCLUSIVE) != 0 &&
dispsock == NULL)
return (ISC_R_SUCCESS);
......
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