]> granicus.if.org Git - apache/commitdiff
In read_request_line(), we don't have to check any sort of EOF flag
authorJeff Trawick <trawick@apache.org>
Thu, 12 Oct 2000 02:54:38 +0000 (02:54 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 12 Oct 2000 02:54:38 +0000 (02:54 +0000)
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.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86553 13f79535-47bb-0310-9956-ffa450edef68

modules/http/http_protocol.c

index 224dc7abcde12d0cfa22ec781e8763530e5dbc48..87925cc64e602d29f4e80dae5faa26accf81ccde 100644 (file)
@@ -949,7 +949,6 @@ apr_status_t http_filter(ap_filter_t *f, ap_bucket_brigade *b)
 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 @@ static int getline(char *s, int n, conn_rec *c, int fold)
         }
         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 @@ static int getline(char *s, int n, conn_rec *c, int fold)
             /* 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 @@ static int getline(char *s, int n, conn_rec *c, int fold)
         else {
             pos++;              /* bump past end of incomplete line      */
         }
-       }
+    }
     return total;
 }
 
@@ -1123,7 +1120,7 @@ static int read_request_line(request_rec *r)
     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