]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: dns: remove duplicated code in dns_resolve_recv()
authorBaptiste Assmann <bassmann@haproxy.com>
Mon, 21 Aug 2017 14:09:59 +0000 (16:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Aug 2017 09:40:00 +0000 (11:40 +0200)
by mistake, I duplicated a block when introductiing the list_for_each loop
on a resolution's requester list.

src/dns.c

index bc463ee6304de21c9a1399b66a7d78c04a38f486..82c7329916526ccb068228a671642657868c5edc 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -633,36 +633,8 @@ void dns_resolve_recv(struct dgram_conn *dgram)
                                                            "%d", item1->weight);
                                                        server_parse_weight_change_request(srv, weight);
                                                }
-
                                        }
                                }
-                               /* If not, try to find a server that is down */
-                               if (!srv) {
-                                       for (srv = srvrq->proxy->srv; srv != NULL; srv = srv->next) {
-
-                                               if (srv->srvrq == srvrq &&
-                                                   !srv->hostname_dn)
-                                                       break;
-                                       }
-                                       if (srv) {
-                                               char weight[9];
-
-                                               char hostname[DNS_MAX_NAME_SIZE];
-
-                                               if (item1->data_len > DNS_MAX_NAME_SIZE)
-                                                       continue;
-                                               dns_dn_label_to_str(item1->target, hostname, item1->data_len);
-                                               update_server_fqdn(srv, hostname, "SRV record");
-                                               srv->svc_port = item1->port;
-                                               srv->flags &= ~SRV_F_MAPPORTS;
-                                               if ((srv->check.state & CHK_ST_CONFIGURED) && !(srv->flags & SRV_F_CHECKPORT))
-                                                       srv->check.port = item1->port;
-                                               snprintf(weight, sizeof(weight),
-                                                   "%d", item1->weight);
-                                               server_parse_weight_change_request(srv, weight);
-                                       }
-
-                               }
                        }
                }
                if (removed_reso)