cvs: php4 /sapi/thttpd thttpd.c
| From: | Sascha Schumann | Date: | Sat, 27 Oct 2001 11:27:39 +0000 |
| Subject: | cvs: php4 /sapi/thttpd thttpd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7996@lists.php.net to get a copy of this message | ||
sas Sat Oct 27 07:27:39 2001 EDT
Modified files:
/php4/sapi/thttpd thttpd.c
Log:
Improved handling of posts
Index: php4/sapi/thttpd/thttpd.c
diff -u php4/sapi/thttpd/thttpd.c:1.59 php4/sapi/thttpd/thttpd.c:1.60
--- php4/sapi/thttpd/thttpd.c:1.59 Tue Oct 9 11:15:55 2001
+++ php4/sapi/thttpd/thttpd.c Sat Oct 27 07:27:39 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: thttpd.c,v 1.59 2001/10/09 15:15:55 sas Exp $ */
+/* $Id: thttpd.c,v 1.60 2001/10/27 11:27:39 sas Exp $ */
#include "php.h"
#include "SAPI.h"
@@ -150,9 +150,11 @@
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 @@
{
TG(hc) = hc;
hc->bytes_sent = 0;
+
+ if (hc->method == METHOD_POST)
+ hc->should_linger = 1;
thttpd_request_ctor(TSRMLS_C);