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.889 2005/05/23 09:47:21 anders Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.890 2005/05/31 12:10:45 jonasw 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:1168:       // Can we bind to it?    Stdio.Port port = Stdio.Port();    res = port->bind(0, 0, ip);       destruct(port);    return host_is_local_cache[hostname] = res;   }      Configuration find_configuration_for_url(Standards.URI url, -  void|Configuration only_this_conf) +  void|Configuration only_this_conf, +  void|array(Protocol) return_port)   //! Tries to to determine if a request for the given url would end up   //! in this server, and if so returns the corresponding configuration.   //!   //! If @[only_this_conf] has been specified only matches against it   //! will be returned.   {    Configuration c; -  +  Protocol c_portobj; +     string url_with_port = sprintf("%s://%s:%d%s", url->scheme, url->host,    url->port,    (sizeof(url->path)?url->path:"/"));       URL2CONF_MSG("URL with port: %s\n", url_with_port);       foreach( indices(urls), string u )    {    mixed q = urls[u];    URL2CONF_MSG("Trying %O:%O\n", u, q);
Roxen.git/server/base_server/roxen.pike:1205:    ((search(u, "*") != -1 || search(u, "?") != -1) &&    // u is something like "http://*:80/"    (!host_is_local(url->host)))) {    // Bad match.    URL2CONF_MSG("Bad match: only_this_conf:%O, host_is_local:%O\n",    (only_this_conf && (c == only_this_conf)),    (!host_is_local(url->host)));    c = 0;    continue;    } +  c_portobj = q->port;    break;    }    }    }    URL2CONF_MSG("Result: %O\n", c); -  +  if (return_port) +  return_port[0] = c_portobj;    return c;   }      class InternalRequestID   //! ID for internal requests that are not linked to any real request.   {    inherit RequestID;       this_program set_path( string f )    {
Roxen.git/server/base_server/roxen.pike:1255:       this_program set_url( string url )    {    object uri = Standards.URI(url);    prot = upper_case(uri->scheme);    misc->host = uri->host;    string path = uri->path;    raw_url = path;    method = "GET";    raw = "GET " + raw_url + " HTTP/1.1\r\n\r\n"; -  conf = find_configuration_for_url(uri); +  array(Protocol) port_array = ({ 0 }); +  conf = find_configuration_for_url(uri, 0, port_array); +  port_obj = port_array[0];    return set_path( raw_url );    }       static string _sprintf()    {    return sprintf("RequestID(conf=%O; not_query=%O)", conf, not_query );    }       static void create()    {