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.1010 2009/01/10 16:34:08 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1011 2009/01/10 16:54:54 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:1751:    foreach(open_ports[name]; string ip; mapping m) {    if (sizeof(m)) {    empty = 0;    break;    }    }    if (empty)    m_delete(open_ports, name);    }    } +  any_port = 0; // Avoid possibly cyclic ref.    //destruct( ); // Close the port.    }    }       Stdio.File accept()    {    return port_obj->accept();    }       string query_address()
Roxen.git/server/base_server/roxen.pike:1796:    });    return;    }    } else    c = mu->conf;    }    requesthandler( q, this_object(), c );    }    }    -  private function(string,int,RequestID:mapping(string:mixed)) sp_fudfu; +  private Protocol any_port;       mapping(string:mixed) find_url_data_for_url (string url, int no_default,    RequestID id)    {    if( sizeof( urls ) == 1 && !no_default)    {    if(!mu) mu=urls[sorted_urls[0]];    URL2CONF_MSG ("%O %O Only one configuration: %O\n", this, url, mu->conf);    return mu;    } else if (!sizeof(sorted_urls)) {
Roxen.git/server/base_server/roxen.pike:1836:    if( no_default ) {    URL2CONF_MSG ("%O %O no default\n", this, url);    return 0;    }       // Note: The docs for RequestID.misc->default_conf has a    // description of this fallback procedure.       // No host matched, or no host header was included in the request.    // Is the URL in the '*' ports? -  if (!sp_fudfu) -  if (Protocol p = open_ports[ name ][ 0 ][ port ] ) -  sp_fudfu = p->find_url_data_for_url; -  if (sp_fudfu && sp_fudfu != find_url_data_for_url) -  if (mapping(string:mixed) u = sp_fudfu (url, 1, id)) { -  URL2CONF_MSG ("%O %O sp_fudfu: %O\n", this, url, u->conf); -  if (id) id->misc->defaulted_conf = 1; +  if (!any_port) +  any_port = open_ports[ name ][ 0 ][ port ]; +  if (any_port && any_port != this) +  if (mapping(string:mixed) u = +  any_port->find_url_data_for_url (url, 1, id)) { +  URL2CONF_MSG ("%O %O found on ANY port: %O\n", this, url, u->conf); +  if (id) { +  id->misc->defaulted_conf = 1; +  id->port_obj = any_port; +  }    return u;    }       // No. We have to default to one of the other ports.    // It might be that one of the servers is tagged as a default server.    mapping(Configuration:int(1..1)) choices = ([]);    foreach( configurations, Configuration c )    if( c->query( "default_server" ) )    choices[c] = 1;   
Roxen.git/server/base_server/roxen.pike:1904:    // fallback.    url_data = urls[sorted_urls[-1]];    if (id) {    id->misc->defaulted_conf = 4;    id->misc->defaulted=1; // Compat.    }    URL2CONF_MSG ("%O %O last in sorted_urls: %O\n", this, url,    url_data->conf);    }    +  // It's assumed nothing below uses data in this object, since +  // find_url_data_for_url might have switched Protocol object. +     string config_path = url_data->path;    if (config_path && id && id->adjust_for_config_path)    id->adjust_for_config_path (config_path);    Configuration c = url_data->conf;    if(!c->inited)    // FIXME: We can be called from the backend thread, so this    // should be queued for a handler thread.    c->enable_all_modules();    return c;    }