httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_protocol.c
Date Thu, 12 Oct 2000 02:54:38 GMT
trawick     00/10/11 19:54:38

  Modified:    src/main http_protocol.c
  Log:
  In read_request_line(), we don't have to check any sort of EOF flag
  anymore because getline() returns < 0 upon EOF.
  There are also a few very minor tweaks to getline() -- remove an
  unused variable, remove a couple of unnecessary comments, simplify
  an error path.
  
  Revision  Changes    Path
  1.160     +3 -6      apache-2.0/src/main/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v
  retrieving revision 1.159
  retrieving revision 1.160
  diff -u -r1.159 -r1.160
  --- http_protocol.c	2000/10/12 01:59:09	1.159
  +++ http_protocol.c	2000/10/12 02:54:38	1.160
  @@ -949,7 +949,6 @@
   static int getline(char *s, int n, conn_rec *c, int fold)
   {
       char *pos = s;
  -    const char *toss;
       const char *temp;
       int retval;
       int total = 0;
  @@ -978,7 +977,6 @@
           }
           retval = e->read(e, &temp, &length, 0);
   
  -        /* retval == APR_SUCCESS on SUCCESS */
           if (retval != APR_SUCCESS) {
               total = ((length < 0) && (total == 0)) ? -1 : total;
               break;
  @@ -993,8 +991,7 @@
               /* input line was larger than the caller's buffer */
               AP_BUCKET_REMOVE(e);
               ap_bucket_destroy(e);
  -            total = -1;  /* ??? is this right ? */
  -            break;
  +            return -1;
           }
           
   /**** XXX
  @@ -1040,7 +1037,7 @@
           else {
               pos++;              /* bump past end of incomplete line      */
           }
  -	}
  +    }
       return total;
   }
   
  @@ -1123,7 +1120,7 @@
       ap_bsetflag(conn->client, B_SAFEREAD, 1); 
       ap_bflush(conn->client);
       while ((len = getline(l, sizeof(l), conn, 0)) <= 0) {
  -        if ((len < 0) || 1 /* ap_bgetflag(conn->client, B_EOF) */ ) {
  +        if (len < 0) {             /* includes EOF */
   	    ap_bsetflag(conn->client, B_SAFEREAD, 0);
   	    /* this is a hack to make sure that request time is set,
   	     * it's not perfect, but it's better than nothing 
  
  
  

Mime
View raw message