diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2016-08-30 00:17:07 +0200 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2016-08-30 00:17:07 +0200 |
commit | 28163941ef93594a4e36b775aeaf007a67d92640 (patch) | |
tree | 02f9fb6dcd32af4f78fc78b65984cedd094fcd3a /include | |
parent | Regenerate (diff) | |
download | apache2-28163941ef93594a4e36b775aeaf007a67d92640.tar.xz apache2-28163941ef93594a4e36b775aeaf007a67d92640.zip |
New optional flag to enforce <CR><LF> line delimiters in ap_[r]getline,
created by overloading 'int fold' (1 or 0) as 'int flags', with the same
value 1 for AP_GETLINE_FOLD (which httpd doesn't use), and a new value
2 for AP_GETLINE_CRLF
Enforce CRLF when HttpProtocolOptions Strict is in force.
Correctly introduces a new t/TEST fail.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758304 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r-- | include/ap_mmn.h | 3 | ||||
-rw-r--r-- | include/http_protocol.h | 17 |
2 files changed, 14 insertions, 6 deletions
diff --git a/include/ap_mmn.h b/include/ap_mmn.h index e0b4a35939..aea8507f41 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -545,6 +545,7 @@ * 20160617.1 (2.5.0-dev) Added http_whitespace and http_methods to * core_server_config * 20160629.1 (2.5.0-dev) Dropped http_whitespace from core_server_config + * 20160629.2 (2.5.0-dev) Replaced fold w/multiple flags for ap_[r]getline() */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -552,7 +553,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20160629 #endif -#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/http_protocol.h b/include/http_protocol.h index 07fc6e9e47..77c9766b60 100644 --- a/include/http_protocol.h +++ b/include/http_protocol.h @@ -589,17 +589,22 @@ 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); +#define AP_GETLINE_FOLD 1 /* Whether to merge continuation lines */ +#define AP_GETLINE_CRLF 2 /*Whether line ends must be in the form CR LF */ + /** * 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 + * @param flags Bit flag of multiple parsing options + * AP_GETLINE_FOLD Whether to merge continuation lines + * AP_GETLINE_CRLF Whether line ends must be in the form CR LF * @return The length of the line, if successful * n, if the line is too big to fit in the buffer * -1 for miscellaneous errors */ -AP_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int fold); +AP_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int flags); /** * Get the next line of input for the request @@ -617,7 +622,9 @@ AP_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int fold); * @param n The size of the buffer * @param read The length of the line. * @param r The request - * @param fold Whether to merge continuation lines + * @param flags Bit flag of multiple parsing options + * AP_GETLINE_FOLD Whether to merge continuation lines + * AP_GETLINE_CRLF Whether line ends must be in the form CR LF * @param bb Working brigade to use when reading buckets * @return APR_SUCCESS, if successful * APR_ENOSPC, if the line is too big to fit in the buffer @@ -626,7 +633,7 @@ AP_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int fold); #if APR_CHARSET_EBCDIC AP_DECLARE(apr_status_t) ap_rgetline(char **s, apr_size_t n, apr_size_t *read, - request_rec *r, int fold, + request_rec *r, int flags, apr_bucket_brigade *bb); #else /* ASCII box */ #define ap_rgetline(s, n, read, r, fold, bb) \ @@ -636,7 +643,7 @@ AP_DECLARE(apr_status_t) ap_rgetline(char **s, apr_size_t n, /** @see ap_rgetline */ AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n, apr_size_t *read, - request_rec *r, int fold, + request_rec *r, int flags, apr_bucket_brigade *bb); /** |