Created
March 16, 2012 10:58
-
-
Save simoncpu/2049587 to your computer and use it in GitHub Desktop.
lighttpd patch for Bug #2333
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- mod_fastcgi.c.orig 2012-03-16 10:51:07.000000000 +0800 | |
+++ mod_fastcgi.c 2012-03-16 10:42:16.000000000 +0800 | |
@@ -1857,7 +1857,16 @@ | |
if (con->server_name->used) { | |
size_t len = con->server_name->used - 1; | |
- char *colon = strchr(con->server_name->ptr, ':'); | |
+ char *colon; | |
+#ifdef HAVE_IPV6 | |
+ if (srv_sock->addr.plain.sa_family == AF_INET6) { | |
+ colon = strstr(con->server_name->ptr, "]:") + 1; | |
+ } else { | |
+ colon = strchr(con->server_name->ptr, ':'); | |
+ } | |
+#else | |
+ colon = strchr(con->server_name->ptr, ':'); | |
+#endif | |
if (colon) len = colon - con->server_name->ptr; | |
FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len),con) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment