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 - 2004, Roxen IS.   //      // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.592 2005/09/02 12:25:27 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.593 2005/10/21 21:15:41 grubba 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)      // --- Locale defines ---   //<locale-token project="roxen_start"> LOC_S </locale-token>
Roxen.git/server/base_server/configuration.pike:2616:    RequestID fake_id;    array(int)|Stat res;       if(!objectp(id))    error("No ID passed to 'try_stat_file'\n");       // id->misc->common is here for compatibility; it's better to use    // id->root_id->misc.    if ( !id->misc )    id->misc = ([]); -  if ( !id->misc->common ) -  id->misc->common = ([]); +     -  fake_id = id->clone_me(); +  fake_id = make_fake_id(s, id);    -  fake_id->misc->common = id->misc->common; +     fake_id->misc->internal_get = !not_internal; -  fake_id->conf = this_object(); -  -  if (fake_id->scan_for_query) -  // FIXME: If we're using e.g. ftp this doesn't exist. But the -  // right solution might be that clone_me() in an ftp id object -  // returns a vanilla (i.e. http) id instead when this function is -  // used. -  s = fake_id->scan_for_query (s); -  -  s = Roxen.fix_relative (s, id); -  -  fake_id->raw_url = s; -  fake_id->not_query = s; +     fake_id->method = "GET";       res = stat_file(fake_id->not_query, fake_id);       destruct (fake_id);    return res;   }      static RequestID make_fake_id (string s, RequestID id)   {
Roxen.git/server/base_server/configuration.pike:2665:    fake_id->misc->common = id->misc->common;    fake_id->conf = this_object();       if (fake_id->scan_for_query)    // FIXME: If we're using e.g. ftp this doesn't exist. But the    // right solution might be that clone_me() in an ftp id object    // returns a vanilla (i.e. http) id instead when this function is    // used.    s = fake_id->scan_for_query (s);    +  s = http_decode_string(s); +     s = Roxen.fix_relative (s, id);    -  +  // s is sent to Unix API's that take NUL-terminated strings... +  if (search(s, "\0") != -1) +  sscanf(s, "%s\0", s); +     fake_id->raw_url=s;    fake_id->not_query=s;       return fake_id;   }      int|string try_get_file(string s, RequestID id,    int|void stat_only, int|void nocache,    int|void not_internal,    mapping|void result_mapping)
Roxen.git/server/base_server/configuration.pike:2808:   }      mapping(string:mixed) try_put_file(string path, string data, RequestID id)   {    TIMER_START(try_put_file);       // id->misc->common is here for compatibility; it's better to use    // id->root_id->misc.    if ( !id->misc )    id->misc = ([]); -  if ( !id->misc->common ) -  id->misc->common = ([]); +     -  RequestID fake_id = id->clone_me(); +  RequestID fake_id = make_fake_id(path, id);    -  fake_id->misc->common = id->misc->common; -  fake_id->misc->internal_get = 1; -  fake_id->conf = this_object(); -  +     fake_id->root_id->misc->_request_depth++;    if(sub_req_limit && fake_id->root_id->misc->_request_depth > sub_req_limit)    error("Subrequest limit reached. (Possibly an insertion loop.)");    -  if (fake_id->scan_for_query) -  // FIXME: If we're using e.g. ftp this doesn't exist. But the -  // right solution might be that clone_me() in an ftp id object -  // returns a vanilla (i.e. http) id instead when this function is -  // used. -  path = fake_id->scan_for_query(path); -  -  path = Roxen.fix_relative(path, id); -  -  fake_id->raw_url=path; -  fake_id->not_query=path; +     fake_id->method = "PUT";    fake_id->data = data;    fake_id->misc->len = sizeof(data);    fake_id->misc->internal_get = 1;       mapping(string:mixed) res = low_get_file(fake_id, 1);    TIMER_END(try_put_file);    return res;   }