summaryrefslogtreecommitdiff
path: root/modules/http
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2012-08-14 20:57:43 +0000
committerJim Jagielski <jim@apache.org>2012-08-14 20:57:43 +0000
commit2071a9f88894abd7ce779b1152ecf63e3478ff17 (patch)
tree851d3627b28d05576678db0373ea78817e36e7d1 /modules/http
parent28bf85c5c8ba3ea2d8f2b9f8297a3d26348b0c02 (diff)
downloadhttpd-2071a9f88894abd7ce779b1152ecf63e3478ff17.tar.gz
Merge r1361801 from trunk:
Various code clean up Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr> PR: 52893 Submitted by: sf Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1373092 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/http')
-rw-r--r--modules/http/http_protocol.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c
index 7cbe769a87..2f78612303 100644
--- a/modules/http/http_protocol.c
+++ b/modules/http/http_protocol.c
@@ -799,11 +799,9 @@ AP_DECLARE(const char *) ap_get_status_line(int status)
}
/* Build the Allow field-value from the request handler method mask.
- * Note that we always allow TRACE, since it is handled below.
*/
static char *make_allow(request_rec *r)
{
- char *list;
apr_int64_t mask;
apr_array_header_t *allow = apr_array_make(r->pool, 10, sizeof(char *));
apr_hash_index_t *hi = apr_hash_first(r->pool, methods_registry);
@@ -831,25 +829,15 @@ static char *make_allow(request_rec *r)
if (conf->trace_enable != AP_TRACE_DISABLE)
*(const char **)apr_array_push(allow) = "TRACE";
- list = apr_array_pstrcat(r->pool, allow, ',');
-
/* ### this is rather annoying. we should enforce registration of
### these methods */
if ((mask & (AP_METHOD_BIT << M_INVALID))
&& (r->allowed_methods->method_list != NULL)
&& (r->allowed_methods->method_list->nelts != 0)) {
- int i;
- char **xmethod = (char **) r->allowed_methods->method_list->elts;
-
- /*
- * Append all of the elements of r->allowed_methods->method_list
- */
- for (i = 0; i < r->allowed_methods->method_list->nelts; ++i) {
- list = apr_pstrcat(r->pool, list, ",", xmethod[i], NULL);
- }
+ apr_array_cat(allow, r->allowed_methods->method_list);
}
- return list;
+ return apr_array_pstrcat(r->pool, allow, ',');
}
AP_DECLARE(int) ap_send_http_options(request_rec *r)