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 - 2009, 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.1102 2012/01/11 14:25:53 wellhard Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1103 2012/01/19 14:12:01 grubba 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:2699:   //! ANY port already being open.   //! @endmapping   //! @endmapping   mapping(string:mapping(string:Configuration|Protocol|string|array(Protocol)|array(string)))    urls = ([]);      array sorted_urls = ({});      array(string) find_ips_for( string what )   { -  if( what == "*" || lower_case(what) == "any" ) +  if( what == "*" || lower_case(what) == "any" || has_value(what, "*") )    return ({   #if constant(__ROXEN_SUPPORTS_IPV6__)    "::",   #endif /* __ROXEN_SUPPORTS_IPV6__ */    0,    }); // ANY       if( is_ip( what ) )    return ({ what });    else if (has_prefix (what, "[") && what[-1] == ']') {
Roxen.git/server/base_server/roxen.pike:2823:       int was_any_ip;    if (!data->skipped && data->port) {    if (!data->port->ip || (data->port->ip == "::")) {    was_any_ip = data->port->port;    report_debug("Unregistering ANY port: %O:%d\n",    data->port->ip, data->port->port);    }    }    -  foreach(data->ports, Protocol port) { +  foreach(data->ports || ({}), Protocol port) {    shared_data->ports -= ({ port });    port->unref(url);    m_delete(shared_data, "port");    } -  if (!sizeof(shared_data->ports)) { +  if (!sizeof(shared_data->ports || ({}))) {    m_delete(urls, url);    } else if (!shared_data->port) {    shared_data->port = shared_data->ports[0];    }    sort_urls();       if (was_any_ip) {    foreach(urls; string url; mapping(string:mixed) url_info) {    if (!url_info->skipped || !url_info->conf ||    (url_info->port && (url_info->port->port != was_any_ip))) {
Roxen.git/server/base_server/roxen.pike:2850:    }    // Re-register the ports that may have bound to the removed ANY port.    register_url(url, url_info->conf);    }    }   }      array all_ports( )   {    // FIXME: Consider using open_ports instead. -  return Array.uniq( values( urls )->ports * ({}) )-({0}); +  return Array.uniq( (values( urls )->ports - ({0})) * ({}) )-({0});   }      Protocol find_port( string name )   {    foreach( all_ports(), Protocol p )    if( p->get_key() == name )    return p;   }      void sort_urls()