MINOR: dns: make SRV record processing more verbose
For troubleshooting purpose, it may be important to know when a server
got its fqdn updated by a SRV record.
This patch makes HAProxy to report such events through stderr and logs.
diff --git a/src/dns.c b/src/dns.c
index 52e0202..bc463ee 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -615,13 +615,16 @@
}
if (srv) {
char weight[9];
-
+ const char *msg = NULL;
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");
+ msg = update_server_fqdn(srv, hostname, "SRV record");
+ if (msg)
+ send_log(srv->proxy, LOG_NOTICE, "%s", msg);
+
srv->svc_port = item1->port;
srv->flags &= ~SRV_F_MAPPORTS;
if ((srv->check.state & CHK_ST_CONFIGURED) && !(srv->flags & SRV_F_CHECKPORT))