brian       96/10/22 11:54:07

  Modified:    src       http_core.h http_core.c http_main.c
  Log:
  Reviewed by:  Mark J Cox, Chuck Murcko, Jim Jagielski
  Submitted by: Dean Gaudet
  
  This patch adds another type to get_remote_name -- REMOTE_NOLOOKUP.
  This skips the lookup and returns the name/ip that is known already.
  This is then used in update_child_status so that no DNS lookups are
  forced for the status page.
  
  On its own, this patch really doesn't do anything :) So why am I
  submitting it?  It allows the creative hacker to set up their server
  to do reverse dns on some hits but not others.
  
  I imagine something like this would do the trick in 1.2:
  
      HostnameLookups On
      <Files \.(gif|jpeg)$>
      HostnameLookups Off
      </Files>
  
  Dean
  
  Revision  Changes    Path
  1.13      +2 -1      apache/src/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_core.h,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -C3 -r1.12 -r1.13
  *** http_core.h       1996/10/10 12:11:59     1.12
  --- http_core.h       1996/10/22 18:54:01     1.13
  ***************
  *** 50,56 ****
     *
     */
    
  ! /* $Id: http_core.h,v 1.12 1996/10/10 12:11:59 fielding Exp $ */
    
    /*****************************************************************
     *
  --- 50,56 ----
     *
     */
    
  ! /* $Id: http_core.h,v 1.13 1996/10/22 18:54:01 brian Exp $ */
    
    /*****************************************************************
     *
  ***************
  *** 78,83 ****
  --- 78,84 ----
    /* options for get_remote_host() */
    #define REMOTE_HOST (0)
    #define REMOTE_NAME (1)
  + #define REMOTE_NOLOOKUP (2)
    
    int allow_options (request_rec *);
    int allow_overrides (request_rec *);
  
  
  
  1.39      +1 -1      apache/src/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_core.c,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -C3 -r1.38 -r1.39
  *** http_core.c       1996/10/22 18:45:31     1.38
  --- http_core.c       1996/10/22 18:54:02     1.39
  ***************
  *** 304,310 ****
    /* If we haven't checked the host name, and we want to */
        dir_conf = (core_dir_config *)get_module_config(dir_config, 
&core_module);
    
  !     if (conn->remote_host == NULL && dir_conf->hostname_lookups)
        {
    #ifdef STATUS
        int old_stat = update_child_status(conn->child_num,
  --- 304,310 ----
    /* If we haven't checked the host name, and we want to */
        dir_conf = (core_dir_config *)get_module_config(dir_config, 
&core_module);
    
  !    if (type != REMOTE_NOLOOKUP && conn->remote_host == NULL && 
dir_conf->hostname_lookups)
        {
    #ifdef STATUS
        int old_stat = update_child_status(conn->child_num,
  
  
  
  1.77      +2 -2      apache/src/http_main.c
  
  Index: http_main.c
  ===================================================================
  RCS file: /export/home/cvs/apache/src/http_main.c,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -C3 -r1.76 -r1.77
  *** http_main.c       1996/10/06 02:25:03     1.76
  --- http_main.c       1996/10/22 18:54:03     1.77
  ***************
  *** 50,56 ****
     *
     */
    
  ! /* $Id: http_main.c,v 1.76 1996/10/06 02:25:03 fielding Exp $ */
    
    /*
     * httpd.c: simple http daemon for answering WWW file requests
  --- 50,56 ----
     *
     */
    
  ! /* $Id: http_main.c,v 1.77 1996/10/22 18:54:03 brian Exp $ */
    
    /*
     * httpd.c: simple http daemon for answering WWW file requests
  ***************
  *** 784,790 ****
        conn_rec *c = r->connection;
        slot_size = sizeof(new_score_rec.client) - 1;
        strncpy(new_score_rec.client, get_remote_host(c, r->per_dir_config,
  !      REMOTE_NAME), slot_size);
        new_score_rec.client[slot_size] = '\0';
        slot_size = sizeof(new_score_rec.request) - 1;
        strncpy(new_score_rec.request, (r->the_request ? r->the_request :
  --- 784,790 ----
        conn_rec *c = r->connection;
        slot_size = sizeof(new_score_rec.client) - 1;
        strncpy(new_score_rec.client, get_remote_host(c, r->per_dir_config,
  !      REMOTE_NOLOOKUP), slot_size);
        new_score_rec.client[slot_size] = '\0';
        slot_size = sizeof(new_score_rec.request) - 1;
        strncpy(new_score_rec.request, (r->the_request ? r->the_request :
  
  
  

Reply via email to