You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/05/09 21:29:58 UTC

cvs commit: apache-2.0/src/main rfc1413.c

trawick     00/05/09 12:29:58

  Modified:    src      CHANGES
               src/main rfc1413.c
  Log:
  rfc1413.c fixes:
  1) we were retrieving our local port before APR filled it in; wait a
     little longer :)
     (maybe APR needs to be a little smarter about when/if to call
     getsockname()?  it could call it when the info is first needed and
     not do it at all if never needed)
  2) when the server dropped the connection before sending a properly-
     delimited response, we entered a hard loop; we weren't reacting to
     EOF/FIN properly
  
  Revision  Changes    Path
  1.105     +6 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- CHANGES	2000/05/09 17:01:46	1.104
  +++ CHANGES	2000/05/09 19:29:55	1.105
  @@ -1,4 +1,10 @@
   Changes with Apache 2.0a4-dev
  +  *) Fix a couple of problems in RFC1413 support (controlled by the
  +     IdentityCheck directive).  Apache did not build the request string
  +     properly and more importantly Apache would loop forever if the 
  +     would-be ident server dropped the connection before sending a
  +     properly terminated response. [Jeff Trawick]
  +
     *) apxs works in 2.0.
        [Ryan Bloom]
   
  
  
  
  1.16      +5 -1      apache-2.0/src/main/rfc1413.c
  
  Index: rfc1413.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/rfc1413.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- rfc1413.c	2000/04/20 15:20:33	1.15
  +++ rfc1413.c	2000/05/09 19:29:57	1.16
  @@ -134,7 +134,6 @@
   		    "bind: rfc1413: Error binding to local port");
   	return -1;
       }
  -    ap_get_local_port(&sav_our_port, sock);
   
   /*
    * errors from connect usually imply the remote machine doesn't support
  @@ -145,6 +144,7 @@
                       
       if (ap_connect(sock, NULL) != APR_SUCCESS)
           return -1;
  +    ap_get_local_port(&sav_our_port, sock);
       ap_get_remote_port(&sav_rmt_port, sock);
   
   /* send the data */
  @@ -194,6 +194,10 @@
   	else if (j > 0) {
   	    i+=j; 
   	}
  +        else if (status == APR_SUCCESS && j == 0) {
  +            /* Oops... we ran out of data before finding newline */
  +            return -1;
  +        }
       }
   
   /* RFC1413_USERLEN = 512 */