From: William A. Rowe Jr Date: Tue, 18 Oct 2016 14:56:07 +0000 (+0000) Subject: When redrawing the parser, ap_get_http_token looked to be useful, but there's X-Git-Tag: 2.5.0-alpha~1084 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=138746eb14d12c51a4e38b8676ce272d015c8795;p=apache When redrawing the parser, ap_get_http_token looked to be useful, but there's no application for this yet in httpd, so hold off adding this function when we backport the enhancements. ap_scan_http_token was entirely sufficient. If the community wants this new function, we can add it when backporting work is complete. This patch, and the earlier patches Friday actually demanded an mmn major bump due to struct member changes. In any final backport, new members must be added to the end of the struct to retain an mmn minor designation. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1765451 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 41c5cac438..37bcdfb05a 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -546,17 +546,17 @@ * 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() - * 20160629.3 (2.5.0-dev) Dropped ap_has_cntrls(), ap_scan_http_uri_safe() - * and http_stricturi member/directive. + * 20161018.1 (2.5.0-dev) Dropped ap_has_cntrls(), ap_scan_http_uri_safe(), + * ap_get_http_token() and http_stricturi conf member. * Added ap_scan_vchar_obstext() */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ #ifndef MODULE_MAGIC_NUMBER_MAJOR -#define MODULE_MAGIC_NUMBER_MAJOR 20160629 +#define MODULE_MAGIC_NUMBER_MAJOR 20161018 #endif -#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 1 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/httpd.h b/include/httpd.h index 47437da75f..dec6706bd9 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -1654,16 +1654,6 @@ AP_DECLARE(const char *) ap_scan_http_token(const char *ptr); */ AP_DECLARE(const char *) ap_scan_vchar_obstext(const char *ptr); -/* Retrieve a token, advancing the pointer to the first non-token character - * and returning a copy of the token string. - * @param ptr The string to scan. On return, this points to the first non-token - * character encountered, or NULL if *ptr was not a token character - * @return A copy of the token string - * @note The caller must handle leading and trailing whitespace as applicable - * and evaluate the terminating character. - */ -AP_DECLARE(char *) ap_get_http_token(apr_pool_t *p, const char **ptr); - /** * Retrieve an array of tokens in the format "1#token" defined in RFC2616. Only * accepts ',' as a delimiter, does not accept quoted strings, and errors on diff --git a/server/util.c b/server/util.c index b7750c6be6..ad192562c4 100644 --- a/server/util.c +++ b/server/util.c @@ -1615,25 +1615,6 @@ AP_DECLARE(const char *) ap_scan_http_token(const char *ptr) return ptr; } -/* Retrieve a token, advancing the pointer to the first non-token character - * and returning a copy of the token string. - * The caller must handle whitespace and determine the meaning of the - * terminating character. Returns NULL if the character at **ptr is not - * a valid token character. - */ -AP_DECLARE(char *) ap_get_http_token(apr_pool_t *p, const char **ptr) -{ - const char *tok_end = ap_scan_http_token(*ptr); - char *tok; - - if (tok_end == *ptr) - return NULL; - - tok = apr_pstrmemdup(p, *ptr, tok_end - *ptr); - *ptr = tok_end; - return tok; -} - /* Scan a string for visible ASCII (0x21-0x7E) or obstext (0x80+) * and return a pointer to the first ctrl/space character encountered. */