]> granicus.if.org Git - apache/commitdiff
* modules/http/byterange_filter.c (ap_byterange_filter): No functional
authorJoe Orton <jorton@apache.org>
Wed, 8 Jun 2005 08:44:37 +0000 (08:44 +0000)
committerJoe Orton <jorton@apache.org>
Wed, 8 Jun 2005 08:44:37 +0000 (08:44 +0000)
changes: reflow/reformat after r188797.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@189559 13f79535-47bb-0310-9956-ffa450edef68

modules/http/byterange_filter.c

index 422a008b855caf0606c54a40df5e2048230b931c..f217ce9b99b2e54b264620186ea4ea7e114de30e 100644 (file)
@@ -149,6 +149,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f,
     apr_off_t clength = 0;
     apr_status_t rv;
     int found = 0;
+    int num_ranges;
 
     /* Iterate through the brigade until reaching EOS or a bucket with
      * unknown length. */
@@ -168,39 +169,37 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_byterange_filter(ap_filter_t *f,
         return ap_pass_brigade(f->next, bb);
     }
 
-    {
-        int num_ranges = ap_set_byterange(r);
-
-        /* We have nothing to do, get out of the way. */
-        if (num_ranges == 0) {
-            ap_remove_output_filter(f);
-            return ap_pass_brigade(f->next, bb);
-        }
-
-        ctx = apr_pcalloc(r->pool, sizeof(*ctx));
-        ctx->num_ranges = num_ranges;
-        /* create a brigade in case we never call ap_save_brigade() */
-        ctx->bb = apr_brigade_create(r->pool, c->bucket_alloc);
-
-        if (ctx->num_ranges > 1) {
-            /* Is ap_make_content_type required here? */
-            const char *orig_ct = ap_make_content_type(r, r->content_type);
-            ctx->boundary = apr_psprintf(r->pool, "%" APR_UINT64_T_HEX_FMT "%lx",
-                                         (apr_uint64_t)r->request_time, (long) getpid());
-
-            ap_set_content_type(r, apr_pstrcat(r->pool, "multipart",
-                                               use_range_x(r) ? "/x-" : "/",
-                                               "byteranges; boundary=",
-                                               ctx->boundary, NULL));
-
-            ctx->bound_head = apr_pstrcat(r->pool,
-                                    CRLF "--", ctx->boundary,
-                                    CRLF "Content-type: ",
-                                    orig_ct,
-                                    CRLF "Content-range: bytes ",
-                                    NULL);
-            ap_xlate_proto_to_ascii(ctx->bound_head, strlen(ctx->bound_head));
-        }
+    num_ranges = ap_set_byterange(r);
+    
+    /* We have nothing to do, get out of the way. */
+    if (num_ranges == 0) {
+        ap_remove_output_filter(f);
+        return ap_pass_brigade(f->next, bb);
+    }
+    
+    ctx = apr_pcalloc(r->pool, sizeof(*ctx));
+    ctx->num_ranges = num_ranges;
+    /* create a brigade in case we never call ap_save_brigade() */
+    ctx->bb = apr_brigade_create(r->pool, c->bucket_alloc);
+    
+    if (ctx->num_ranges > 1) {
+        /* Is ap_make_content_type required here? */
+        const char *orig_ct = ap_make_content_type(r, r->content_type);
+        ctx->boundary = apr_psprintf(r->pool, "%" APR_UINT64_T_HEX_FMT "%lx",
+                                     (apr_uint64_t)r->request_time, (long) getpid());
+        
+        ap_set_content_type(r, apr_pstrcat(r->pool, "multipart",
+                                           use_range_x(r) ? "/x-" : "/",
+                                           "byteranges; boundary=",
+                                           ctx->boundary, NULL));
+        
+        ctx->bound_head = apr_pstrcat(r->pool,
+                                      CRLF "--", ctx->boundary,
+                                      CRLF "Content-type: ",
+                                      orig_ct,
+                                      CRLF "Content-range: bytes ",
+                                      NULL);
+        ap_xlate_proto_to_ascii(ctx->bound_head, strlen(ctx->bound_head));
     }
 
     /* this brigade holds what we will be sending */