From 8c960a8c15d9915729125c513feef62cf867d8b9 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sun, 15 Jul 2012 21:14:00 +0000 Subject: Various code clean up Submitted by: Christophe JAILLET PR: 52893 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361801 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_protocol.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'modules/http') 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) -- cgit v1.2.3