Home | History | Annotate | Download | only in dns

Lines Matching refs:requestmgr

82 	dns_requestmgr_t *requestmgr;
135 dns_requestmgr_t *requestmgr = isc_mem_get(mctx, sizeof(*requestmgr));
136 *requestmgr = (dns_requestmgr_t){
140 isc_mem_attach(mctx, &requestmgr->mctx);
142 uint32_t nloops = isc_loopmgr_nloops(requestmgr->loopmgr);
143 requestmgr->requests = isc_mem_cget(requestmgr->mctx, nloops,
144 sizeof(requestmgr->requests[0]));
146 ISC_LIST_INIT(requestmgr->requests[i]);
149 isc_loop_ref(isc_loop_get(requestmgr->loopmgr, i));
152 dns_dispatchmgr_attach(dispatchmgr, &requestmgr->dispatchmgr);
155 dns_dispatchset_create(requestmgr->mctx, dispatchv4,
156 &requestmgr->dispatches4,
157 isc_loopmgr_nloops(requestmgr->loopmgr));
160 dns_dispatchset_create(requestmgr->mctx, dispatchv6,
161 &requestmgr->dispatches6,
162 isc_loopmgr_nloops(requestmgr->loopmgr));
165 isc_refcount_init(&requestmgr->references, 1);
167 req_log(ISC_LOG_DEBUG(3), "%s: %p", __func__, requestmgr);
169 *requestmgrp = requestmgr;
175 dns_requestmgr_t *requestmgr = arg;
179 ISC_LIST_FOREACH_SAFE(requestmgr->requests[tid], request, link, next) {
189 isc_loop_unref(isc_loop_get(requestmgr->loopmgr, tid));
190 dns_requestmgr_detach(&requestmgr);
194 dns_requestmgr_shutdown(dns_requestmgr_t *requestmgr) {
196 REQUIRE(VALID_REQUESTMGR(requestmgr));
198 req_log(ISC_LOG_DEBUG(3), "%s: %p", __func__, requestmgr);
201 first = atomic_compare_exchange_strong(&requestmgr->shuttingdown,
216 uint32_t nloops = isc_loopmgr_nloops(requestmgr->loopmgr);
218 dns_requestmgr_ref(requestmgr);
222 requests_cancel(requestmgr);
226 isc_loop_t *loop = isc_loop_get(requestmgr->loopmgr, i);
227 isc_async_run(loop, requests_cancel, requestmgr);
232 requestmgr_destroy(dns_requestmgr_t *requestmgr) {
235 INSIST(atomic_load(&requestmgr->shuttingdown));
237 size_t nloops = isc_loopmgr_nloops(requestmgr->loopmgr);
239 INSIST(ISC_LIST_EMPTY(requestmgr->requests[i]));
241 isc_mem_cput(requestmgr->mctx, requestmgr->requests, nloops,
242 sizeof(requestmgr->requests[0]));
244 if (requestmgr->dispatches4 != NULL) {
245 dns_dispatchset_destroy(&requestmgr->dispatches4);
247 if (requestmgr->dispatches6 != NULL) {
248 dns_dispatchset_destroy(&requestmgr->dispatches6);
250 if (requestmgr->dispatchmgr != NULL) {
251 dns_dispatchmgr_detach(&requestmgr->dispatchmgr);
253 requestmgr->magic = 0;
254 isc_mem_putanddetach(&requestmgr->mctx, requestmgr,
255 sizeof(*requestmgr));
341 tcp_dispatch(dns_requestmgr_t *requestmgr, const isc_sockaddr_t *srcaddr,
345 requestmgr->dispatchmgr, srcaddr, destaddr, transport,
350 udp_dispatch(dns_requestmgr_t *requestmgr, const isc_sockaddr_t *srcaddr,
357 disp = dns_dispatchset_get(requestmgr->dispatches4);
361 disp = dns_dispatchset_get(requestmgr->dispatches6);
374 return dns_dispatch_createudp(requestmgr->dispatchmgr, srcaddr,
379 get_dispatch(bool tcp, dns_requestmgr_t *requestmgr,
386 result = tcp_dispatch(requestmgr, srcaddr, destaddr, transport,
389 result = udp_dispatch(requestmgr, srcaddr, destaddr, dispatchp);
395 dns_request_createraw(dns_requestmgr_t *requestmgr, isc_buffer_t *msgbuf,
411 REQUIRE(VALID_REQUESTMGR(requestmgr));
424 mctx = requestmgr->mctx;
430 if (atomic_load_acquire(&requestmgr->shuttingdown)) {
435 if (isblackholed(requestmgr->dispatchmgr, destaddr)) {
464 result = get_dispatch(tcp, requestmgr, srcaddr, destaddr, transport,
489 dns_requestmgr_attach(requestmgr, &request->requestmgr);
490 ISC_LIST_APPEND(requestmgr->requests[request->tid], request, link);
516 dns_request_create(dns_requestmgr_t *requestmgr, dns_message_t *message,
530 REQUIRE(VALID_REQUESTMGR(requestmgr));
545 mctx = requestmgr->mctx;
551 if (atomic_load_acquire(&requestmgr->shuttingdown)) {
556 if (isblackholed(requestmgr->dispatchmgr, destaddr)) {
578 result = get_dispatch(tcp, requestmgr, srcaddr, destaddr, transport, 0,
617 dns_requestmgr_attach(requestmgr, &request->requestmgr);
618 ISC_LIST_APPEND(requestmgr->requests[request->tid], request, link);
942 ISC_LIST_UNLINK(request->requestmgr->requests[request->tid],
1006 if (request->requestmgr != NULL) {
1007 dns_requestmgr_detach(&request->requestmgr);