cvs: php4 /sapi/apache2filter sapi_apache2.c
| From: | Sascha Schumann | Date: | Fri, 27 Oct 2000 13:30:41 +0000 |
| Subject: | cvs: php4 /sapi/apache2filter sapi_apache2.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2303@lists.php.net to get a copy of this message | ||
sas Fri Oct 27 06:30:41 2000 EDT
Modified files:
/php4/sapi/apache2filter sapi_apache2.c
Log:
Looks like transient buckets are limited to 4096 bytes, so split up writes.
Index: php4/sapi/apache2filter/sapi_apache2.c
diff -u php4/sapi/apache2filter/sapi_apache2.c:1.8 php4/sapi/apache2filter/sapi_apache2.c:1.9
--- php4/sapi/apache2filter/sapi_apache2.c:1.8 Fri Oct 27 06:19:23 2000
+++ php4/sapi/apache2filter/sapi_apache2.c Fri Oct 27 06:30:41 2000
@@ -29,13 +29,19 @@
ap_bucket *b;
ap_bucket_brigade *bb;
php_struct *ctx;
+ uint now;
SLS_FETCH();
ctx = SG(server_context);
bb = ap_brigade_create(ctx->f->r->pool);
- b = ap_bucket_create_transient(str, str_length);
- AP_BRIGADE_INSERT_TAIL(bb, b);
+ while (str_length > 0) {
+ now = MIN(str_length, 4096);
+ b = ap_bucket_create_transient(str, now);
+ AP_BRIGADE_INSERT_TAIL(bb, b);
+ str += now;
+ str_length -= now;
+ }
ap_pass_brigade(ctx->f->next, bb);
return str_length;
@@ -313,7 +319,8 @@
eos = ap_bucket_create_eos();
AP_BRIGADE_INSERT_TAIL(bb, eos);
ap_pass_brigade(f->next, bb);
- }
+ } else
+ ap_brigade_destroy(bb);
return APR_SUCCESS;
}