]> granicus.if.org Git - apache/commitdiff
change ap_getline to return the size of the buffer when there's no apparent end
authorGreg Ames <gregames@apache.org>
Wed, 31 Oct 2001 21:14:23 +0000 (21:14 +0000)
committerGreg Ames <gregames@apache.org>
Wed, 31 Oct 2001 21:14:23 +0000 (21:14 +0000)
to an input line.  This is more like the 1.3 behavior which should help the
callers recognize this condition.

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

server/protocol.c

index 92778d6d3cdc0d3141ad0531d147c36274450ba5..8c57ae6464d1428ca4ac4b52faf8bd1f6d245e6e 100644 (file)
@@ -187,7 +187,10 @@ AP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime)
  * caused by MIME folding (or broken clients) if fold != 0, and place it
  * in the buffer s, of size n bytes, without the ending newline.
  *
- * Returns -1 on error, or the length of s.  
+ * Returns: 
+ *     the length of s (normal case),
+ *     n               (buffer full),
+ *    -1               (other errors)
  *
  * Notes: Because the buffer uses 1 char for NUL, the most we can return is 
  *        (n - 1) actual characters.  
@@ -269,7 +272,7 @@ AP_CORE_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int fold)
              * redirects get a new req_cfg->bb
              */
 
-            return -1;
+            return n;
         }
         
         pos = last_char;        /* Point at the last character           */