Return-Path: Delivered-To: apmail-httpd-apreq-cvs-archive@httpd.apache.org Received: (qmail 47382 invoked by uid 500); 10 Jul 2003 23:18:32 -0000 Mailing-List: contact apreq-cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: apreq-dev@httpd.apache.org List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list apreq-cvs@httpd.apache.org Received: (qmail 47301 invoked by uid 500); 10 Jul 2003 23:18:31 -0000 Delivered-To: apmail-httpd-apreq-2-cvs@apache.org Received: (qmail 47277 invoked from network); 10 Jul 2003 23:18:31 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 10 Jul 2003 23:18:31 -0000 Received: (qmail 71319 invoked by uid 1221); 10 Jul 2003 23:18:30 -0000 Date: 10 Jul 2003 23:18:30 -0000 Message-ID: <20030710231830.71318.qmail@icarus.apache.org> From: joes@apache.org To: httpd-apreq-2-cvs@apache.org Subject: cvs commit: httpd-apreq-2/env/t request.t X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N joes 2003/07/10 16:18:30 Modified: env mod_apreq.c env/t request.t Log: Prefetch reads should block until the configured read_ahead amount (64K) is available Revision Changes Path 1.24 +8 -4 httpd-apreq-2/env/mod_apreq.c Index: mod_apreq.c =================================================================== RCS file: /home/cvs/httpd-apreq-2/env/mod_apreq.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- mod_apreq.c 10 Jul 2003 04:35:18 -0000 1.23 +++ mod_apreq.c 10 Jul 2003 23:18:30 -0000 1.24 @@ -378,19 +378,23 @@ } else { /* prefetch read! */ + apr_bucket_brigade *tmp = apr_brigade_create(r->pool, + apr_bucket_alloc_create(r->pool)); apr_bucket *last = APR_BRIGADE_LAST(ctx->spool); - if (!APR_BUCKET_IS_EOS(last)) { - apr_bucket_brigade *tmp = apr_brigade_create(r->pool, - apr_bucket_alloc_create(r->pool)); + apr_size_t total_read = 0; + while (!APR_BUCKET_IS_EOS(last) && total_read < readbytes) { + apr_off_t len; rv = ap_get_brigade(f->next, tmp, mode, block, readbytes); if (rv != APR_SUCCESS) return rv; bb = apreq_copy_brigade(tmp); - + apr_brigade_length(bb,0,&len); + total_read += len; APR_BRIGADE_CONCAT(ctx->spool, tmp); APR_BRIGADE_CONCAT(ctx->bb, bb); + last = APR_BRIGADE_LAST(ctx->spool); } } ctx->status = apreq_parse_request(apreq_request(r, NULL), ctx->bb); 1.3 +1 -2 httpd-apreq-2/env/t/request.t Index: request.t =================================================================== RCS file: /home/cvs/httpd-apreq-2/env/t/request.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- request.t 9 Jul 2003 15:55:00 -0000 1.2 +++ request.t 10 Jul 2003 23:18:30 -0000 1.3 @@ -19,8 +19,7 @@ ok t_cmp(403, GET_RC("/apreq_access_test"), "access denied"); -# XXX 8000 filler chars bombs out- why? -my $filler = "1234567" x 1000; +my $filler = "0123456789" x 7000; # < 8000 + 64K my $body = POST_BODY("/apreq_access_test?foo=1;", content => "bar=2&quux=$filler;test=6"); ok t_cmp(<