summaryrefslogtreecommitdiff
path: root/main/fastcgi.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/fastcgi.c')
-rw-r--r--main/fastcgi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/fastcgi.c b/main/fastcgi.c
index ce33369045..8fc7d6a968 100644
--- a/main/fastcgi.c
+++ b/main/fastcgi.c
@@ -692,7 +692,7 @@ int fcgi_listen(const char *path, int backlog)
if(strlen(host) > MAXFQDNLEN) {
hep = NULL;
} else {
- hep = gethostbyname(host);
+ hep = php_network_gethostbyname(host);
}
if (!hep || hep->h_addrtype != AF_INET || !hep->h_addr_list[0]) {
fcgi_log(FCGI_ERROR, "Cannot resolve host name '%s'!\n", host);
@@ -1049,7 +1049,12 @@ static int fcgi_read_request(fcgi_request *req)
req->in_len = 0;
req->out_hdr = NULL;
req->out_pos = req->out_buf;
- req->has_env = 1;
+
+ if (req->has_env) {
+ fcgi_hash_clean(&req->env);
+ } else {
+ req->has_env = 1;
+ }
if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
hdr.version < FCGI_VERSION_1) {