Branch: Tag:

2004-04-20

2004-04-20 21:01:03 by Martin Stjernholm <mast@lysator.liu.se>

Moved some more response mapping handling from the protocol module to
RequestID.make_response_headers.

Rev: server/protocols/http.pike:1.432

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2001, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.431 2004/04/20 12:36:02 grubba Exp $"; + constant cvs_version = "$Id: http.pike,v 1.432 2004/04/20 21:01:03 mast Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
1574:       if(!file->raw && (prot != "HTTP/0.9"))    { -  if (!file->stat) file->stat = misc->stat; -  if(objectp(file->file)) { -  if(!file->stat) -  file->stat = file->file->stat(); -  if (zero_type(misc->cacheable) && file->file->is_file) { -  // Assume a cacheablity on the order of the age of the file. -  misc->cacheable = (predef::time(1) - file->stat[ST_MTIME])/4; -  } -  } -  -  if( Stat fstat = file->stat ) -  { -  if( !file->len ) -  file->len = fstat[1]; -  -  if ( fstat[ST_MTIME] > misc->last_modified ) -  misc->last_modified = fstat[ST_MTIME]; -  } -  -  switch (file->error) { -  case Protocols.HTTP.HTTP_NO_CONTENT: +  if (file->error == Protocols.HTTP.HTTP_NO_CONTENT) {    // We actually give some content cf comment below.    file->len = 2;    file->data = "\r\n"; -  break; -  -  case 0: -  file->error = Protocols.HTTP.HTTP_OK; -  break; +     }       string head_status = file->rettext;