Branch: Tag:

2000-02-28

2000-02-28 06:25:43 by Per Hedbor <ph@opera.com>

It should now work even if you do not specify the port number in the URL to register (it defaults to the default port for the protocol used)

Rev: server/base_server/roxen.pike:1.442

4:   // 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.441 2000/02/25 16:14:38 nilsson Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.442 2000/02/28 06:25:43 per Exp $";      object backend_thread;   ArgCache argcache;
633:    {    if(urls[name])    return; +     refs++;    urls[name] = data;    sorted_urls = Array.sort_array(indices(urls), lambda(string a, string b) {
1505:    }    sscanf(host, "%[^:]:%d", host, port);    +  if( !port ) +  { +  port = protocols[ protocol ]->default_port; +  url = protocol+"://"+host+":"+port+path; +  } +     if( strlen( path ) && ( path[-1] == '/' ) )    path = path[..strlen(path)-2];    if( !strlen( path ) )
1554:       int failures;    -  foreach(required_hosts, string required_host) { +  foreach(required_hosts, string required_host) +  {    if( m[ required_host ] && m[ required_host ][ port ] )    {    m[required_host][port]->ref(url, urls[url]); -  +     urls[url]->port = m[required_host][port];    continue; /* No need to open a new port */    }