]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Allow for actual counting...
authorJim Jagielski <jim@apache.org>
Mon, 29 Aug 2011 15:53:52 +0000 (15:53 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 29 Aug 2011 15:53:52 +0000 (15:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1162881 13f79535-47bb-0310-9956-ffa450edef68

modules/http/byterange_filter.c

index a54223a7a2a2f307f75589ac3edee47454a9b892..cb63149fc43495029255620c9ec665337e9f68f6 100644 (file)
@@ -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;