httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <...@light.plus.com>
Subject Re: general/6711: byterange problems in 1.3.14
Date Wed, 01 Nov 2000 08:13:39 GMT
On Wed, Nov 01, 2000 at 12:17:06AM +0000, Tony Finch wrote:
... 
> There's another bit of Joe's patch that I don't understand -- it seems
> to break calculation of the content-length. Fixing this doesn't seem
> to fix the problem, however.

The content-length calculated in ap_set_byternage is the *total*
content-length of the multipart response, if that's what you're talking
about... this should only be used in the success case, where the 206 is
being returned.

> Index: http_protocol.c
> ===================================================================
> RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v
> retrieving revision 1.291
> diff -u -r1.291 http_protocol.c
> --- http_protocol.c	2000/10/10 03:29:08	1.291
> +++ http_protocol.c	2000/11/01 00:15:02
> @@ -237,6 +269,7 @@
>          long tlength = 0;
>  	int ret;
>  	
> +        r->byterange = 2;
>          r->boundary = ap_psprintf(r->pool, "%lx%lx",
>  				r->request_time, (long) getpid());
>          do {
> @@ -245,11 +278,12 @@
>  	} while (ret == 1);
>  	/* If an error occured processing one of the range specs, we
>  	 * must fail */
> -	if (ret < 0)
> +	if (ret < 0) {
> +	    r->byterange = 0;
>  	    return 0;
> +	}
>          ap_table_setn(r->headers_out, "Content-Length",
>  	    ap_psprintf(r->pool, "%ld", tlength));
> -        r->byterange = 2;
>      }
>  
>      r->status = PARTIAL_CONTENT;

I'm not sure I see the point of that: currently, in the failure case,
r->byterange comes out as 0, since it's never set before the error
return. That just sets it to 2 and then sets it back to 0 again.

joe

Mime
View raw message