Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS. - constant cvs_version = "$Id: configuration.pike,v 1.402 2000/12/11 00:03:27 nilsson Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.403 2000/12/11 03:07:46 per Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>         #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)      // --- Locale defines ---   //<locale-token project="roxen_start"> LOC_S </locale-token>
Roxen.git/server/base_server/configuration.pike:1576:    TRACE_LEAVE("");    TRACE_LEAVE("Stat ok.");    return s;    }    TRACE_LEAVE("");    }    }    TRACE_LEAVE("Returned 'no such file'.");   }    + mapping error_file( RequestID id ) + { +  string data = query("ZNoSuchFile"); +  NOCACHE(); + #ifdef OLD_RXML_COMPAT +  data = replace(data,({"$File", "$Me"}), +  ({"&page.virtfile;",query("MyWorldLocation")})); + #endif +  id->misc->defines = ([ " _error":404 ]); +  return Roxen.http_rxml_answer( data, id, 0, "text/html" ); + } +    // this is not as trivial as it sounds. Consider gtext. :-)   array open_file(string fname, string mode, RequestID id, void|int internal_get)   {    if( id->conf && (id->conf != this_object()) )    return id->conf->open_file( fname, mode, id, internal_get );       object oc = id->conf;    string oq = id->not_query;    function funp;    mapping|int(0..1) file;
Roxen.git/server/base_server/configuration.pike:1631:    }    }    }       if(!mappingp(file))    {    if(id->misc->error_code)    file = Roxen.http_low_answer(id->misc->error_code, "Failed" );    else if(id->method!="GET"&&id->method != "HEAD"&&id->method!="POST")    file = Roxen.http_low_answer(501, "Not implemented."); -  else { -  file = Roxen.http_low_answer(404, -  parse_rxml( - #ifdef OLD_RXML_COMPAT -  replace(query("ZNoSuchFile"), -  ({ "$File", "$Me" }), -  ({ "&page.virtfile;", -  "&roxen.server;" -  })), - #else -  query("ZNoSuchFile"), - #endif -  id)); -  } +  else +  file = error_file( id );       id->not_query = oq;       return ({ 0, file });    }       if( file->data )    {    file->file = StringFile(file->data);    m_delete(file, "data");