]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] Manage socket type unix for some logs
authorEmeric Brun <ebrun@exceliance.fr>
Fri, 22 Oct 2010 15:42:55 +0000 (17:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Nov 2010 14:59:41 +0000 (15:59 +0100)
src/proxy.c

index 99594980ac0e21eddae9f164453af30fc45a05e1..c19842fd4e3ae2384a3dfd236c408345f0e6e575 100644 (file)
@@ -687,15 +687,27 @@ void listen_proxies(void)
                                } else {
                                        int port;
 
-                                       if (l->addr.ss_family == AF_INET6)
+                                       if (l->addr.ss_family == AF_INET6) {
                                                port = ntohs(((struct sockaddr_in6 *)(&l->addr))->sin6_port);
-                                       else
+                                               Warning("Port %d busy while trying to enable %s %s.\n",
+                                                       port, proxy_cap_str(p->cap), p->id);
+                                               send_log(p, LOG_WARNING, "Port %d busy while trying to enable %s %s.\n",
+                                                        port, proxy_cap_str(p->cap), p->id);
+                                       }
+                                       else if (l->addr.ss_family == AF_INET) {
                                                port = ntohs(((struct sockaddr_in *)(&l->addr))->sin_port);
+                                               Warning("Port %d busy while trying to enable %s %s.\n",
+                                                       port, proxy_cap_str(p->cap), p->id);
+                                               send_log(p, LOG_WARNING, "Port %d busy while trying to enable %s %s.\n",
+                                                        port, proxy_cap_str(p->cap), p->id);
+                                       }
+                                       else {
+                                               Warning("Bind on socket %d busy while trying to enable %s %s.\n",
+                                                       l->luid, proxy_cap_str(p->cap), p->id);
+                                               send_log(p, LOG_WARNING, "Bind on socket %d busy while trying to enable %s %s.\n",
+                                                        l->luid, proxy_cap_str(p->cap), p->id);
+                                       }
 
-                                       Warning("Port %d busy while trying to enable %s %s.\n",
-                                               port, proxy_cap_str(p->cap), p->id);
-                                       send_log(p, LOG_WARNING, "Port %d busy while trying to enable %s %s.\n",
-                                                port, proxy_cap_str(p->cap), p->id);
                                        /* Another port might have been enabled. Let's stop everything. */
                                        pause_proxy(p);
                                        break;