Core filters do not need mod_proxy.h
Small speed optimization when parsing <Limit>, <LimitExcept> and environment variables
Save a few bytes in conf pool
Remove some spaces between some return statements and ';' + fix a strange formating in a 'for' loop
In order to save a few cycles, delay a hash table lookup which is not necessary needed
Constify + save a few bytes in conf pool
Submitted by: ylavic, jailletc36, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed/backported by: jim
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1703405 13f79535-47bb-0310-9956-
ffa450edef68
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) Easy patches - synch with trunk
- - core: Core filters do not need mod_proxy.h
- - core: Small speed optimization when parsing <Limit>, <LimitExcept>
- and environment variables
- - mod_dav: Save a few bytes in conf pool
- - mod_proxy_http: Remove some spaces between some return statements
- and ';' + fix a strange formating in a 'for' loop
- - mod_dav: Save a few cycles
- - mod_deflate: Constify + save a few bytes in conf pool
- trunk patch:
- http://svn.apache.org/r1602978
- http://svn.apache.org/r1683044
- http://svn.apache.org/r1683884
- http://svn.apache.org/r1673368
- http://svn.apache.org/r1701717
- http://svn.apache.org/r1683047
- 2.4.x patch: trunk patchs work
- +1: jailletc36, ylavic, jim
-
*) Easy patches - synch with trunk
mod_negotiation: simplify type-map body tag lookup, and be safe
should it contain a NUL byte.
conf->provider = NULL;
}
else {
- conf->provider_name = apr_pstrdup(cmd->pool, arg1);
+ conf->provider_name = arg1;
}
if (conf->provider_name != NULL) {
* so only do this check if there is a versioning provider */
if (vsn_hooks != NULL) {
const char *target = apr_table_get(in_req->headers_in, DAV_LABEL_HDR);
- const char *vary = apr_table_get(out_req->headers_out, "Vary");
/* If Target-Selector specified, add it to the Vary header */
if (target != NULL) {
+ const char *vary = apr_table_get(out_req->headers_out, "Vary");
+
if (vary == NULL)
vary = DAV_LABEL_HDR;
else
int memlevel;
int compressionlevel;
apr_size_t bufferSize;
- char *note_ratio_name;
- char *note_input_name;
- char *note_output_name;
+ const char *note_ratio_name;
+ const char *note_input_name;
+ const char *note_output_name;
} deflate_filter_config;
typedef struct deflate_dirconf_t {
&deflate_module);
if (arg2 == NULL) {
- c->note_ratio_name = apr_pstrdup(cmd->pool, arg1);
+ c->note_ratio_name = arg1;
}
else if (!strcasecmp(arg1, "ratio")) {
- c->note_ratio_name = apr_pstrdup(cmd->pool, arg2);
+ c->note_ratio_name = arg2;
}
else if (!strcasecmp(arg1, "input")) {
- c->note_input_name = apr_pstrdup(cmd->pool, arg2);
+ c->note_input_name = arg2;
}
else if (!strcasecmp(arg1, "output")) {
- c->note_output_name = apr_pstrdup(cmd->pool, arg2);
+ c->note_output_name = arg2;
}
else {
return apr_psprintf(cmd->pool, "Unknown note type %s", arg1);
break;
default:
/* shouldn't be possible */
- rv = HTTP_INTERNAL_SERVER_ERROR ;
+ rv = HTTP_INTERNAL_SERVER_ERROR;
break;
}
if (psc->badopt == bad_error) {
/* Nope, it wasn't even an extra HTTP header. Give up. */
r->headers_out = NULL;
- return ;
+ return;
}
else if (psc->badopt == bad_body) {
/* if we've already started loading headers_out, then
"in headers returned by %s (%s)",
r->uri, r->method);
*pread_len = len;
- return ;
+ return;
} else {
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01099)
"No HTTP headers returned by %s (%s)",
r->uri, r->method);
- return ;
+ return;
}
}
}
++value; /* Skip to start of value */
/* should strip trailing whitespace as well */
- for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --
-end)
+ for (end = &value[strlen(value)-1]; end > value && apr_isspace(*end); --end)
*end = '\0';
/* make sure we add so as not to destroy duplicated headers
* Modify headers requiring canonicalisation and/or affected
* by ProxyPassReverse and family with process_proxy_header
*/
- process_proxy_header(r, dconf, buffer, value) ;
+ process_proxy_header(r, dconf, buffer, value);
saw_headers = 1;
/* the header was too long; at the least we should skip extra data */
}
if (*s == '$') {
- if (s[1] == '{' && (e = ap_strchr_c(s, '}'))) {
- char *name = apr_pstrndup(p, s+2, e-s-2);
+ if (s[1] == '{' && (e = ap_strchr_c(s+2, '}'))) {
+ char *name = apr_pstrmemdup(p, s+2, e-s-2);
word = NULL;
if (server_config_defined_vars)
word = apr_table_get(server_config_defined_vars, name);
return unclosed_directive(cmd);
}
- limited_methods = apr_pstrndup(cmd->temp_pool, arg, endp - arg);
+ limited_methods = apr_pstrmemdup(cmd->temp_pool, arg, endp - arg);
if (!limited_methods[0]) {
return missing_container_arg(cmd);
return "TRACE cannot be controlled by <Limit>, see TraceEnable";
}
else if (methnum == M_INVALID) {
- /* method has not been registered yet, but resorce restriction
+ /* method has not been registered yet, but resource restriction
* is always checked before method handling, so register it.
*/
methnum = ap_method_register(cmd->pool,
#include "mpm_common.h"
#include "scoreboard.h"
#include "mod_core.h"
-#include "mod_proxy.h"
#include "ap_listen.h"
#include "mod_so.h" /* for ap_find_loaded_module_symbol */