]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
libdns refactoring: get rid of two versions of dns_adb_createfind and dns_adb_probesize
authorWitold Kręcicki <wpk@isc.org>
Tue, 3 Apr 2018 11:10:03 +0000 (13:10 +0200)
committerWitold Kręcicki <wpk@isc.org>
Fri, 6 Apr 2018 06:04:41 +0000 (08:04 +0200)
bin/tests/optional/adb_test.c
bin/tests/optional/byname_test.c
lib/dns/adb.c
lib/dns/include/dns/adb.h
lib/dns/resolver.c
lib/dns/win32/libdns.def.in
lib/dns/zone.c

index efec3706d193f53a04abd8c5e57d46ca088dd66a..97bf3cfaf9861e7a48163be766dbc72c8e21704f 100644 (file)
@@ -258,7 +258,8 @@ lookup(const char *target) {
        options |= DNS_ADBFIND_GLUEOK;
        result = dns_adb_createfind(adb, t2, lookup_callback, client,
                                    &client->name, dns_rootname, 0, options,
-                                   now, NULL, view->dstport, &client->find);
+                                   now, NULL, view->dstport, 0, NULL,
+                                   &client->find);
        if (result != ISC_R_SUCCESS)
                printf("DNS_ADB_CREATEFIND -> %s\n", dns_result_totext(result));
        dns_adb_dumpfind(client->find, stderr);
