httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: httpd-2.0/modules/http http_protocol.c
Date Fri, 26 Jan 2001 02:09:28 GMT
Apache 1.3 did this by simply never changing r->content_type. It just poked
a new value into headers_out instead. Could we do the same thing?

Cheers,
-g

On Thu, Jan 25, 2001 at 11:50:36PM -0000, rbb@apache.org wrote:
> rbb         01/01/25 15:50:35
> 
>   Modified:    modules/http http_protocol.c
>   Log:
>   Store the original content_type before we replace it with the byterange
>   C-T.  This allows us to report a correct content type in the boundary
>   header.
>   
>   Revision  Changes    Path
>   1.278     +3 -1      httpd-2.0/modules/http/http_protocol.c
>   
>   Index: http_protocol.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
>   retrieving revision 1.277
>   retrieving revision 1.278
>   diff -u -d -b -w -u -r1.277 -r1.278
>   --- http_protocol.c	2001/01/24 23:47:42	1.277
>   +++ http_protocol.c	2001/01/25 23:50:33	1.278
>   @@ -193,6 +193,7 @@
>    typedef struct byterange_ctx {
>        apr_bucket_brigade *bb;
>        int num_ranges;
>   +    const char *orig_ct;
>    } byterange_ctx;
>    
>    /*
>   @@ -245,6 +246,7 @@
>            ctx->num_ranges = num_ranges;
>    
>            if (num_ranges > 1) {
>   +            ctx->orig_ct = r->content_type;
>                r->content_type = 
>                     apr_pstrcat(r->pool, "multipart", use_range_x(r) ? "/x-" : "/",
>                              "byteranges; boundary=", r->boundary, NULL);
>   @@ -267,7 +269,7 @@
>        bound_head = apr_pstrcat(r->pool,
>                                 CRLF "--", r->boundary,
>                                 CRLF "Content-type: ",
>   -                             make_content_type(r, r->content_type),
>   +                             make_content_type(r, ctx->orig_ct),
>                                 CRLF "Content-range: bytes ", 
>                                 NULL);
>        ap_xlate_proto_to_ascii(bound_head, strlen(bound_head));
>   
>   
>   

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message