diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2016-08-29 22:17:07 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2016-08-29 22:17:07 +0000 |
commit | 28163941ef93594a4e36b775aeaf007a67d92640 (patch) | |
tree | 02f9fb6dcd32af4f78fc78b65984cedd094fcd3a /include/http_protocol.h | |
parent | 74a5f93a855ae16c600b8837aaf4c8793a44041d (diff) | |
download | httpd-28163941ef93594a4e36b775aeaf007a67d92640.tar.gz |
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/http_protocol.h')
-rw-r--r-- | include/http_protocol.h | 17 |
1 files changed, 12 insertions, 5 deletions
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); /** |