Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // 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.941 2006/10/17 20:45:26 jonasw Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.942 2006/10/20 14:30:14 mast Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:5677:    "server-systime": ({"%d", "server_systime()", 0, 0, 0}),       // Used for access logging    "host": ({"\4711" /* unlikely to occur normally */, 0,    1, "\"-\"", LOG_ASYNC_HOST}),    "vhost": ({"%s", "(request_id->misc->host||\"-\")",    1, "\"-\"", 0}),    "ip-number": ({"%s", "(string)request_id->remoteaddr",    1, "\"0.0.0.0\"", 0}),    "bin-ip-number": ({"%s", "host_ip_to_int(request_id->remoteaddr)", -  1, "\"\0\0\0\0\"", 0}), +  1, "\"\\0\\0\\0\\0\"", 0}),    "method": ({"%s", "(string)request_id->method",    1, "\"-\"", 0}),    "full-resource": ({"%s", ("(string)"    "(request_id->raw_url||"    " (request_id->misc->common&&"    " request_id->misc->common->orig_url)||"    " request_id->not_query)"),    "%s" , "url_encode (resource)", 0}),    "cs-uri-stem": ({"%s", ("(string)"    "((request_id->misc->common&&"
Roxen.git/server/base_server/roxen.pike:5711:    "real-full-resource": ({"%s", ("(string)(request_id->raw_url||"    " request_id->not_query)"),    "%s" , "url_encode (resource)", 0}),    "real-cs-uri-stem": ({"%s", ("(string)(request_id->not_query||"    " (request_id->raw_url && "    " (request_id->raw_url/\"?\")[0])||"    " \"-\")"),    "%s" , "url_encode (resource)", 0}),    "protocol": ({"%s", "(string)request_id->prot", 1, "\"-\"", 0}),    "response": ({"%d", "(int)(file->error || 200)", 1, "\"-\"", 0}), -  "bin-response": ({"%2c", "(int)(file->error || 200)", 1, "\"\0\0\"", 0}), +  "bin-response": ({"%2c", "(int)(file->error || 200)", 1, "\"\\0\\0\"", 0}),    "length": ({"%d", "(int)file->len", 1, "\"0\"", 0}), -  "bin-length": ({"%4c", "(int)file->len", 1, "\"\0\0\0\0\"", 0}), +  "bin-length": ({"%4c", "(int)file->len", 1, "\"\\0\\0\\0\\0\"", 0}),    "request-time": ({"%1.4f", ("(float)(gethrtime() - "    " request_id->hrtime) /"    "1000000.0"),    1, "\"-\"", 0}),   #if 0    // This needs to be solved better to work correctly when gethrvtime    // tracks thread local vtime and not.   #if constant (gethrvtime)    // Note: This function exists on a lot more platforms in pike >= 7.6.    "request-vtime": ({"%1.4f", ("(float)(gethrvtime() - "
Roxen.git/server/base_server/roxen.pike:5940:    mapping(string:int) gtime = gmtime (timestamp);";    a_func += c, e_func += c;    }       if (log_flags & LOG_NEED_COOKIES) {    a_func += #"    request_id->init_cookies();";    }       a_func += sprintf(#" -  string data = sprintf( %O %{, %s%} );", a_format, a_args ); +  string data = sprintf( %O%{, +  %s%} );", a_format, a_args );    e_func += sprintf(#" -  string data = sprintf( %O %{, %s%} );", e_format, e_args ); +  string data = sprintf( %O%{, +  %s%} );", e_format, e_args );       if (log_flags & LOG_ASYNC_HOST)    {    a_func += #"    roxen.ip_to_host(request_id->remoteaddr,do_async_write,    data, request_id->remoteaddr, callback );";    } else {    a_func += #"    callback( data );";    }    a_func += #"    }   ";       e_func += #"    callback (data);    }   ";    -  program res = compile_string(#" -  inherit ___LogFormat;" + a_func + e_func); +  string src = #" +  inherit ___LogFormat;" + a_func + e_func; +  program res; +  if (mixed err = catch (res = compile_string (src))) { +  werror ("Failed to compile program: %s\n", src); +  throw (err); +  }    string enc = encode_value(res, master()->MyCodec(res));       con->query("REPLACE INTO compiled_formats (md5,full,enc) VALUES (%s,%s,%s)",    kmd5, fmt, enc);       LogFormat lf = res();    compiled_log_access[fmt] = lf->log_access;    compiled_log_event[fmt] = lf->log_event;    return lf;   }