From 50ffb9d2582ce3fa2d3f12fa50fbd735a8853826 Mon Sep 17 00:00:00 2001 From: Unbit Date: Sat, 9 Feb 2013 17:34:31 +0100 Subject: [PATCH] reapply fixed-SERVER_PORT-in-routers-when-shared-sockets-are.patch --- plugins/corerouter/cr_common.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/corerouter/cr_common.c b/plugins/corerouter/cr_common.c index 3d0a4013..7a7709df 100644 --- a/plugins/corerouter/cr_common.c +++ b/plugins/corerouter/cr_common.c @@ -59,6 +59,14 @@ void uwsgi_corerouter_setup_sockets(struct uwsgi_corerouter *ucr) { uwsgi.no_defer_accept = current_defer_accept; } } + // fix SERVER_PORT + if (!ugs->port || !ugs->port_len) { + ugs->port = strchr(ugs->name, ':'); + if (ugs->port) { + ugs->port++; + ugs->port_len = strlen(ugs->port); + } + } // put socket in non-blocking mode uwsgi_socket_nb(ugs->fd); uwsgi_log("%s bound on %s fd %d\n", ucr->name, ugs->name, ugs->fd);