Branch: Tag:

2001-06-30

2001-06-30 15:44:05 by Martin Stjernholm <mast@lysator.liu.se>

Fixed so that the configuration has the proper name, even before create()
executes.

Rev: server/base_server/configuration.pike:1.444
Rev: server/base_server/module.pike:1.117
Rev: server/base_server/roxen.pike:1.682
Rev: server/base_server/rxml.pike:1.306

3:   //   // A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.443 2001/06/28 20:09:18 mast Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.444 2001/06/30 15:44:04 mast Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>
170:   inherit Configuration;   inherit "basic_defvar";    + // It's nice to have the name when the rest of __INIT executes. + string name = roxen->bootstrap_info->get(); +    // Trivial cache (actually, it's more or less identical to the 200+   // lines of C in HTTPLoop. But it does not have to bother with the   // fact that more than one thread can be active in it at once. Also,
2453:    mixed err;    int module_type;    -  roxen->module_init_info->set (({this_object(), modname})); +  roxen->bootstrap_info->set (({this_object(), modname}));       if( datacache ) datacache->flush();   
2472:    report_warning("Failed to load %s. The module probably "    "doesn't exist in the module path.\n", modname);    got_no_delayed_load = -1; -  roxen->module_init_info->set (0); +  roxen->bootstrap_info->set (0);    return 0;    }    }
2508:    }   #endif    got_no_delayed_load = -1; -  roxen->module_init_info->set (0); +  roxen->bootstrap_info->set (0);    return module[id];    }    }
2539:    "called in random order"),    ({0, 1, 2, 3, 4, 5, 6, 7, 8, 9}));    }) { -  roxen->module_init_info->set (0); +  roxen->bootstrap_info->set (0);    throw(err);    }    }
2674:    if( me->no_delayed_load && got_no_delayed_load >= 0 )    got_no_delayed_load = 1;    -  roxen->module_init_info->set (0); +  roxen->bootstrap_info->set (0);    return me;   }   
3155:      DataCache datacache;    - static void create(string config) + static void create()   { -  name=config; +  if (!name) error ("Configuration name not set through bootstrap_info.\n");   // int st = gethrtime(); -  roxen.add_permission( "Site:"+config, LOC_C(306,"Site")+": "+config ); +  roxen.add_permission( "Site:"+name, LOC_C(306,"Site")+": "+name );       // for now only these two. In the future there might be more variables.    defvar( "data_cache_size", 2048, DLOCALE(274, "Cache:Cache size"),