httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: 'Range: bytes=' request with starting byte greater than size of f ile
Date Tue, 07 Sep 1999 22:36:21 GMT


On Fri, 27 Aug 1999, Life is hard, and then you die. wrote:

> I've created a patch for this, but it changes the semantics of
> ap_set_byterange a bit: it now returns 0, 1, or 2 (for invalid, ok, and
> unsatisfiable) instead of just 0 or 1. Is anybody like mod_perl or mod_php
> using this function? (http_core and mod_mmap_static included in the patch
> below) If not, I'll commit it.

...

On Thu, 26 Aug 1999, Ritcey, Benjamin wrote:

> Dean Gaudet> want to submit a patch for it? :) 
> 
> Be careful of what you wish for... =)
> 
> Is it evil to use r->status as a flag; e.g.,
> 
> rangestatus = ap_set_byterange(r);
> 
> if (rangestatus == HTTP_RANGE_NOT_SATISFIABLE){
>   ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,
> 	    "First byte of range request beyond end of requested file in
> request %s (Range: %s, length: %u)", 
> 		r->the_request, ap_table_get(r->headers_in,
> "Range"),r->finfo.st_size);
>   return HTTP_RANGE_NOT_SATISFIABLE;  
> }


I kind of like the idea of returning an HTTP status code from
ap_set_byterange... so that you don't have to remember 0, 1, 2 magic
constants.

otherwise I say go for it Ronald, thanks. 

Dean


Mime
View raw message