Branch: Tag:

2008-03-17

2008-03-17 13:28:53 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added some module counters.

Rev: server/base_server/configuration.pike:1.647

5:   // @appears Configuration   //! A site's main configuration    - constant cvs_version = "$Id: configuration.pike,v 1.646 2008/02/28 19:38:05 jonasw Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.647 2008/03/17 13:28:53 grubba Exp $";   #include <module.h>   #include <module_constants.h>   #include <roxen.h>
327:    void set(string url, string data, mapping meta, int expire, RequestID id)    {    if( strlen( data ) > max_file_size ) { +  // NOTE: There's a possibility of a stale entry remaining in the +  // cache until it expires, rather than being replaced here.    SIMPLE_TRACE_ENTER (this, "Result of size %d is too large "    "to store in the protocol cache (limit %d)",    sizeof (data), max_file_size);
592:   mapping (RoxenModule:string) otomod = ([]);   //! A mapping from the module objects to module names    + mapping(string:int) counters = ([]);      // Caches to speed up the handling of the module search.   // They are all sorted in priority order, and created by the functions
3704:    int has_stored_vars = sizeof (stored_vars); // A little ugly, but it suffices.    me->setvars(stored_vars);    +  if (!module[id]) +  counters[moduleinfo->counter]++; +     module[ id ] = me;    otomod[ me ] = modname+"#"+id;   
4080:    report_debug("Disabling "+descr+"\n");   #endif    +  if (moduleinfo->counter) { +  counters[moduleinfo->counter]--; +  } +     clean_up_for_module( moduleinfo, me );       if( !nodest )