Branch: Tag:

2000-08-19

2000-08-19 01:39:37 by Per Hedbor <ph@opera.com>

Store the function pointer instead of the object in the log format cache

Rev: server/base_server/roxen.pike:1.527

4:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.526 2000/08/19 01:27:31 per Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.527 2000/08/19 01:39:37 per Exp $";      // Used when running threaded to find out which thread is the backend thread,   // for debug purposes only.
3682:    }   }    - static mapping(string:LogFormat) compiled_formats = ([ ]); + static mapping(string:function) compiled_formats = ([ ]);      constant formats =   ({
3708:    ({ "host", "\4711", 0, 1 }), // unlikely to occur normally   });    - LogFormat compile_format( string fmt ) + void run_log_format( string fmt, function c, RequestID id, mapping file )   { -  +  (compiled_formats[ fmt ] || compile_log_format( fmt ))(c,id,file); + } +  + function compile_log_format( string fmt ) + {    if( compiled_formats[ fmt ] )    return compiled_formats[ fmt ];   
3777:    callback( data );    }   "; -  return compiled_formats[ fmt ] = compile_string( code )(); +  return compiled_formats[ fmt ] = compile_string( code )()->log;   }