You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2005/06/08 10:44:38 UTC

svn commit: r189559 - /httpd/httpd/trunk/modules/http/byterange_filter.c

Author: jorton
Date: Wed Jun  8 01:44:37 2005
New Revision: 189559

URL: http://svn.apache.org/viewcvs?rev=189559&view=rev
Log:
* modules/http/byterange_filter.c (ap_byterange_filter): No functional
changes: reflow/reformat after r188797.

Modified:
    httpd/httpd/trunk/modules/http/byterange_filter.c

Modified: httpd/httpd/trunk/modules/http/byterange_filter.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/http/byterange_filter.c?rev=189559&r1=189558&r2=189559&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/byterange_filter.c (original)
+++ httpd/httpd/trunk/modules/http/byterange_filter.c Wed Jun  8 01:44:37 2005
@@ -149,6 +149,7 @@
     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 @@
         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 */