Branch: Tag:

2010-07-26

2010-07-26 14:41:55 by Martin Stjernholm <mast@lysator.liu.se>

Don't break in id->url_base if the port isn't registered in the
configuration.

Guess that can happen in the more awkward configuration choices
towards the end of Protocol.find_url_data_for_url and
Protocol.find_configuration_for_url.

Rev: server/base_server/prototypes.pike:1.274

5:   #include <config.h>   #include <module.h>   #include <module_constants.h> - constant cvs_version="$Id: prototypes.pike,v 1.273 2010/07/12 20:07:43 mast Exp $"; + constant cvs_version="$Id: prototypes.pike,v 1.274 2010/07/26 14:41:55 mast Exp $";      #ifdef DAV_DEBUG   #define DAV_WERROR(X...) werror(X)
2344:    }       // Then use the port object. -  else if (port_obj) { -  string host = port_obj->conf_data[conf]->hostname; -  if (host == "*") { +  else if (mapping(string:mixed) conf_data = +  port_obj && port_obj->conf_data[conf]) { +  string host = conf_data->hostname; +  if (host == "*")    // Use the hostname in the configuration url. -  host = conf && conf->get_host(); -  if (!host) +     // Fall back to the numeric ip. -  host = port_obj->ip; -  } +  host = conf->get_host() || port_obj->ip;    cached_url_base = port_obj->prot_name + "://" + host;    if (port_obj->port != port_obj->default_port)    cached_url_base += ":" + port_obj->port;