Bug #2333 » mod_cgi.c.patch
mod_cgi.c 2012-03-16 10:42:28.000000000 +0800 | ||
---|---|---|
if (!buffer_is_empty(con->server_name)) {
|
||
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;
|
||
cgi_env_add(&env, CONST_STR_LEN("SERVER_NAME"), con->server_name->ptr, len);
|