httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roy Fielding <field...@hyperreal.org>
Subject cvs commit: apache/src http_core.c
Date Mon, 04 Aug 1997 02:36:06 GMT
fielding    97/08/03 19:36:04

  Modified:    src       http_core.c
  Log:
  Fix warning due to haddr being used outside the conditional block
  in which it is given a value.  The fix is more efficient anyway.
  
  Revision  Changes    Path
  1.106     +5 -7      apache/src/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_core.c,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- http_core.c	1997/08/03 21:00:08	1.105
  +++ http_core.c	1997/08/04 02:36:03	1.106
  @@ -329,7 +329,6 @@
   static inline void do_double_reverse (conn_rec *conn)
   {
       struct hostent *hptr;
  -    char **haddr;
   
       if (conn->double_reverse) {
   	/* already done */
  @@ -342,18 +341,17 @@
       }
       hptr = gethostbyname(conn->remote_host);
       if (hptr) {
  +	char **haddr;
  +
   	for (haddr = hptr->h_addr_list; *haddr; haddr++) {
   	    if (((struct in_addr *)(*haddr))->s_addr
   		== conn->remote_addr.sin_addr.s_addr) {
  -		break;
  +		conn->double_reverse = 1;
  +		return;
   	    }
   	}
       }
  -    if (!hptr || !*haddr) {
  -	conn->double_reverse = -1;
  -    } else {
  -	conn->double_reverse = 1;
  -    }
  +    conn->double_reverse = -1;
   }
   
   API_EXPORT(const char *) get_remote_host(conn_rec *conn, void *dir_config, int type)
  
  
  

Mime
View raw message