httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: vhost stuff
Date Thu, 29 May 1997 03:53:46 GMT
Just a brief peek at your patch.

On Wed, 28 May 1997, Ed Korthof wrote:
> !   /* port is never 0 (unless the client sent 'Host: hostname:0', which makes
> !    * no sense.  If this server used a wildcard port, then r->server->port
> !    * is the default port of the main server, and r->server->addrs->host_port
> !    * is 0.  Also, for the main server, host_port is 0.
> !    * So if is not the main server, and r->server->addrs->host_port == 0,
> !    * then it's a wild card port.  But if it is the main server, we should
> !    * try aliases anyway since name-based vhosts haven't been scaned yet.
> !    */
> !   if ( (port != r->server->port) && (r->server->addrs->host_port
!= 0) )
>       return;

r->server->addrs == NULL if all DNS lookups failed for the <VirtualHost>
directive.

It looks wrong to just compare the first port too.  Consider:

<VirtualHost 1.1.1.1:80 2.2.2.2:8080>
</VirtualHost>

> !     /* Now we try to match against ServerName, if configured.
> !      * Note that only the last ServerName per server is used.  Again,
> !      * ports may not match if this server uses a wildcard port.
> !      */
> ! 
> !     if ((!strcasecmp(host, s->server_hostname)) && 
> !          ( (port == s->port) || (s->addrs->host_port == 0) ) ) {

Similar comment to above.

Dean


Mime
View raw message