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.   //   // German translation by Kai Voigt    - constant cvs_version = "$Id: configuration.pike,v 1.324 2000/07/17 16:55:47 lange Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.325 2000/07/21 04:55:01 lange 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=([]);      #ifdef PROFILE   mapping profile_map = ([]);   #endif      #define CATCH(P,X) do{mixed e;if(e=catch{X;})report_error("While "+P+"\n"+describe_backtrace(e));}while(0)    - // Locale support... - //<locale-token project="config_interface">LOCALE</locale-token> - //<locale-token project="config_interface">DLOCALE</locale-token> - #define LOCALE(X,Y) _STR_LOCALE("config_interface",X,Y) + // --- Locale defines --- + //<locale-token project="roxen_start"> LOC_S </locale-token> + //<locale-token project="roxen_config"> LOC_C </locale-token> + //<locale-token project="roxen_message"> LOC_M </locale-token> + //<locale-token project="roxen_config"> DLOCALE </locale-token> + #define LOC_S(X,Y) _STR_LOCALE("roxen_start",X,Y) + #define LOC_C(X,Y) _STR_LOCALE("roxen_config",X,Y) + #define LOC_M(X,Y) _STR_LOCALE("roxen_message",X,Y)   USE_DEFERRED_LOCALE; - #define DLOCALE(X,Y) _DEF_LOCALE("config_interface",X,Y) - #define CALL(X,Y) _LOCALE_FUN("config_interface",X,Y) + #define DLOCALE(X,Y) _DEF_LOCALE("roxen_config",X,Y) + #define CALL(X,Y) _LOCALE_FUN("roxen_config",X,Y)    -  +    #ifdef THROTTLING_DEBUG   #undef THROTTLING_DEBUG   #define THROTTLING_DEBUG(X) werror("Throttling: "+X+"\n")   #else   #define THROTTLING_DEBUG(X)   #endif      #ifdef REQUEST_DEBUG   # define REQUEST_WERR(X) werror("CONFIG: "+X+"\n")   #else
Roxen.git/server/base_server/configuration.pike:518:    ({ (string)m->mday, (string)(m->mon),    (string)(m->year),(string)m->hour,    cached_hostname,    }));    mkdirhier( ff );    fd = open( ff, "wac" );    if(!fd)    {    remove_call_out( do_open );    call_out( do_open, 120 ); -  report_error(LOCALE("j", "Failed to open logfile ")+fname+" " +  report_error(LOC_M("", "Failed to open logfile")+" "+fname+" "   #if constant(strerror)    "(" + strerror(errno()) + ")"   #endif    "\n");    return;    }    opened = 1;    remove_call_out( do_open );    call_out( do_open, 1800 );    }
Roxen.git/server/base_server/configuration.pike:712:    string res="";    float dt = (float)(time(1) - roxen->start_time + 1);       res = "<p><table>";    res += sprintf("<tr align=\"right\"><td><b>%s:</b></td><td>%.2fMB"    "</td><td>%.2f Kbit/%s</td>"    "<td><b>%s:</b></td><td>%.2fMB</td></tr>\n"    "<tr align=\"right\"><td><b>%s:</b></td>"    "<td>%8d</td><td>%.2f/%s</td>"    "<td><b>%s:</b></td><td>%.2fMB</td></tr>\n", -  LOCALE("k","Sent data"),((float)sent/(1024.0*1024.0)), -  (((float)sent)/(1024.0*1024.0)/dt) * 8192.0, LOCALE("m","sec"), -  LOCALE("n","Sent headers"),((float)hsent)/(1024.0*1024.0), -  LOCALE("o","Number of requests"), requests, -  (((float)requests * 60.0)/dt), LOCALE("p","min"), -  LOCALE("q","Received data"),((float)received)/(1024.0*1024.0)); +  LOC_C(2,"Sent data"),((float)sent/(1024.0*1024.0)), +  (((float)sent)/(1024.0*1024.0)/dt) * 8192.0, LOC_C(3,"sec"), +  LOC_C(4,"Sent headers"),((float)hsent)/(1024.0*1024.0), +  LOC_C(5,"Number of requests"), requests, +  (((float)requests * 60.0)/dt), LOC_C(6,"min"), +  LOC_C(7,"Received data"),((float)received)/(1024.0*1024.0));       if (!zero_type(misc->ftp_users)) {    res += sprintf("<tr align=\"right\"><td><b>%s:</b></td><td>%8d</td>"    "<td>%.2f/%s</td>"    "<td><b>%s:</b></td><td>%d</td></tr>\n", -  LOCALE("r","FTP users (total)"), misc->ftp_users, -  (((float)misc->ftp_users*(float)60.0)/dt), LOCALE("p","min"), -  LOCALE("s","FTP users (now)"), misc->ftp_users_now); +  LOC_C(8,"FTP users (total)"), misc->ftp_users, +  (((float)misc->ftp_users*(float)60.0)/dt), LOC_C(6,"min"), +  LOC_C(9,"FTP users (now)"), misc->ftp_users_now);    }    res += "</table></p>\n\n";       if ((extra_statistics->ftp) && (extra_statistics->ftp->commands)) {    // FTP statistics. -  res += "<b>"+LOCALE("t", "FTP statistics") + ":</b><br />\n" +  res += "<b>"+LOC_C(10, "FTP statistics") + ":</b><br />\n"    "<ul><table>\n";    foreach(sort(indices(extra_statistics->ftp->commands)), string cmd) {    res += CALL("ftp_stat_line", "eng")    (upper_case(cmd), extra_statistics->ftp->commands[cmd]);    }    res += "</table></ul>\n";    }       return res;   }      public array(string) userinfo(string u, RequestID|void id)   {    if(auth_module) return auth_module->userinfo(u);    else report_warning(sprintf("userinfo(): %s\n"    "%s\n", -  LOCALE("u", "No authorization module"), +  LOC_M("", "No authorization module"),    describe_backtrace(backtrace())));   }      public array(string) userlist(RequestID|void id)   {    if(auth_module) return auth_module->userlist();    else report_warning(sprintf("userlist(): %s\n"    "%s\n", -  LOCALE("u", "No authorization module"), +  LOC_M("", "No authorization module"),    describe_backtrace(backtrace())));   }      public array(string) user_from_uid(int u, RequestID|void id)   {    if(auth_module)    return auth_module->user_from_uid(u);    else report_warning(sprintf("user_from_uid(): %s\n"    "%s\n", -  LOCALE("u", "No authorization module"), +  LOC_M("", "No authorization module"),    describe_backtrace(backtrace())));   }      public string last_modified_by(Stdio.File file, RequestID id)   {    array(int) s;    int uid;    array u;       if(objectp(file)) s=file->stat();
Roxen.git/server/base_server/configuration.pike:868: Inside #if defined(MODULE_LEVEL_SECURITY)
   if(level[1](id->remoteaddr)) {    ip_ok = ~0; // Match. It's ok.    } else {    ip_ok |= 1; // IP may be bad.    }    break;       case MOD_DENY: // deny ip=...       if(level[1](id->remoteaddr)) -  return Roxen.http_low_answer(403, "<h2>"+LOCALE("v","Access forbidden")+"</h2>"); +  return Roxen.http_low_answer(403, "<h2> Access forbidden </h2>");    break;       case MOD_USER: // allow user=...    if(id->auth && id->auth[0] && level[1](id->auth[1])) {    auth_ok = ~0; // Match. It's ok.    } else {    auth_ok |= 1; // Auth may be bad.    }    break;   
Roxen.git/server/base_server/configuration.pike:921: Inside #if defined(MODULE_LEVEL_SECURITY)
   return Roxen.http_auth_required(seclevels[2]);    }    }    break;    }    }    };       if (err) {    report_error("check_security(): %s:\n%s\n", -  LOCALE("w", "Error during module security check"), +  LOC_M("", "Error during module security check"),    describe_backtrace(err));    return 1;    }       if (ip_ok == 1) {    // Bad IP.    return 1;    } else {    // IP OK, or no IP restrictions.    if (auth_ok == 1) {
Roxen.git/server/base_server/configuration.pike:967:   }      // Empty all the caches above AND the ones in the loaded modules.   void clear_memory_caches()   {    invalidate_cache();    foreach(indices(otomod), RoxenModule m)    if (m && m->clear_memory_caches)    if (mixed err = catch( m->clear_memory_caches() ))    report_error("clear_memory_caches() "+ -  LOCALE("x", "failed for module %O:\n%s\n"), +  LOC_M("", "failed for module %O:\n%s\n"),    otomod[m], describe_backtrace(err));   }      string draw_saturation_bar(int hue,int brightness, int where)   {    Image.Image bar=Image.Image(30,256);       for(int i=0;i<128;i++)    {    int j = i*2;
Roxen.git/server/base_server/configuration.pike:1859:       if( file->data )    {    file->file = StringFile(file->data);    m_delete(file, "data");    }    id->not_query = oq;    return ({ file->file, file });    }    id->not_query = oq; -  return ({ 0, (["error":501, "data":LOCALE("y","Not implemented") ]) }); +  return ({ 0, (["error":501, "data":"Not implemented." ]) });   }         public mapping(string:array(mixed)) find_dir_stat(string file, RequestID id)   {    string loc;    mapping(string:array(mixed)) dir = ([]);    mixed d, tmp;      
Roxen.git/server/base_server/configuration.pike:2241:       if( catch( nm = enable_module( modname, 0, 0, 1 ) ) || (nm == 0) )    enable_module( modname, (nm=old_module), mi, 1 );    else    {    foreach ((array) old_module->error_log, [string msg, array(int) times])    nm->error_log[msg] += times;       catch( mi->update_with( nm,0 ) ); // This is sort of nessesary...    -  nm->report_notice(LOCALE("z", "Reloaded %s.\n"), mi->get_name()); +  nm->report_notice(LOC_C(11, "Reloaded %s.\n"), mi->get_name());    destruct( old_module );    }       call_start_callbacks( nm, mi, modules[ (modname/"#")[0] ] );       return nm;   }      class ModuleCopies   {
Roxen.git/server/base_server/configuration.pike:2336:    if( !me )    {    if(err = catch(me = moduleinfo->instance(this_object())))    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");    if (err != "") {   #endif    string bt=describe_backtrace(err);    report_error("enable_module(): " + -  LOCALE("A", "Error while initiating module copy of %s%s"), +  LOC_M("", "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));   #ifdef MODULE_DEBUG    }   #endif    return module[id];    }    }       if(module[id] && module[id] != me)    {
Roxen.git/server/base_server/configuration.pike:2365:       module_type = moduleinfo->type;    if (module_type & (MODULE_LOCATION|MODULE_EXTENSION|    MODULE_CONFIG|MODULE_FILE_EXTENSION|MODULE_LOGGER|    MODULE_URL|MODULE_LAST|MODULE_PROVIDER|    MODULE_FILTER|MODULE_PARSER|MODULE_FIRST))    {    if(module_type != MODULE_CONFIG)    {    if (err = catch { -  me->defvar("_priority", 5, DLOCALE("bH", "Priority"), TYPE_INT_LIST, -  DLOCALE("bI", "The priority of the module. 9 is highest and 0 is lowest." +  me->defvar("_priority", 5, DLOCALE(12, "Priority"), TYPE_INT_LIST, +  DLOCALE(13, "The priority of the module. 9 is highest and 0 is lowest."    " Modules with the same priority can be assumed to be "    "called in random order"),    ({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}));    }) {    throw(err);    }    }       if(module_type != MODULE_LOGGER && module_type != MODULE_PROVIDER)    { -  if(!(module_type & MODULE_PROXY)) -  { -  me->defvar("_sec_group", "user", DLOCALE("bJ", "Security: Realm"), TYPE_STRING, -  DLOCALE("bK", "The realm to use when requesting password from the " +  me->defvar("_sec_group", "user", DLOCALE(14, "Security: Realm"), +  TYPE_STRING, +  DLOCALE(15, "The realm to use when requesting password from the "    "client. Usually used as an informative message to the "    "user."));    -  me->defvar("_seclvl", 0, DLOCALE("bL", "Security: Security level"), TYPE_INT, -  DLOCALE("bM", "The modules security level is used to determine if a " +  me->defvar("_seclevels", "", DLOCALE(16, "Security: Patterns"), +  TYPE_TEXT_FIELD, +  DLOCALE(17, "This is the 'security level=value' list.<br />" +  "Each security level can be any or more from this list:" +  "<hr noshade=\"noshade\" />" +  "allow ip=<i>IP</i>/<i>bits</i><br />" +  "allow ip=<i>IP</i>:<i>mask</i><br />" +  "allow ip=<i>pattern</i><br />" +  "allow user=<i>username</i>,...<br />" +  "deny ip=<i>IP</i>/<i>bits</i><br />" +  "deny ip=<i>IP</i>:<i>mask</i><br />" +  "deny ip=<i>pattern</i><br />" +  "<hr noshade=\"noshade\" />" +  "In patterns: * matches one or more characters, " +  "and ? matches one character." +  "<p>In username: 'any' stands for any valid account " +  "(from .htaccess" +  " or an auth module. The default (used when _no_ " +  "entries are present) is 'allow ip=*', allowing" +  " everyone to access the module.</p>")); +  +  if(!(module_type & MODULE_PROXY)) +  { +  me->defvar("_seclvl", 0, DLOCALE(18, "Security: Security level"), +  TYPE_INT, +  DLOCALE(19, "The modules security level is used to determine if a "    " request should be handled by the module."    "\n<p><h2>Security level vs Trust level</h2>"    " Each module has a configurable <i>security level</i>."    " Each request has an assigned trust level. Higher"    " <i>trust levels</i> grants access to modules with higher"    " <i>security levels</i>."    "\n<p><h2>Definitions</h2><ul>"    " <li>A requests initial Trust level is infinitely high.</li>"    " <li> A request will only be handled by a module if its"    " <i>trust level</i> is higher or equal to the"
Roxen.git/server/base_server/configuration.pike:2418:    "\n<p>A request handled by \"User filesystem\" is assigned"    " a <i>trust level</i> of one after the <i>security"    " level</i> of that module. That request can then not be"    " handled by the \"CGI module\" since that module has a"    " higher <i>security level</i> than the requests trust"    " level.</p>"    "\n<p>On the other hand, a request handled by the the"    " \"Filsystem module\" could later be handled by the"    " \"CGI module\".</p>"));    -  me->defvar("_seclevels", "", DLOCALE("bN", "Security: Patterns"), TYPE_TEXT_FIELD, -  DLOCALE("bP", "This is the 'security level=value' list.<br />" -  "Each security level can be any or more from this list:" -  "<hr noshade=\"noshade\" />" -  "allow ip=<i>IP</i>/<i>bits</i><br />" -  "allow ip=<i>IP</i>:<i>mask</i><br />" -  "allow ip=<i>pattern</i><br />" -  "allow user=<i>username</i>,...<br />" -  "deny ip=<i>IP</i>/<i>bits</i><br />" -  "deny ip=<i>IP</i>:<i>mask</i><br />" -  "deny ip=<i>pattern</i><br />" -  "<hr noshade=\"noshade\" />" -  "In patterns: * matches one or more characters, " -  "and ? matches one character." -  "<p>In username: 'any' stands for any valid account " -  "(from .htaccess" -  " or an auth module. The default (used when _no_ " -  "entries are present) is 'allow ip=*', allowing" -  " everyone to access the module.</p>")); +     } else {    me->definvisvar("_seclvl", -10, TYPE_INT); /* A very low one */ -  -  me->defvar("_sec_group", "user", DLOCALE("bJ", "Security: Realm"), TYPE_STRING, -  DLOCALE("bK", "The realm to use when requesting password from the " -  "client. Usually used as an informative message to the " -  "user.")); -  -  me->defvar("_seclevels", "", DLOCALE("bN", "Security: Patterns"), -  TYPE_TEXT_FIELD, -  DLOCALE("bQ", "This is the 'security level=value' list.<br />" -  "Each security level can be any or more from " -  "this list:<br />" -  "<hr noshade=\"noshade\" />" -  "allow ip=pattern<br />" -  "allow user=username,...<br />" -  "deny ip=pattern<br />" -  "<hr noshade=\"noshade\" />" -  "In patterns: * is on or more characters, ? is one " -  " character." -  "<p>In username: 'any' stands for any valid account" -  " (from .htaccess" -  " or an auth module. The default is 'deny ip=*'.</p>")); +     }    }    } else {    me->defvar("_priority", 0, "", TYPE_INT, "", 0, 1);    }       mapping(string:mixed) stored_vars = retrieve(modname + "#" + id, this_object());    int has_stored_vars = sizeof (stored_vars); // A little ugly, but it suffices.    me->setvars(stored_vars);   
Roxen.git/server/base_server/configuration.pike:2509:   {    int module_type = moduleinfo->type, pr;    mixed err;    if((me->start) && (err = catch( me->start(0, this_object()) ) ) )    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs)    report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOCALE("A", "Error while initiating module copy of %s%s"), +  report_error(LOC_M("", "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));       /* Clean up some broken references to this module. */   // m_delete(otomod, me);   // m_delete(module->copies, search( module->copies, me ));   // destruct(me);   // return 0;    }    if( inited && me->ready_to_receive_requests )    if( mixed q = catch( me->ready_to_receive_requests( this_object() ) ) )
Roxen.git/server/base_server/configuration.pike:2533:   #endif    report_error( "While calling ready_to_receive_requests:\n"+    describe_backtrace( q ) );    }    if (err = catch(pr = me->query("_priority")))    {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOCALE("A", "Error while initiating module copy of %s%s"), +  report_error(LOC_M("", "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));    pr = 3;    }       api_module_cache |= me->api_functions();       if(module_type & MODULE_EXTENSION)    {    report_error("%s is an MODULE_EXTENSION, that type is no "    "longer available.\nPlease notify the modules writer.\n"
Roxen.git/server/base_server/configuration.pike:2565:    if(pri[pr]->file_extension_modules[foo] )    pri[pr]->file_extension_modules[foo]+=({me});    else    pri[pr]->file_extension_modules[foo]=({me});    }    }) {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOCALE("A", "Error while initiating module copy of %s%s"), +  report_error(LOC_M("", "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));    }       if(module_type & MODULE_PROVIDER)    if (err = catch    {    mixed provs = me->query_provides();    if(stringp(provs))    provs = (< provs >);    if(arrayp(provs))    provs = mkmultiset(provs);    if (multisetp(provs)) {    pri[pr]->provider_modules [ me ] = provs;    }    }) {   #ifdef MODULE_DEBUG    if (enable_module_batch_msgs) report_debug("\bERROR\n");   #endif    string bt=describe_backtrace(err); -  report_error(LOCALE("A", "Error while initiating module copy of %s%s"), +  report_error(LOC_M("", "Error while initiating module copy of %s%s"),    moduleinfo->get_name(), (bt ? ":\n"+bt : "\n"));    }       if(module_type & MODULE_TYPES)    {    types_module = me;    types_fun = me->type_from_extension;    }       if(module_type & MODULE_PARSER)
Roxen.git/server/base_server/configuration.pike:2683:    int id, pr;    sscanf(modname, "%s#%d", modname, id );       ModuleInfo moduleinfo = roxen->find_module( modname );    mapping module = modules[ modname ];    string descr = moduleinfo->get_name() + (id ? " copy " + (id + 1) : "");       if(!module)    {    report_error("disable_module(): " + -  LOCALE("B", "Failed to disable module:\n" +  LOC_M("", "Failed to disable module:\n"    "No module by that name: \"%s\".\n"), modname);    return 0;    }       me = module[id];    m_delete(module->copies, id);       if(!sizeof(module->copies))    m_delete( modules, modname );       invalidate_cache();       if(!me)    {    report_error("disable_module(): " + -  LOCALE("C", "Failed to disable module \"%s\".\n"), +  LOC_M("", "Failed to disable module \"%s\".\n"),    descr);    return 0;    }       if(me->stop)    if (mixed err = catch (me->stop())) {    string bt=describe_backtrace(err);    report_error("disable_module(): " + -  LOCALE("D", "Error while disabling module %s%s"), +  LOC_M("", "Error while disabling module %s%s"),    descr, (bt ? ":\n"+bt : "\n"));    }      #ifdef MODULE_DEBUG    report_debug("Disabling "+descr+"\n");   #endif       if(moduleinfo->type & MODULE_FILE_EXTENSION)    {    string foo;
Roxen.git/server/base_server/configuration.pike:2918:    if(search(modules_to_process, "userdb#0")>-1)    modules_to_process = (({"userdb#0"})+(modules_to_process-({"userdb#0"})));       array err;    forcibly_added = (<>);    enable_module_batch_msgs = 1;    foreach( modules_to_process, tmp_string )    {    if( !forcibly_added[ tmp_string ] )    if(err = catch( enable_module( tmp_string ))) -  report_error(LOCALE("E", "Failed to enable the module %s. Skipping.\n%s"), +  report_error(LOC_M("", "Failed to enable the module %s. Skipping.\n%s"),    tmp_string, describe_backtrace(err));    }    enable_module_batch_msgs = 0;    roxenloader.pop_compile_error_handler();    if( strlen( ec->get() ) )    report_error( "While enabling modules in "+name+":\n"+ec->get() );    if( strlen( ec->get_warnings() ) )    report_warning( "While enabling modules in "+name+":\n"+ec->get_warnings());       foreach( ({this_object()})+indices( otomod ), object mod )
Roxen.git/server/base_server/configuration.pike:2943:    describe_backtrace( q ) );       foreach( after_init_hooks, function q )    if( mixed w = catch( q ) )    report_error( "While calling after_init_hook %O:\n%s",    q, describe_backtrace( w ) );       after_init_hooks = ({});       inited = 1; -  report_notice(LOCALE("F", "All modules for %s enabled in %3.1f seconds\n\n"), -  query_name(),(gethrtime()-start_time)/1000000.0); +  report_notice(LOC_S(4, "All modules for %s enabled in %3.1f seconds") + +  "\n\n", query_name(), (gethrtime()-start_time)/1000000.0);   }      void create(string config)   {    name=config;    -  defvar("default_server", 0, DLOCALE("bR", "Default site"), +  defvar("default_server", 0, DLOCALE(20, "Default site"),    TYPE_FLAG, -  DLOCALE("bS", "If true, this site will be selected in preference of " +  DLOCALE(21, "If true, this site will be selected in preference of "    "other sites when virtual hosting is used and no host "    "header is supplied, or the supplied host header does not "    "match the address of any of the other servers.") );    -  defvar("comment", "", DLOCALE("bT", "Virtual server comment"), +  defvar("comment", "", DLOCALE(22, "Virtual server comment"),    TYPE_TEXT_FIELD|VAR_MORE, -  DLOCALE("bU", "This text will be visible in the administration " +  DLOCALE(23, "This text will be visible in the administration "    "interface, it can be quite useful to use as a memory helper."));    -  defvar("name", "", DLOCALE("bV", "Virtual server name"), +  defvar("name", "", DLOCALE(24, "Virtual server name"),    TYPE_STRING|VAR_MORE, -  DLOCALE("bW", "This is the name that will be used in the configuration " +  DLOCALE(25, "This is the name that will be used in the configuration "    "interface. If this is left empty, the actual name of the "    "virtual server will be used."));       defvar("LogFormat",    "404: $host $referer - [$cern_date] \"$method $resource $protocol\" 404 -\n"    "500: $host $referer ERROR [$cern_date] \"$method $resource $protocol\" 500 -\n"    "*: $host - - [$cern_date] \"$method $resource $protocol\" $response $length", -  DLOCALE("bX", "Logging: Format"), +  DLOCALE(26, "Logging: Format"),    TYPE_TEXT_FIELD|VAR_MORE, -  DLOCALE("bY", "What format to use for logging. The syntax is:\n" +  DLOCALE(27, "What format to use for logging. The syntax is:\n"    "<pre>"    "response-code or *: Log format for that response code\n\n"    "Log format is normal characters, or one or more of the "    "variables below:\n"    "\n"    "\\n \\t \\r -- As in C, newline, tab and linefeed\n"    "$char(int) -- Insert the (1 byte) character specified by the integer.\n"    "$wchar(int) -- Insert the (2 byte) word specified by the integer.\n"    "$int(int) -- Insert the (4 byte) word specified by the integer.\n"    "$^ -- Supress newline at the end of the logentry\n"
Roxen.git/server/base_server/configuration.pike:3009:    "$length -- The length of the data section of the reply\n"    "$bin-length -- Same, but as an 32 bit integer in network byteorder\n"    "$request-time -- The time the request took (seconds)\n"    "$referer -- the header 'referer' from the request, or '-'.\n"    "$user_agent -- the header 'User-Agent' from the request, or '-'.\n\n"    "$user -- the name of the auth user used, if any\n"    "$user_id -- A unique user ID, if cookies are supported,\n"    " by the client, otherwise '0'\n"    "</pre>"), 0, lambda(){ return !query("Log");});    -  defvar("Log", 1, DLOCALE("bZ", "Logging: Enabled"), -  TYPE_FLAG, DLOCALE("b0", "Log requests")); +  defvar("Log", 1, DLOCALE(28, "Logging: Enabled"), +  TYPE_FLAG, DLOCALE(29, "Log requests"));       // FIXME: Mention it is relative to getcwd(). Can not be localized in pike 7.0.    defvar("LogFile", "$LOGDIR/"+Roxen.short_name(name)+"/Log", -  DLOCALE("b1", "Logging: Log file"), TYPE_FILE, -  DLOCALE("b2", "The log file. " +  DLOCALE(30, "Logging: Log file"), TYPE_FILE, +  DLOCALE(31, "The log file. "    ""    "A file name. Some substitutions will be done:"    "<pre>"    "%y Year (e.g. '1997')\n"    "%m Month (e.g. '08')\n"    "%d Date (e.g. '10' for the tenth)\n"    "%h Hour (e.g. '00')\n"    "%H Hostname\n"    "</pre>")    ,0, lambda(){ return !query("Log");});       defvar("NoLog", ({ }), -  DLOCALE("b3", "Logging: No Logging for"), TYPE_STRING_LIST|VAR_MORE, -  DLOCALE("b4", "Don't log requests from hosts with an IP number which " +  DLOCALE(32, "Logging: No Logging for"), TYPE_STRING_LIST|VAR_MORE, +  DLOCALE(33, "Don't log requests from hosts with an IP number which "    "matches any of the patterns in this list. This also affects "    "the access counter log."),    0, lambda(){ return !query("Log");});    -  defvar("Domain", roxen->get_domain(), DLOCALE("b5", "Domain"), TYPE_STRING, -  DLOCALE("b6", "The domainname of the server. The domainname is used " +  defvar("Domain", roxen->get_domain(), DLOCALE(34, "Domain"), TYPE_STRING, +  DLOCALE(35, "The domainname of the server. The domainname is used "    "to generate default URLs, and to generate email addresses."));       defvar("MyWorldLocation", "http://"+gethostname()+"/", -  DLOCALE("b7", "Primary Server URL"), TYPE_URL, -  DLOCALE("b8", "This is the main server URL, where your start page is " +  DLOCALE(36, "Primary Server URL"), TYPE_URL, +  DLOCALE(37, "This is the main server URL, where your start page is "    "located. Please note that you also have to configure the "    "'URLs' variable."));       defvar("URLs",    Variable.PortList( ({"http://*/"}), VAR_INITIAL, -  DLOCALE("b9", "URLs"), -  DLOCALE("ca", "Bind to these URLs. You can use '*' and '?' to perform" +  DLOCALE(38, "URLs"), +  DLOCALE(39, "Bind to these URLs. You can use '*' and '?' to perform"    " globbing (using any of these will default to binding to "    "all IP-numbers on your machine). The possible protocols "    "are http, fhttp (a faster version of the normal HTTP "    "protocol, but not 100% compatible with all modules) "    "https, ftp, ftps, gopher and tetris.")));       defvar("InternalLoc", "/_internal/", -  DLOCALE("cb", "Internal module resource mountpoint"), +  DLOCALE(40, "Internal module resource mountpoint"),    TYPE_LOCATION|VAR_MORE|VAR_DEVELOPER, -  DLOCALE("cc", "Some modules may want to create links to internal " +  DLOCALE(41, "Some modules may want to create links to internal "    "resources. This setting configures an internally handled "    "location that can be used for such purposes. Simply select "    "a location that you are not likely to use for regular "    "resources."));          // Throttling-related variables       defvar("throttle", 0, -  DLOCALE("cd", "Bandwidth Throttling: Server: Enabled"),TYPE_FLAG, -  DLOCALE("ce", "If set, per-server bandwidth throttling will be enabled. " +  DLOCALE(42, "Bandwidth Throttling: Server: Enabled"),TYPE_FLAG, +  DLOCALE(43, "If set, per-server bandwidth throttling will be enabled. "    "It will allow you to limit the total available bandwidth for "    "this Virtual Server.<br />Bandwidth is assigned using a Token Bucket. "    "The principle under which it works is: for each byte we send we use a token. "    "Tokens are added to a repository at a constant rate. When there's not enough, "    "we can't transmit. When there's too many, they \"spill\" and are lost."));    //TODO: move this explanation somewhere on the website and just put a link.       defvar("throttle_fill_rate", 102400, -  DLOCALE("cf", "Bandwidth Throttling: Server: Average available bandwidth"), +  DLOCALE(44, "Bandwidth Throttling: Server: Average available bandwidth"),    TYPE_INT, -  DLOCALE("cg", "This is the average bandwidth available to this Virtual Server in " +  DLOCALE(45, "This is the average bandwidth available to this Virtual Server in "    "bytes/sec (the bucket \"fill rate\")."),    0, arent_we_throttling_server);       defvar("throttle_bucket_depth", 1024000, -  DLOCALE("ch", "Bandwidth Throttling: Server: Bucket Depth"), TYPE_INT, -  DLOCALE("ci", "This is the maximum depth of the bucket. After a long enough period " +  DLOCALE(46, "Bandwidth Throttling: Server: Bucket Depth"), TYPE_INT, +  DLOCALE(47, "This is the maximum depth of the bucket. After a long enough period "    "of inactivity, a request will get this many unthrottled bytes of data, before "    "throttling kicks back in.<br>Set equal to the Fill Rate in order not to allow "    "any data bursts. This value determines the length of the time over which the "    "bandwidth is averaged."), 0, arent_we_throttling_server);       defvar("throttle_min_grant", 1300, -  DLOCALE("cj", "Bandwidth Throttling: Server: Minimum Grant"), TYPE_INT, -  DLOCALE("ck", "When the bandwidth availability is below this value, connections will " +  DLOCALE(48, "Bandwidth Throttling: Server: Minimum Grant"), TYPE_INT, +  DLOCALE(49, "When the bandwidth availability is below this value, connections will "    "be delayed rather than granted minimal amounts of bandwidth. The purpose "    "is to avoid sending too small packets (which would increase the IP overhead)."),    0, arent_we_throttling_server);       defvar("throttle_max_grant", 14900, -  DLOCALE("cm", "Bandwidth Throttling: Server: Maximum Grant"), TYPE_INT, -  DLOCALE("cn", "This is the maximum number of bytes assigned in a single request " +  DLOCALE(50, "Bandwidth Throttling: Server: Maximum Grant"), TYPE_INT, +  DLOCALE(51, "This is the maximum number of bytes assigned in a single request "    "to a connection. Keeping this number low will share bandwidth more evenly "    "among the pending connections, but keeping it too low will increase IP "    "overhead and (marginally) CPU usage. You'll want to set it just a tiny "    "bit lower than any integer multiple of your network's MTU (typically 1500 "    "for ethernet)."), 0, arent_we_throttling_server);       defvar("req_throttle", 0, -  DLOCALE("co", "Bandwidth Throttling: Request: Enabled"), TYPE_FLAG, -  DLOCALE("cp", "If set, per-request bandwidth throttling will be enabled.") +  DLOCALE(52, "Bandwidth Throttling: Request: Enabled"), TYPE_FLAG, +  DLOCALE(53, "If set, per-request bandwidth throttling will be enabled.")    );       defvar("req_throttle_min", 1024, -  DLOCALE("cq", "Bandwidth Throttling: Request: Minimum guarranteed bandwidth"), +  DLOCALE(54, "Bandwidth Throttling: Request: Minimum guarranteed bandwidth"),    TYPE_INT, -  DLOCALE("cr", "The maximum bandwidth each connection (in bytes/sec) can use is determined " +  DLOCALE(55, "The maximum bandwidth each connection (in bytes/sec) can use is determined "    "combining a number of modules. But doing so can lead to too small "    "or even negative bandwidths for particularly unlucky requests. This variable "    "guarantees a minimum bandwidth for each request."),    0, arent_we_throttling_request);       defvar("req_throttle_depth_mult", 60.0, -  DLOCALE("cs", "Bandwidth Throttling: Request: Bucket Depth Multiplier"), +  DLOCALE(56, "Bandwidth Throttling: Request: Bucket Depth Multiplier"),    TYPE_FLOAT, -  DLOCALE("ct", "The average bandwidth available for each request will be determined by " +  DLOCALE(57, "The average bandwidth available for each request will be determined by "    "the modules combination. The bucket depth will be determined multiplying "    "the rate by this factor."),    0, arent_we_throttling_request);       defvar("ZNoSuchFile", #"   <html><head>   <title>404 - Page not found</title>   </head>      <body alink=\"#000000\" bgcolor=\"#ffffff\" bottommargin=\"0\" leftmargin=\"0\" link=\"#ce5c00\" marginheight=\"2\" marginwidth=\"0\" rightmargin=\"0\" text=\"#333333\" topmargin=\"2\" vlink=\"#ce5c00\">
Roxen.git/server/base_server/configuration.pike:3166:   <a href=\"&client.referrer;\">referring</a>   </if><else>   referring   </else>   page.      </blockquote>   </font>   </body>   ", -  DLOCALE("cu", "Messages: No such file"),TYPE_TEXT_FIELD, -  DLOCALE("cv", "What to return when there is no resource or file " +  DLOCALE(58, "Messages: No such file"),TYPE_TEXT_FIELD, +  DLOCALE(59, "What to return when there is no resource or file "    "available at a certain location."));       definvisvar( "no_delayed_load", 0, TYPE_FLAG );       setvars( retrieve("spider#0", this_object()) );       if (query("throttle"))    {    throttler=.throttler();    throttler->throttle(query("throttle_fill_rate"),