Branch: Tag:

2012-01-19

2012-01-19 14:12:01 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Roxen: Improved robustness in port handling for failed URLs. Fixes [bug 6174 (#6174)].

Rev: server/base_server/roxen.pike:1.1103

6:   // 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   //!
2706:      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__)    "::",
2830:    }    }    -  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];
2857:   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 )