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.337 2000/08/14 22:50:53 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.338 2000/08/15 12:45:38 jhs Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>   #include <roxen.h>   #include <request_trace.h>      inherit "basic_defvar";      mapping enabled_modules = ([]);   mapping(string:array(int)) error_log=([]);
Roxen.git/server/base_server/configuration.pike:434:    }    }    }    }       return first_module_cache;   }         array location_modules(RequestID id) + //! Return an array of all location modules the request would be + //! mapped through, by order of priority.   {    if(!location_module_cache)    {    int i;    array new_location_module_cache=({ });    for(i=9; i>=0; i--)    {    array(RoxenModule) d;    RoxenModule p;    if(d=pri[i]->location_modules) {
Roxen.git/server/base_server/configuration.pike:1134:    if (stringp(m->extra_heads["http-content-type"]) ||    stringp(m->type)) {    res += sprintf(" of %s", m->type);    }       res+="<br />";       return res;   }    - // The function that actually tries to find the data requested. All - // modules are mapped, in order, and the first one that returns a - // suitable responce is used. - mapping|int low_get_file(RequestID id, int|void no_magic) + mapping|int(-1..0) low_get_file(RequestID id, int|void no_magic) + //! The function that actually tries to find the data requested. All + //! modules except last and filter type modules are mapped, in order, + //! and the first one that returns a suitable response is used. If + //! `no_magic' is set to one, the internal magic roxen images and the + //! <ref>find_internal()</ref> callbacks will be ignored. + //! + //! The return values 0 (no such file) and -1 (the data is a + //! directory) are only returned when `no_magic' was set to 1; + //! otherwise a result mapping is always generated.   {   #ifdef MODULE_LEVEL_SECURITY    int slevel;   #endif      #ifdef THREADS    object key;   #endif    TRACE_ENTER(sprintf("Request for %s", id->not_query), 0);       string file=id->not_query;    string loc;    function funp;    mixed tmp, tmp2; -  mapping|object fid; +  mapping|object(Stdio.File)|int fid;       if(!no_magic)    {   #ifndef NO_INTERNAL_HACK    // Find internal-foo-bar images    // min length == 17 (/internal-roxen-?..)    // This will save some time indeed.    string type;    if(sizeof(file) > 17 &&   #ifdef OLD_RXML_COMPAT    (file[0] == '/') && -  sscanf(file, "%*s/internal-%s-%[^/]", type, loc) == 3) +  sscanf(file, "%*s/internal-%s-%[^/]", type, loc) == 3   #else -  sscanf(file, "/internal-%s-%[^/]", type, loc) == 2) +  sscanf(file, "/internal-%s-%[^/]", type, loc) == 2   #endif -  { +  ) {    switch(type) {    case "roxen":    TRACE_LEAVE("Magic internal gopher image");    return internal_roxen_image(loc);       case "gopher":    TRACE_LEAVE("Magic internal roxen image");    return internal_gopher_image(loc);    }    }
Roxen.git/server/base_server/configuration.pike:1432:    tmp=funp(fid, loc, id);    UNLOCK();    if(tmp)    {    if(!objectp(tmp))    {    TRACE_LEAVE("");    TRACE_LEAVE("Returning data");    return tmp;    } -  if(fid) +  if(fid && tmp != fid)    destruct(fid);    TRACE_LEAVE("Returned new open file");    fid = tmp;    break;    } else    TRACE_LEAVE("");    }    }       if(objectp(fid))
Roxen.git/server/base_server/configuration.pike:1496:    REQUEST_WERR("handle_request(): Recurse");    return handle_request(id);    }    file = ret;    }    REQUEST_WERR("handle_request(): Done");    return file;   }      mapping get_file(RequestID id, int|void no_magic, int|void internal_get) + //! Return a result mapping for the id object at hand, mapping all + //! modules, including the filter modules. This function is mostly a + //! wrapper for <ref>low_get_file()</ref>.   {    int orig_internal_get = id->misc->internal_get;    id->misc->internal_get = internal_get;       mapping|int res;    mapping res2;    function tmp;    res = low_get_file(id, no_magic);       // finally map all filter type modules.
Roxen.git/server/base_server/configuration.pike:1971:    (loc[0]==loc[-1]) && loc[-1]=='/' &&    (function_object(tmp[1])->stat_file(".", id))) {    /* loc == file + "/" + subpath + "/"    * and stat_file(".") returns non-zero.    */    TRACE_ENTER(sprintf("The file %O is on the path to the mountpoint %O.",    file, loc), 0);    loc=loc[strlen(file)..];    sscanf(loc, "%s/", loc);    if (!dir[loc]) { -  dir[loc] = ({ 0775, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0 }); +  dir[loc] = ({ 0775, -3, 0, 0, 0, 0, 0 });    }    TRACE_LEAVE("");    }    TRACE_LEAVE("");    }    if(sizeof(dir))    return dir;   }