diff options
author | Sascha Schumann <sas@php.net> | 2001-10-27 11:27:39 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2001-10-27 11:27:39 +0000 |
commit | a3368ababa55ab8bded1232007998a2c341d1bc4 (patch) | |
tree | ce6f36e8cfce3a8e19186d4193d1589fce511364 /sapi | |
parent | 5ee719bae00cabf037b93a99dbf50485aba40e17 (diff) | |
download | php-git-a3368ababa55ab8bded1232007998a2c341d1bc4.tar.gz |
Improved handling of posts
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/thttpd/thttpd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index 22d413d9cb..e6dcb2df38 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -150,9 +150,11 @@ static int sapi_thttpd_read_post(char *buffer, uint count_bytes TSRMLS_DC) while (read_bytes < count_bytes) { tmp = recv(TG(hc)->conn_fd, buffer + read_bytes, count_bytes - read_bytes, 0); - if (tmp <= 0) + if (tmp == 0 || (tmp == -1 && errno != EAGAIN)) break; - read_bytes += tmp; + /* A simple "tmp > 0" produced broken code on Solaris/GCC */ + if (tmp != 0 && tmp != -1) + read_bytes += tmp; } return read_bytes; @@ -501,6 +503,9 @@ static off_t thttpd_real_php_request(httpd_conn *hc TSRMLS_DC) { TG(hc) = hc; hc->bytes_sent = 0; + + if (hc->method == METHOD_POST) + hc->should_linger = 1; thttpd_request_ctor(TSRMLS_C); |