Branch: Tag:

2001-02-05

2001-02-05 11:53:06 by Per Hedbor <ph@opera.com>

Use the FakedVariables class

Rev: server/base_server/roxen.pike:1.627
Rev: server/protocols/http.pike:1.302
Rev: server/protocols/prot_hilfe.pike:2.4

2:   // Modified by Francesco Chemolli to add throttling capabilities.   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: http.pike,v 1.301 2001/02/01 12:21:15 grubba Exp $"; + constant cvs_version = "$Id: http.pike,v 1.302 2001/02/05 11:52:58 per Exp $";   // #define REQUEST_DEBUG   #define MAGIC_ERROR   
85:   int do_not_disconnect;      mapping(string:mixed) real_variables = ([]); - mapping(string:string) variables = ([]); + FakedVariables variables = FakedVariables( real_variables );      mapping (string:mixed) misc =   ([
293:    if( misc->request_charset_decoded )    return;    +  misc->request_charset_decoded = 1; +     if( !decoder )    return;    -  misc->request_charset_decoded = 1; -  +     string safe_decoder(string s) {    catch { return decoder(s); };    return s;
700:       if( mixed q = real_variables->magic_roxen_automatic_charset_variable )    decode_charset_encoding(Roxen.get_client_charset_decoder(q[0],this_object())); -  -  make_variables_from_real_variables(); +    }    - static void make_variables_from_real_variables( ) - { -  foreach( indices( real_variables ), string q ) -  variables[ q ] = real_variables[ q ]*"\0"; - } -  +    static Roxen.HeaderParser hp = Roxen.HeaderParser();   static function(string:array(string|mapping)) hpf = hp->feed;   int last;
2093:    c->conf = conf;    c->time = time;    c->raw_url = raw_url; -  c->variables = copy_value(variables); -  c->real_variables = copy_value(real_variables); +  +  c->real_variables = copy_value( real_variables ); +  c->variables = FakedVariables( c->real_variables );    c->misc = copy_value( misc );    c->misc->orig = t;