*) easy patches to synch 2.4.x and trunk:
- core: extend description of r->hostname
- mod_proxy_http: Avoid memory allocation before making sure that this handler can handle the URL
- core: Save a few cycles in 'ap_parse_form_data()'
- mod_cache_socache: Save some cycles
- mod_proxy_ftp: Save some cycle
- vhost: move an assignment to the end of the loop to ease readability and please a compiler
- core: Be a little more verbose when an error in trigerred in 'ap_set_file_slot()'
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1863316 13f79535-47bb-0310-9956-
ffa450edef68
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) easy patches to synch 2.4.x and trunk:
- - core: extend description of r->hostname
- - mod_proxy_http: Avoid memory allocation before making sure that this handler can handle the URL
- - core: Save a few cycles in 'ap_parse_form_data()'
- - mod_cache_socache: Save some cycles
- - mod_proxy_ftp: Save some cycle
- - vhost: move an assignment to the end of the loop to ease readability and please a compiler
- - core: Be a little more verbose when an error in trigerred in 'ap_set_file_slot()'
- trunk patch:
- - http://svn.apache.org/r1426802
- - http://svn.apache.org/r1744460
- - http://svn.apache.org/r1829799
- - http://svn.apache.org/r1824716
- - http://svn.apache.org/r1838318
- - http://svn.apache.org/r1840678
- - http://svn.apache.org/r1861294
- 2.4.x patch: svn merge -c 1426802,1744460,1829799,1824716,1838318,1840678,1861294 ^/httpd/httpd/trunk .
- +1: jailletc36, jim, icing
-
*) cache_storage: be consistent when building a cache key value when CacheKeyBaseURL is used with
an URL that contains a :port.
PR 53915 [Rein Tollevik <rein basefarm.no>]
int proto_num;
/** Protocol string, as given to us, or HTTP/0.9 */
char *protocol;
- /** Host, as set by full URI or Host: */
+ /** Host, as set by full URI or Host: header.
+ * For literal IPv6 addresses, this does NOT include the surrounding [ ]
+ */
const char *hostname;
/** Time when the request started */
while (apr_isspace(buffer[colon]) && (colon < *slider)) {
colon++;
}
- apr_table_addn(table, apr_pstrndup(r->pool, (const char *) buffer
- + key, len - key), apr_pstrndup(r->pool,
+ apr_table_addn(table, apr_pstrmemdup(r->pool, (const char *) buffer
+ + key, len - key), apr_pstrmemdup(r->pool,
(const char *) buffer + colon, *slider - colon));
(*slider)++;
if (buffer[*slider] == '\n') {
APR_BRIGADE_INSERT_TAIL(bb, apr_bucket_flush_create(c->bucket_alloc));
ap_pass_brigade(ftp_ctrl->output_filters, bb);
- /* strip off the CRLF for logging */
- apr_cpystrn(message, cmd, sizeof(message));
- if ((crlf = strchr(message, '\r')) != NULL ||
- (crlf = strchr(message, '\n')) != NULL)
- *crlf = '\0';
- if (strncmp(message,"PASS ", 5) == 0)
- strcpy(&message[5], "****");
- ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, ">%s", message);
+ if (APLOGrtrace2(r)) {
+ /* strip off the CRLF for logging */
+ apr_cpystrn(message, cmd, sizeof(message));
+ if ((crlf = strchr(message, '\r')) != NULL ||
+ (crlf = strchr(message, '\n')) != NULL)
+ *crlf = '\0';
+ if (strncmp(message,"PASS ", 5) == 0)
+ strcpy(&message[5], "****");
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, ">%s", message);
+ }
}
- rc = ftp_getrc_msg(ftp_ctrl, bb, message, sizeof message);
+ rc = ftp_getrc_msg(ftp_ctrl, bb, message, sizeof(message));
if (rc == -1 || rc == 421)
strcpy(message,"<unable to read result>");
if ((crlf = strchr(message, '\r')) != NULL ||
* and avoid a memory leak
*/
apr_pool_t *p = r->pool;
- apr_uri_t *uri = apr_palloc(p, sizeof(*uri));
+ apr_uri_t *uri;
/* find the scheme */
u = strchr(url, ':');
if (u == NULL || u[1] != '/' || u[2] != '/' || u[3] == '\0')
- return DECLINED;
+ return DECLINED;
if ((u - url) > 14)
return HTTP_BAD_REQUEST;
scheme = apr_pstrmemdup(p, url, u - url);
}
/* Step One: Determine Who To Connect To */
+ uri = apr_palloc(p, sizeof(*uri));
if ((status = ap_proxy_determine_connection(p, r, conf, worker, backend,
uri, &locurl, proxyname,
proxyport, req->server_portstr,
path = ap_server_root_relative(cmd->pool, arg);
if (!path) {
- return apr_pstrcat(cmd->pool, "Invalid file path ",
- arg, NULL);
+ return apr_pstrcat(cmd->pool, cmd->cmd->name, ": Invalid file path '",
+ arg, "'", NULL);
}
*(const char **) ((char*)struct_ptr + offset) = path;
case FORM_NAME:
if (offset < HUGE_STRING_LEN) {
if ('=' == c) {
- buffer[offset] = 0;
- offset = 0;
pair = (ap_form_pair_t *) apr_array_push(pairs);
- pair->name = apr_pstrdup(r->pool, buffer);
+ pair->name = apr_pstrmemdup(r->pool, buffer, offset);
pair->value = apr_brigade_create(r->pool, r->connection->bucket_alloc);
state = FORM_VALUE;
+ offset = 0;
}
else {
buffer[offset++] = c;
goto found;
}
}
- last_s = s;
/* Fallback: does it match the virthost from the sar? */
if (!strcasecmp(host, sar->virthost)) {
virthost_s = s;
}
}
+
+ last_s = s;
}
/* If ServerName and ServerAlias check failed, we end up here. If it