request.c revision 0f80bfec687db08a6e6ce945ef1d818da06c7ca9
bd335c6465ddbafe543900df4b03247bfa288effesolom * Copyright (C) 2000 Internet Software Consortium.
bd335c6465ddbafe543900df4b03247bfa288effesolom * Permission to use, copy, modify, and distribute this software for any
cfe67ef216cc47c2a8013d229c1779ed629c16b3alanbur * purpose with or without fee is hereby granted, provided that the above
cfe67ef216cc47c2a8013d229c1779ed629c16b3alanbur * copyright notice and this permission notice appear in all copies.
bd335c6465ddbafe543900df4b03247bfa288effesolom * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
bd335c6465ddbafe543900df4b03247bfa288effesolom * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
bd335c6465ddbafe543900df4b03247bfa288effesolom * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
bd335c6465ddbafe543900df4b03247bfa288effesolom * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
bd335c6465ddbafe543900df4b03247bfa288effesolom * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
bd335c6465ddbafe543900df4b03247bfa288effesolom * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
bd335c6465ddbafe543900df4b03247bfa288effesolom * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
bd335c6465ddbafe543900df4b03247bfa288effesolom * SOFTWARE.
e436569b69740525d1c9f25a0c4b57e2ff041221John Sonnenschein#define VALID_REQUESTMGR(mgr) ((mgr) != NULL && \
bd335c6465ddbafe543900df4b03247bfa288effesolom#define VALID_REQUEST(request) ((request) != NULL && \
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartz /* locked */
bd335c6465ddbafe543900df4b03247bfa288effesolom unsigned int hash;
bd335c6465ddbafe543900df4b03247bfa288effesolom unsigned int hash;
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartz *** Forward
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic void mgr_destroy(dns_requestmgr_t *requestmgr);
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic void mgr_shutdown(dns_requestmgr_t *requestmgr);
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic unsigned int mgr_gethash(dns_requestmgr_t *requestmgr);
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic void send_shutdown_events(dns_requestmgr_t *requestmgr);
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic isc_result_t req_render(dns_message_t *message, isc_buffer_t **buffer,
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic void req_senddone(isc_task_t *task, isc_event_t *event);
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic void req_response(isc_task_t *task, isc_event_t *event);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesstatic void req_timeout(isc_task_t *task, isc_event_t *event);
7ff178cd8db129d385d3177eb20744d3b6efc59bJimmy Vetayasesstatic void req_connected(isc_task_t *task, isc_event_t *event);
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic void req_sendevent(dns_request_t *request, isc_result_t result);
2917a9c9c3eee6fcaedb239f5f68da01f4ed0da9schwartzstatic void req_log(int level, const char *fmt, ...);
return (ISC_R_NOMEMORY);
return (result);
for (i = 0; i < DNS_REQUEST_NLOCKS; i++) {
return (result);
return (ISC_R_SUCCESS);
if (need_destroy)
if (need_destroy)
for (i = 0; i < DNS_REQUEST_NLOCKS; i++)
static inline isc_result_t
isc_region_t r;
unsigned int attrs;
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
goto cleanup;
attrs = 0;
goto cleanup;
case PF_INET:
case PF_INET6:
goto cleanup;
goto cleanup;
goto use_tcp;
goto cleanup;
goto cleanup;
goto cleanup;
goto unlink;
goto unlink;
goto unlink;
goto unlink;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
isc_region_t r;
return (result);
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
return (ISC_R_SUCCESS);
request);
if (need_destroy)
(void)task;
isc_region_t r;
goto done;
r.length);
goto done;
done: