From: Greg Ames Date: Wed, 31 Oct 2001 21:14:23 +0000 (+0000) Subject: change ap_getline to return the size of the buffer when there's no apparent end X-Git-Tag: 2.0.28~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e864d370bf9b6fb962bbb65c4620e6ccedddabff;p=apache 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 --- diff --git a/server/protocol.c b/server/protocol.c index 92778d6d3c..8c57ae6464 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -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 */