From: Brian Pane Date: Sun, 2 Dec 2001 23:13:32 +0000 (+0000) Subject: Added a version of ap_getline() that allocs a buffer from X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b81b0370bcc5258a3c455e322b2aa71aa24d7770;p=apache Added a version of ap_getline() that allocs a buffer from the request's pool, rather than copying into a caller-supplied buffer. (This lets us eliminate one copy operation on the request headers.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92290 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/http_protocol.h b/include/http_protocol.h index bb87cbf364..d38467a811 100644 --- a/include/http_protocol.h +++ b/include/http_protocol.h @@ -526,8 +526,34 @@ AP_DECLARE(int) ap_get_basic_auth_pw(request_rec *r, const char **pw); */ AP_CORE_DECLARE(void) ap_parse_uri(request_rec *r, const char *uri); +/** + * Get the next line of input for the request + * @param s The buffer into which to read the line + * @param n The size of the buffer + * @param r The request + * @param fold Whether to merge continuation lines + * @return The length of the line, if successful + * n, if the line is too big to fit in the buffer + * -1 for miscellaneous errors + * @deffunc int ap_method_number_of(const char *method) + */ AP_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int fold); +/** + * Get the next line of input for the request + * @param s Pointer to the pointer to the buffer into which the line + * should be read; if *s==NULL, a buffer of the necessary size + * to hold the data will be allocated from the request pool + * @param n The size of the buffer + * @param r The request + * @param fold Whether to merge continuation lines + * @return The length of the line, if successful + * n, if the line is too big to fit in the buffer + * -1 for miscellaneous errors + * @deffunc int ap_method_number_of(const char *method) + */ +AP_DECLARE(int) ap_rgetline(char **s, int n, request_rec *r, int fold); + /** * Get the method number associated with the given string, assumed to * contain an HTTP method. Returns M_INVALID if not recognized.