The following reply was made to PR os-osf/463; it has been noted by GNATS.

From: Brett McCormick <[EMAIL PROTECTED]>
To: Dean Gaudet <[EMAIL PROTECTED]>
Subject: Re: os-osf/463: virtualhost support functionally broken
Date: Wed, 23 Apr 1997 15:08:42 -0700 (PDT)

 
 
 On Wed, 23 April 1997, at 14:50:43, Dean Gaudet wrote:
 
 > On Wed, 23 Apr 1997, Brett McCormick wrote:
 > > I'll try changing it to use inet_network, but again, these functions
 > > take string ip addresses, whereas I'm using hostnames..
 > 
 > Yep but they're called to find out if the address passed is an ip addr,
 > and if we're misinterpreting their result code it would cause the problem
 > you describe.  All vhosts would be treated as if they were _default_ and
 > the code would actually end up using the first one in the file. 
 
 Exactly.  Which is why inet_network won't have any beneficial effect,
 we'll still misinterpret the result code.  And if we weren't, it would
 do the wrong thing anyway.  But I'll give it a try.
 
 As I said in my previous mail, the man page is wrong.  It says it
 returns (in_addr_t)-1, but does not.  If it did, it would work.  I'm
 not sure how you want to make this work, aside from putting an #elif
 OSF like you did below, and just use -1 instead of INADDR_NONE.
 
 You don't need to send me a patch until it is one that will be
 included in the final distribution.  I've already got my copy fixed,
 I'm only doing this so others won't have to go through the same
 debugging effort.
 
 > 
 > Your inet_addr returns (in_addr_t)-1, which isn't what we test for -- we
 > test for INADDR_NONE.  Unfortunately every other arch returns INADDR_NONE
 > as the error code.  Using inet_network might fix that.  If it doesn't you
 > could give the patch below a try.  (A similar change needs to be applied
 > to get_virthost_addr() in util.c.)
 > 
 > Dean
 > 
 > *** http_config.c.dist       Wed Apr 23 14:47:13 1997
 > --- http_config.c    Wed Apr 23 14:48:22 1997
 > ***************
 > *** 879,891 ****
 >          || strcmp(w, "255.255.255.255") == 0 ) {
 >      my_addr = DEFAULT_VHOST_ADDR;
 >      is_an_ip_addr = 1;
 > !     } else if(
 > ! #ifdef DGUX
 > !        ( my_addr = inet_network(w) )
 >   #else
 > !        ( my_addr = inet_addr(w) )
 >   #endif
 > !        != INADDR_NONE ) {
 >      is_an_ip_addr = 1;
 >       }
 >       if( is_an_ip_addr ) {
 > --- 879,893 ----
 >          || strcmp(w, "255.255.255.255") == 0 ) {
 >      my_addr = DEFAULT_VHOST_ADDR;
 >      is_an_ip_addr = 1;
 > !     }
 > ! #if defined( DGUX )
 > !     else if( ( my_addr = inet_network(w) ) != INADDR_NONE )
 > ! #elif defined( OSF1 )
 > !     else if( ( my_addr = inet_addr(w) ) != (in_addr_t)-1 )
 >   #else
 > !     else if( ( my_addr = inet_addr(w) ) != INADDR_NONE )
 >   #endif
 > !     {
 >      is_an_ip_addr = 1;
 >       }
 >       if( is_an_ip_addr ) {
 > 

Reply via email to