httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Life is hard, and then you die." <ron...@innovation.ch>
Subject Re: 'Range: bytes=' request with starting byte greater than size of f ile
Date Fri, 10 Sep 1999 05:20:47 GMT

One day, Dean Gaudet wrote:
> 
> 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.

Sure, sounds reasonable. I'm reworking the patch anyway because after
a detailed check with 2616 I realized that we have to ignore the
complete range header if an invalid range is detected - currently
just the invalid range is discarded (so if multiple ranges are
requested, and at least one of them is valid, then a 206 is returned).


  Cheers,

  Ronald


Mime
View raw message