httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject [PATCH] Re: protocol/610: Multiple virtual hosts over single connection don't work
Date Tue, 27 May 1997 03:26:28 GMT
+1 

> On Fri, 23 May 1997, Dean Gaudet wrote:
> > What you're experiencing is already a bug throughout our vhost handling
> > code... see the vhosts-in-depth.html page.  In particular, connecting to
> > one of the "main server" addresses lets you get at any single vhost, even
> > if it's defined as an ip-vhost.  A solution that is consistent with our
> > current code is to reset conn->server to the result of
> > find_virtual_server() again. 
> 
> Ok, here is a better version. The result of find_virtual_server
> is stored in the conn structure and reset at the top of each
> read_request.
> 
> //pcs
> 
> diff -c /home/paul/remote-cvs/apache/src/http_main.c ./http_main.c
> *** /home/paul/remote-cvs/apache/src/http_main.c	Thu May 15 19:36:12 1997
> --- ./http_main.c	Sun May 25 14:48:53 1997
> ***************
> *** 1614,1619 ****
> --- 1614,1620 ----
>       conn->local_addr = *saddr;
>       conn->server = find_virtual_server(saddr->sin_addr, ntohs(saddr->sin_port),
>   				       server);
> +     conn->base_server = conn->server;
>       conn->client = inout;
>       
>       conn->remote_addr = *remaddr;
> diff -c /home/paul/remote-cvs/apache/src/http_protocol.c ./http_protocol.c
> *** /home/paul/remote-cvs/apache/src/http_protocol.c	Thu May 15 19:36:23 1997
> --- ./http_protocol.c	Sun May 25 14:50:24 1997
> ***************
> *** 761,766 ****
> --- 761,767 ----
>       request_rec *r = (request_rec *)pcalloc (conn->pool, sizeof(request_rec));
>   
>       r->connection = conn;
> +     conn->server = conn->base_server;
>       r->server = conn->server;
>       r->pool = make_sub_pool(conn->pool);
>   
> diff -c /home/paul/remote-cvs/apache/src/httpd.h ./httpd.h
> *** /home/paul/remote-cvs/apache/src/httpd.h	Thu May 15 19:36:24 1997
> --- ./httpd.h	Sun May 25 14:50:55 1997
> ***************
> *** 533,538 ****
> --- 533,539 ----
>     
>     pool *pool;
>     server_rec *server;
> +   server_rec *base_server;      /* Physical vhost this conn come in on */
>     
>     /* Information about the connection itself */
>   




Mime
View raw message