diff options
author | Sascha Schumann <sas@php.net> | 2000-11-12 21:10:09 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2000-11-12 21:10:09 +0000 |
commit | 6a149caaede4c2f258b39c8647d16e4376c50d3a (patch) | |
tree | f6efe11bc2c83dfc6beefa7bbad4486f3d57c834 | |
parent | 20ab5c58c75630ac83dd4d71aed626de03a8795b (diff) | |
download | php-git-6a149caaede4c2f258b39c8647d16e4376c50d3a.tar.gz |
Fix aborted connection handling and stop modifying thttpd data
-rw-r--r-- | sapi/thttpd/thttpd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index 9dbf93a490..37104565a9 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -45,7 +45,7 @@ static int sapi_thttpd_ub_write(const char *str, uint str_length) n = send(TG(hc)->conn_fd, str, str_length, 0); - if (n == EPIPE) { + if (n == -1 && errno == EPIPE) { php_handle_aborted_connection(); } @@ -224,7 +224,8 @@ static void thttpd_request_ctor(TLS_D SLS_DC) size_t filename_len; size_t cwd_len; - SG(request_info).query_string = TG(hc)->query; + + SG(request_info).query_string = TG(hc)->query?strdup(TG(hc)->query):NULL; filename_len = strlen(TG(hc)->expnfilename); cwd_len = strlen(TG(hc)->hs->cwd); @@ -260,6 +261,8 @@ static void thttpd_request_ctor(TLS_D SLS_DC) static void thttpd_request_dtor(TLS_D SLS_DC) { + if (SG(request_info).query_string) + free(SG(request_info).query_string); free(SG(request_info).request_uri); free(SG(request_info).path_translated); } |