From: Jim Jagielski Date: Mon, 29 Aug 2011 15:53:52 +0000 (+0000) Subject: Allow for actual counting... X-Git-Tag: 2.2.20~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66ebe8919e708842932d92df977a9f5d6e271bad;p=thirdparty%2Fapache%2Fhttpd.git Allow for actual counting... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1162881 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/byterange_filter.c b/modules/http/byterange_filter.c index a54223a7a2a..cb63149fc43 100644 --- a/modules/http/byterange_filter.c +++ b/modules/http/byterange_filter.c @@ -137,6 +137,7 @@ static apr_status_t copy_brigade_range(apr_bucket_brigade *bb, if (off_first != start64) { rv = apr_bucket_split(copy, (apr_size_t)(start64 - off_first)); if (rv == APR_ENOTIMPL) { + int i; rv = apr_bucket_read(copy, &s, &len, APR_BLOCK_READ); if (rv != APR_SUCCESS) { apr_brigade_cleanup(bbout); @@ -147,9 +148,10 @@ static apr_status_t copy_brigade_range(apr_bucket_brigade *bb, * of shorter length. So read and delete until we reached * the correct bucket for splitting. */ + i = 0; while (start64 - off_first > (apr_uint64_t)copy->length) { apr_bucket *tmp; - int i = 0; + /* don't allow inf. spin */ if (i++ >= 99999) return APR_EINVAL;