Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.709 2010/12/02 13:38:57 grubba Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.710 2010/12/02 16:11:02 mast Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>   #include <timers.h>      #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)      // Tell Pike.count_memory this is global.   constant pike_cycle_depth = 0;
Roxen.git/server/base_server/configuration.pike:3158:       if( objectp(m->file) )    {    res += m->file->read();    if (m->file) {    // Some wrappers may destruct themselves in read()...    destruct(m->file);    }    }    -  if(m->raw) +  if(m->raw) { +  if (compat_level() > 5.0)    res = Roxen.parse_http_response (res, result_mapping, 0, "from " + s); -  +  else { +  // This function used to simply toss the headers and return the +  // data as-is, losing the content type and charset. Need to be +  // bug compatible with the lack of charset handling, since +  // callers might be compensating. (The old code also deleted all +  // CR's in the whole body, regardless of content type(!), but we +  // don't have to be bug compatible with that at least.) +  sscanf (res, "%*s\r\n\r\n%s", res) || +  sscanf (res, "%*s\n\n%s", res) || +  sscanf (res, "%*s\r\n%s", res) || +  sscanf (res, "%*s\n%s", res); +  } +  } +     return res;   }      mapping(string:string) try_get_headers(string s, RequestID id,    int|void not_internal)   //! Like @[try_get_file] but performs a HEAD request and only returns   //! the response headers. Note that the returned headers are as they   //! would be in a formatted response by the http protocol module,   //! which is completely different from a response mapping.   {