cvs: php4 /sapi/cgi cgi_main.c
| From: | Andi Gutmans | Date: | Mon, 30 Apr 2001 22:47:52 +0000 |
| Subject: | cvs: php4 /sapi/cgi cgi_main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-5408@lists.php.net to get a copy of this message | ||
andi Mon Apr 30 15:47:52 2001 EDT
Modified files:
/php4/sapi/cgi cgi_main.c
Log:
- Fix for Bug id #10071
PR:
Submitted by:
Reviewed by:
Obtained from:
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.102 php4/sapi/cgi/cgi_main.c:1.103
--- php4/sapi/cgi/cgi_main.c:1.102 Mon Apr 30 05:43:41 2001
+++ php4/sapi/cgi/cgi_main.c Mon Apr 30 15:47:51 2001
@@ -89,14 +89,21 @@
static int sapi_cgibin_ub_write(const char *str, uint str_length)
{
+ const char *ptr = str;
+ uint remaining = str_length;
size_t ret;
- ret = fwrite(str, 1, str_length, stdout);
- if (ret != str_length) {
- php_handle_aborted_connection();
+ while (remaining > 0)
+ {
+ ret = fwrite(ptr, 1, MIN(remaining, 16384), stdout);
+ if (!ret) {
+ php_handle_aborted_connection();
+ }
+ ptr += ret;
+ remaining -= ret;
}
- return ret;
+ return str_length;
}