• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/bind9-45.101/bind9/lib/dns/

Lines Matching refs:rctx

246 static void client_resfind(resctx_t *rctx, dns_fetchevent_t *event);
668 resctx_t *rctx = event->ev_arg;
672 REQUIRE(RCTX_VALID(rctx));
673 REQUIRE(rctx->task == task);
676 client_resfind(rctx, fevent);
680 start_fetch(resctx_t *rctx) {
684 * The caller must be holding the rctx's lock.
687 REQUIRE(rctx->fetch == NULL);
689 result = dns_resolver_createfetch(rctx->view->resolver,
690 dns_fixedname_name(&rctx->name),
691 rctx->type,
693 rctx->task, fetch_done, rctx,
694 rctx->rdataset,
695 rctx->sigrdataset,
696 &rctx->fetch);
702 view_find(resctx_t *rctx, dns_db_t **dbp, dns_dbnode_t **nodep,
706 dns_name_t *name = dns_fixedname_name(&rctx->name);
709 if (rctx->type == dns_rdatatype_rrsig)
712 type = rctx->type;
714 result = dns_view_find(rctx->view, name, type, 0, 0, ISC_FALSE,
715 dbp, nodep, foundname, rctx->rdataset,
716 rctx->sigrdataset);
722 client_resfind(resctx_t *rctx, dns_fetchevent_t *event) {
738 REQUIRE(RCTX_VALID(rctx));
740 LOCK(&rctx->lock);
742 mctx = rctx->view->mctx;
744 name = dns_fixedname_name(&rctx->name);
752 rctx->restarts++;
755 if (event == NULL && !rctx->canceled) {
758 INSIST(!dns_rdataset_isassociated(rctx->rdataset));
759 INSIST(rctx->sigrdataset == NULL ||
760 !dns_rdataset_isassociated(rctx->sigrdataset));
761 result = view_find(rctx, &db, &node, fname);
773 result = start_fetch(rctx);
775 putrdataset(mctx, &rctx->rdataset);
776 if (rctx->sigrdataset != NULL)
778 &rctx->sigrdataset);
785 INSIST(event->fetch == rctx->fetch);
786 dns_resolver_destroyfetch(&rctx->fetch);
792 INSIST(event->rdataset == rctx->rdataset);
793 INSIST(event->sigrdataset == rctx->sigrdataset);
799 if (rctx->canceled)
812 aname = dns_fixedname_name(&rctx->name);
834 trdataset = rctx->rdataset;
835 ISC_LIST_APPEND(ansname->list, rctx->rdataset, link);
836 rctx->rdataset = NULL;
837 if (rctx->sigrdataset != NULL) {
839 rctx->sigrdataset, link);
840 rctx->sigrdataset = NULL;
842 ISC_LIST_APPEND(rctx->namelist, ansname, link);
868 trdataset = rctx->rdataset;
869 ISC_LIST_APPEND(ansname->list, rctx->rdataset, link);
870 rctx->rdataset = NULL;
871 if (rctx->sigrdataset != NULL) {
873 rctx->sigrdataset, link);
874 rctx->sigrdataset = NULL;
876 ISC_LIST_APPEND(rctx->namelist, ansname, link);
913 ISC_LIST_APPEND(ansname->list, rctx->rdataset, link);
914 ISC_LIST_APPEND(rctx->namelist, ansname, link);
916 rctx->rdataset = NULL;
918 if (rctx->sigrdataset != NULL)
919 putrdataset(mctx, &rctx->sigrdataset);
923 if (rctx->rdataset != NULL)
924 putrdataset(mctx, &rctx->rdataset);
925 if (rctx->sigrdataset != NULL)
926 putrdataset(mctx, &rctx->sigrdataset);
931 if (rctx->type == dns_rdatatype_any) {
945 rctx->rdataset);
946 if (rctx->rdataset->type != 0) {
948 rctx->rdataset,
951 rctx->rdataset = NULL;
958 rctx->rdataset);
963 rctx->rdataset == NULL) {
965 &rctx->rdataset);
982 ISC_LIST_APPEND(rctx->namelist, ansname, link);
996 ISC_LIST_APPEND(ansname->list, rctx->rdataset, link);
997 rctx->rdataset = NULL;
998 if (rctx->sigrdataset != NULL) {
1000 rctx->sigrdataset, link);
1001 rctx->sigrdataset = NULL;
1003 ISC_LIST_APPEND(rctx->namelist, ansname, link);
1033 if (want_restart && rctx->restarts == MAX_RESTARTS) {
1043 INSIST(rctx->rdataset == NULL &&
1044 rctx->sigrdataset == NULL);
1046 result = getrdataset(mctx, &rctx->rdataset);
1047 if (result == ISC_R_SUCCESS && rctx->want_dnssec) {
1048 result = getrdataset(mctx, &rctx->sigrdataset);
1050 putrdataset(mctx, &rctx->rdataset);
1064 while ((name = ISC_LIST_HEAD(rctx->namelist)) != NULL) {
1065 ISC_LIST_UNLINK(rctx->namelist, name, link);
1066 ISC_LIST_APPEND(rctx->event->answerlist, name, link);
1069 rctx->event->result = result;
1070 rctx->event->vresult = vresult;
1071 task = rctx->event->ev_sender;
1072 rctx->event->ev_sender = rctx;
1073 isc_task_sendanddetach(&task, ISC_EVENT_PTR(&rctx->event));
1076 UNLOCK(&rctx->lock);
1210 resctx_t *rctx = NULL;
1247 rctx = isc_mem_get(mctx, sizeof(*rctx));
1248 if (rctx == NULL)
1251 result = isc_mutex_init(&rctx->lock);
1253 isc_mem_put(mctx, rctx, sizeof(*rctx));
1254 rctx = NULL;
1263 rctx->rdataset = rdataset;
1270 rctx->sigrdataset = sigrdataset;
1272 dns_fixedname_init(&rctx->name);
1273 result = dns_name_copy(name, dns_fixedname_name(&rctx->name), NULL);
1277 rctx->client = client;
1278 ISC_LINK_INIT(rctx, link);
1279 rctx->canceled = ISC_FALSE;
1280 rctx->task = client->task;
1281 rctx->type = type;
1282 rctx->view = view;
1283 rctx->restarts = 0;
1284 rctx->fetch = NULL;
1285 rctx->want_dnssec = want_dnssec;
1286 ISC_LIST_INIT(rctx->namelist);
1287 rctx->event = event;
1289 rctx->magic = RCTX_MAGIC;
1292 ISC_LIST_APPEND(client->resctxs, rctx, link);
1295 client_resfind(rctx, NULL);
1297 *transp = (dns_clientrestrans_t *)rctx;
1306 if (rctx != NULL) {
1307 DESTROYLOCK(&rctx->lock);
1308 isc_mem_put(mctx, rctx, sizeof(*rctx));
1320 resctx_t *rctx;
1323 rctx = (resctx_t *)trans;
1324 REQUIRE(RCTX_VALID(rctx));
1326 LOCK(&rctx->lock);
1328 if (!rctx->canceled) {
1329 rctx->canceled = ISC_TRUE;
1330 if (rctx->fetch != NULL)
1331 dns_resolver_cancelfetch(rctx->fetch);
1334 UNLOCK(&rctx->lock);
1358 resctx_t *rctx;
1364 rctx = (resctx_t *)*transp;
1365 REQUIRE(RCTX_VALID(rctx));
1366 REQUIRE(rctx->fetch == NULL);
1367 REQUIRE(rctx->event == NULL);
1368 client = rctx->client;
1372 dns_view_detach(&rctx->view);
1376 INSIST(ISC_LINK_LINKED(rctx, link));
1377 ISC_LIST_UNLINK(client->resctxs, rctx, link);
1386 INSIST(ISC_LIST_EMPTY(rctx->namelist));
1388 DESTROYLOCK(&rctx->lock);
1389 rctx->magic = 0;
1391 isc_mem_put(mctx, rctx, sizeof(*rctx));