You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/03/07 13:24:30 UTC
Re: [PATCH] PR#212: error trying to resolve 255.255.255.255
+1 iff you use a variable name more meaningful than "i" for
the boolean tests. I have my limits ...
....Roy
>--- 871,894 ----
> *t = 0;
> }
>
>+ i = 0;
> if (strcmp(w, "*") == 0) {
>! my_addr = htonl(INADDR_ANY);
>! i = 1;
>! } else if( strcmp(w, "_default_") == 0
>! || strcmp(w, "255.255.255.255") == 0 ) {
>! my_addr = DEFAULT_VHOST_ADDR;
>! i = 1;
>! } else if(
> #ifdef DGUX
>! ( my_addr = inet_network(w) )
> #else
>! ( my_addr = inet_addr(w) )
> #endif
>! != INADDR_NONE ) {
>! i = 1;
>! }
>! if( i ) {
> sar = pcalloc( p, sizeof( server_addr_rec ) );
> **paddr = sar;
> *paddr = &sar->next;
>
Re: [PATCH] PR#212: error trying to resolve 255.255.255.255
Posted by Chuck Murcko <ch...@topsail.org>.
+1.
Dean Gaudet wrote:
>
> On Fri, 7 Mar 1997, Roy T. Fielding wrote:
>
> > +1 iff you use a variable name more meaningful than "i" for
> > the boolean tests. I have my limits ...
>
> Yeah yeah, I was really tired, yeah that's my excuse :)
>
> Revised patch included. (Hey this one even patches properly.)
>
> Dean
>
--
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA
chuck@topsail.org
Re: [PATCH] PR#212: error trying to resolve 255.255.255.255
Posted by Dean Gaudet <dg...@arctic.org>.
On Fri, 7 Mar 1997, Roy T. Fielding wrote:
> +1 iff you use a variable name more meaningful than "i" for
> the boolean tests. I have my limits ...
Yeah yeah, I was really tired, yeah that's my excuse :)
Revised patch included. (Hey this one even patches properly.)
Dean
Index: httpd.h
===================================================================
RCS file: /export/home/cvs/apache/src/httpd.h,v
retrieving revision 1.90
diff -c -3 -r1.90 httpd.h
*** httpd.h 1997/02/22 00:47:32 1.90
--- httpd.h 1997/03/07 22:58:23
***************
*** 551,556 ****
--- 551,561 ----
/* Per-vhost config... */
+ /* The address 255.255.255.255, when used as a virtualhost address,
+ * will become the "default" server when the ip doesn't match other vhosts.
+ */
+ #define DEFAULT_VHOST_ADDR 0xfffffffful
+
typedef struct server_addr_rec server_addr_rec;
struct server_addr_rec {
server_addr_rec *next;
Index: http_main.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_main.c,v
retrieving revision 1.127
diff -c -3 -r1.127 http_main.c
*** http_main.c 1997/03/04 21:44:38 1.127
--- http_main.c 1997/03/07 22:56:19
***************
*** 176,186 ****
int one_process = 0;
- /* The address 255.255.255.255, when used as a virtualhost address,
- * will become the "default" server when the ip doesn't match other vhosts.
- */
- #define DEFAULT_VHOST_ADDR 0xfffffffful
-
#if defined(USE_FCNTL_SERIALIZED_ACCEPT)
static struct flock lock_it = { F_WRLCK, 0, 0, 0 };
static struct flock unlock_it = { F_UNLCK, 0, 0, 0 };
--- 176,181 ----
Index: http_config.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_config.c,v
retrieving revision 1.42
diff -c -3 -r1.42 http_config.c
*** http_config.c 1997/01/26 01:15:11 1.42
--- http_config.c 1997/03/07 22:56:19
***************
*** 849,855 ****
unsigned long my_addr;
server_addr_rec *sar;
char *t;
! int i;
if( *w == 0 ) return;
--- 855,861 ----
unsigned long my_addr;
server_addr_rec *sar;
char *t;
! int i, is_an_ip_addr;
if( *w == 0 ) return;
***************
*** 865,887 ****
*t = 0;
}
if (strcmp(w, "*") == 0) {
! sar = pcalloc( p, sizeof( server_addr_rec ) );
! **paddr = sar;
! *paddr = &sar->next;
! sar->host_addr.s_addr = htonl(INADDR_ANY);
! sar->host_port = port;
! sar->virthost = pstrdup(p, w);
! if (t != NULL) *t = ':';
! return;
! }
!
#ifdef DGUX
! my_addr = inet_network(w);
#else
! my_addr = inet_addr(w);
#endif
! if (my_addr != INADDR_NONE) {
sar = pcalloc( p, sizeof( server_addr_rec ) );
**paddr = sar;
*paddr = &sar->next;
--- 871,894 ----
*t = 0;
}
+ is_an_ip_addr = 0;
if (strcmp(w, "*") == 0) {
! my_addr = htonl(INADDR_ANY);
! is_an_ip_addr = 1;
! } else if( strcmp(w, "_default_") == 0
! || 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 ) {
sar = pcalloc( p, sizeof( server_addr_rec ) );
**paddr = sar;
*paddr = &sar->next;