Commit 5d629ee1 authored by Greg Ames's avatar Greg Ames
Browse files

change ap_getline to return the size of the buffer when there's no apparent end

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
parent 8ed1aa53
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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           */