Roxen.git / server / modules / proxies / proxy.pike

version» Context lines:

Roxen.git/server/modules/proxies/proxy.pike:1:   // This is a roxen module. Copyright © 1996 - 2009, Roxen IS.      // HTTP Proxy module. Should be cleaned and optimized. Currently the   // limit of proxy connections/second is somewhere around 70% of normal   // requests, but there is no real reason for them to take longer.    - constant cvs_version = "$Id: proxy.pike,v 1.58 2009/05/07 14:15:55 mast Exp $"; + constant cvs_version = "$Id$";   constant thread_safe = 1;      #include <config.h>   #include <stat.h>      inherit "module";      #include <proxyauth.pike>   #include <roxen.h>   #include <module.h>
Roxen.git/server/modules/proxies/proxy.pike:479:    proxies = 0;    filters = 0;    http_codes_to_cache = 0;    log_function = 0;    stats = 0;   #ifdef THREADS    stats_mutex = 0;   #endif   }    - constant module_type = MODULE_PROXY|MODULE_LOCATION|MODULE_LOGGER; + constant module_type = MODULE_PROXY|MODULE_LOCATION|MODULE_LOGGER|MODULE_PROVIDER;   constant module_name = "HTTP-Proxy";   constant module_doc = "This is a caching HTTP-proxy with quite "    " a few bells and whistles";    -  + string query_provides() { return "http_request_init"; } +  + mapping http_request_init(RequestID id) + { +  werror("http_request_init(%O)...\n", id); +  if (has_prefix(id->misc->prot_cache_key, "http://")) { +  if ((query_location() == "http:/") && +  (!has_prefix(id->raw_url, "http:/"))) { +  // Undo the RFC 2068 5.1.2 stuff +  werror("Setting raw_url to %O\n", id->misc->prot_cache_key); +  id->raw_url = id->misc->prot_cache_key; +  } +  } +  return UNDEFINED; + } +    string query_location() { return query("mountpoint"); }      string status()   {    string res="";   /*    if(sizeof(requests))    {    res += "<hr><h1>Current connections</h1><p>";    foreach( indices(requests), object request)