index 0990967043ae1ec0b2076833e7644d20610a57f4..fb4b2b8413cc02502abd48c70dc98ce2b5269772 100644 (file)
@@ -120,7 +120,7 @@ do_find(isc_boolean_t want_event) {
                                    dns_fixedname_name(&fixed),
                                    dns_rootname, 0, options, 0,
                                    dns_fixedname_name(&target), 0,
-                                   &find);
+                                   0, NULL, &find);
        if (result == ISC_R_SUCCESS) {
                if (!ISC_LIST_EMPTY(find->list)) {
                        /*
index 68cffe96e511cd4bc0b829bb487793ae437617fc..c052fa11bac855fae8f49f0ca9d012894b5e2021 100644 (file)
@@ -2937,20 +2937,8 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
                   void *arg, const dns_name_t *name, const dns_name_t *qname,
                   dns_rdatatype_t qtype, unsigned int options,
                   isc_stdtime_t now, dns_name_t *target,
-                  in_port_t port, dns_adbfind_t **findp)
-{
-       return (dns_adb_createfind2(adb, task, action, arg, name,
-                                   qname, qtype, options, now,
-                                   target, port, 0, NULL, findp));
-}
-
-isc_result_t
-dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
-                   void *arg, const dns_name_t *name, const dns_name_t *qname,
-                   dns_rdatatype_t qtype, unsigned int options,
-                   isc_stdtime_t now, dns_name_t *target,
-                   in_port_t port, unsigned int depth, isc_counter_t *qc,
-                   dns_adbfind_t **findp)
+                  in_port_t port, unsigned int depth, isc_counter_t *qc,
+                  dns_adbfind_t **findp)
 {
        dns_adbfind_t *find;
        dns_adbname_t *adbname;
@@ -4481,12 +4469,7 @@ dns_adb_getudpsize(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
 }
 
 unsigned int
-dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr) {
-       return dns_adb_probesize2(adb, addr, 0);
-}
-
-unsigned int
-dns_adb_probesize2(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups) {
+dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups) {
        int bucket;
        unsigned int size;
 
index e04605415ce7897767c4ddbd657e1185d7e46968..7331d1c54e512dd098026ffd15e6030aa894e6ae 100644 (file)
@@ -333,15 +333,9 @@ isc_result_t
 dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
                   void *arg, const dns_name_t *name, const dns_name_t *qname,
                   dns_rdatatype_t qtype, unsigned int options,
-                  isc_stdtime_t now, dns_name_t *target,
-                  in_port_t port, dns_adbfind_t **find);
-isc_result_t
-dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
-                   void *arg, const dns_name_t *name, const dns_name_t *qname,
-                   dns_rdatatype_t qtype, unsigned int options,
-                   isc_stdtime_t now, dns_name_t *target, in_port_t port,
-                   unsigned int depth, isc_counter_t *qc,
-                   dns_adbfind_t **find);
+                  isc_stdtime_t now, dns_name_t *target, in_port_t port,
+                  unsigned int depth, isc_counter_t *qc,
+                  dns_adbfind_t **find);
 /*%<
  * Main interface for clients. The adb will look up the name given in
  * "name" and will build up a list of found addresses, and perhaps start
@@ -611,9 +605,7 @@ dns_adb_getudpsize(dns_adb_t *adb, dns_adbaddrinfo_t *addr);
  */
 
 unsigned int
-dns_adb_probesize(dns_adb_t *adb, dns_adbaddrinfo_t *addr);
-unsigned int
-dns_adb_probesize2(dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups);
+dns_adb_probesize (dns_adb_t *adb, dns_adbaddrinfo_t *addr, int lookups);
 /*%
  * Return suggested EDNS UDP size based on observed responses / failures.
  * 'lookups' is the number of times the current lookup has been attempted.
index 86a45a6849809afebffaeb6c37c9b3f85fa3af29..b7b46db2e060cd05b92eb756714d181ee60640d2 100644 (file)
@@ -2538,9 +2538,9 @@ resquery_send(resquery_t *query) {
 
                        if ((flags & FCTX_ADDRINFO_EDNSOK) != 0 &&
                            (query->options & DNS_FETCHOPT_EDNS512) == 0) {
-                               udpsize = dns_adb_probesize2(fctx->adb,
-                                                            query->addrinfo,
-                                                            fctx->timeouts);
+                               udpsize = dns_adb_probesize(fctx->adb,
+                                                           query->addrinfo,
+                                                           fctx->timeouts);
                                if (udpsize > res->udpsize)
                                        udpsize = res->udpsize;
                        }
@@ -3346,13 +3346,13 @@ findname(fetchctx_t *fctx, const dns_name_t *name, in_port_t port,
         * See what we know about this address.
         */
        find = NULL;
-       result = dns_adb_createfind2(fctx->adb,
-                                    res->buckets[fctx->bucketnum].task,
-                                    fctx_finddone, fctx, name,
-                                    &fctx->name, fctx->type,
-                                    options, now, NULL,
-                                    res->view->dstport,
-                                    fctx->depth + 1, fctx->qc, &find);
+       result = dns_adb_createfind(fctx->adb,
+                                   res->buckets[fctx->bucketnum].task,
+                                   fctx_finddone, fctx, name,
+                                   &fctx->name, fctx->type,
+                                   options, now, NULL,
+                                   res->view->dstport,
+                                   fctx->depth + 1, fctx->qc, &find);
        if (result != ISC_R_SUCCESS) {
                if (result == DNS_R_ALIAS) {
                        char namebuf[DNS_NAME_FORMATSIZE];
index 0a00eb6aa95328e370e97587bdbd58ffb64cdc05..7b8e883192dba028e58d8385620050bde0a2bfc3 100644 (file)
@@ -32,7 +32,6 @@ dns_adb_cancelfind
 dns_adb_changeflags
 dns_adb_create
 dns_adb_createfind
-dns_adb_createfind2
 dns_adb_destroyfind
 dns_adb_detach
 dns_adb_dump
@@ -50,7 +49,6 @@ dns_adb_marklame
 dns_adb_noedns
 dns_adb_plainresponse
 dns_adb_probesize
-dns_adb_probesize2
 dns_adb_setadbsize
 dns_adb_setcookie
 dns_adb_setquota
index 5e402f95adc1800960eaa24b6d9bb964cc10db83..707d5c9fc7fe853835879bd1f61b7d96ca735a6f 100644 (file)
@@ -10858,7 +10858,7 @@ notify_find_address(dns_notify_t *notify) {
                                    &notify->ns, dns_rootname, 0,
                                    options, 0, NULL,
                                    notify->zone->view->dstport,
-                                   &notify->find);
+                                   0, NULL, &notify->find);
 
        /* Something failed? */
        if (result != ISC_R_SUCCESS)