1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * http_request.c: functions to get and process requests
22 * Thoroughly revamped by rst for Apache. NB this file reads
23 * best from the bottom up.
27 #include "apr_strings.h"
28 #include "apr_file_io.h"
29 #include "apr_fnmatch.h"
31 #define APR_WANT_STRFUNC
34 #include "ap_config.h"
36 #include "http_config.h"
37 #include "http_request.h"
38 #include "http_core.h"
39 #include "http_protocol.h"
41 #include "http_main.h"
42 #include "mpm_common.h"
43 #include "util_filter.h"
44 #include "util_charset.h"
45 #include "scoreboard.h"
53 APLOG_USE_MODULE(http);
55 /*****************************************************************
57 * Mainline request processing...
60 /* XXX A cleaner and faster way to do this might be to pass the request_rec
61 * down the filter chain as a parameter. It would need to change for
62 * subrequest vs. main request filters; perhaps the subrequest filter could
65 static void update_r_in_filters(ap_filter_t *f,
77 static void ap_die_r(int type, request_rec *r, int recursive_error)
79 char *custom_response;
80 request_rec *r_1st_err = r;
82 if (type == OK || type == DONE) {
83 ap_finalize_request_protocol(r);
87 if (!ap_is_HTTP_VALID_RESPONSE(type)) {
91 * Check if we still have the ap_http_header_filter in place. If
92 * this is the case we should not ignore the error here because
93 * it means that we have not sent any response at all and never
94 * will. This is bad. Sent an internal server error instead.
96 next = r->output_filters;
97 while (next && (next->frec != ap_http_header_filter_handle)) {
102 * If next != NULL then we left the while above because of
103 * next->frec == ap_http_header_filter
106 if (type != AP_FILTER_ERROR) {
107 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01579)
108 "Invalid response status %i", type);
111 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02831)
112 "Response from AP_FILTER_ERROR");
114 type = HTTP_INTERNAL_SERVER_ERROR;
122 * The following takes care of Apache redirects to custom response URLs
123 * Note that if we are already dealing with the response to some other
124 * error condition, we just report on the original error, and give up on
125 * any attempt to handle the other thing "intelligently"...
127 if (recursive_error != HTTP_OK) {
128 while (r_1st_err->prev && (r_1st_err->prev->status != HTTP_OK))
129 r_1st_err = r_1st_err->prev; /* Get back to original error */
131 if (r_1st_err != r) {
132 /* The recursive error was caused by an ErrorDocument specifying
133 * an internal redirect to a bad URI. ap_internal_redirect has
134 * changed the filter chains to point to the ErrorDocument's
135 * request_rec. Back out those changes so we can safely use the
136 * original failing request_rec to send the canned error message.
138 * ap_send_error_response gets rid of existing resource filters
139 * on the output side, so we can skip those.
141 update_r_in_filters(r_1st_err->proto_output_filters, r, r_1st_err);
142 update_r_in_filters(r_1st_err->input_filters, r, r_1st_err);
145 custom_response = NULL; /* Do NOT retry the custom thing! */
148 int error_index = ap_index_of_response(type);
149 custom_response = ap_response_code_string(r, error_index);
156 * This test is done here so that none of the auth modules needs to know
157 * about proxy authentication. They treat it like normal auth, and then
158 * we tweak the status.
160 if (HTTP_UNAUTHORIZED == r->status && PROXYREQ_PROXY == r->proxyreq) {
161 r->status = HTTP_PROXY_AUTHENTICATION_REQUIRED;
164 /* If we don't want to keep the connection, make sure we mark that the
165 * connection is not eligible for keepalive. If we want to keep the
166 * connection, be sure that the request body (if any) has been read.
168 if (ap_status_drops_connection(r->status)) {
169 r->connection->keepalive = AP_CONN_CLOSE;
173 * Two types of custom redirects --- plain text, and URLs. Plain text has
174 * a leading '"', so the URL code, here, is triggered on its absence
177 if (custom_response && custom_response[0] != '"') {
179 if (ap_is_url(custom_response)) {
181 * The URL isn't local, so lets drop through the rest of this
182 * apache code, and continue with the usual REDIRECT handler.
183 * But note that the client will ultimately see the wrong
186 r->status = HTTP_MOVED_TEMPORARILY;
187 apr_table_setn(r->headers_out, "Location", custom_response);
189 else if (custom_response[0] == '/') {
190 const char *error_notes, *original_method;
191 int original_method_number;
192 r->no_local_copy = 1; /* Do NOT send HTTP_NOT_MODIFIED for
193 * error documents! */
195 * This redirect needs to be a GET no matter what the original
198 apr_table_setn(r->subprocess_env, "REQUEST_METHOD", r->method);
201 * Provide a special method for modules to communicate
202 * more informative (than the plain canned) messages to us.
203 * Propagate them to ErrorDocuments via the ERROR_NOTES variable:
205 if ((error_notes = apr_table_get(r->notes,
206 "error-notes")) != NULL) {
207 apr_table_setn(r->subprocess_env, "ERROR_NOTES", error_notes);
209 original_method = r->method;
210 original_method_number = r->method_number;
212 r->method_number = M_GET;
213 ap_internal_redirect(custom_response, r);
214 /* preserve ability to see %<m in the access log */
215 r->method = original_method;
216 r->method_number = original_method_number;
221 * Dumb user has given us a bad url to redirect to --- fake up
222 * dying with a recursive server error...
224 recursive_error = HTTP_INTERNAL_SERVER_ERROR;
225 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01580)
226 "Invalid error redirection directive: %s",
230 ap_send_error_response(r_1st_err, recursive_error);
233 AP_DECLARE(void) ap_die(int type, request_rec *r)
235 ap_die_r(type, r, r->status);
238 AP_DECLARE(apr_status_t) ap_check_pipeline(conn_rec *c, apr_bucket_brigade *bb,
239 unsigned int max_blank_lines)
241 apr_status_t rv = APR_EOF;
242 ap_input_mode_t mode = AP_MODE_SPECULATIVE;
243 unsigned int num_blank_lines = 0;
247 while (c->keepalive != AP_CONN_CLOSE && !c->aborted) {
248 apr_size_t len = cr + 1;
250 apr_brigade_cleanup(bb);
251 rv = ap_get_brigade(c->input_filters, bb, mode,
252 APR_NONBLOCK_READ, len);
253 if (rv != APR_SUCCESS || APR_BRIGADE_EMPTY(bb)) {
254 if (mode == AP_MODE_READBYTES) {
255 /* Unexpected error, stop with this connection */
256 ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c, APLOGNO(02967)
257 "Can't consume pipelined empty lines");
258 c->keepalive = AP_CONN_CLOSE;
261 else if (rv != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(rv)) {
263 c->keepalive = AP_CONN_CLOSE;
266 /* Pipe is up and empty */
271 if (!max_blank_lines) {
273 /* Single read asked, (non-meta-)data available? */
274 rv = apr_brigade_length(bb, 0, &n);
275 if (rv == APR_SUCCESS && n <= 0) {
281 /* Lookup and consume blank lines */
282 rv = apr_brigade_flatten(bb, buf, &len);
283 if (rv != APR_SUCCESS || len != cr + 1) {
285 if (mode == AP_MODE_READBYTES) {
286 /* Unexpected error, stop with this connection */
287 c->keepalive = AP_CONN_CLOSE;
288 log_level = APLOG_ERR;
292 /* Let outside (non-speculative/blocking) read determine
293 * where this possible failure comes from (metadata,
294 * morphed EOF socket, ...). Debug only here.
296 log_level = APLOG_DEBUG;
299 ap_log_cerror(APLOG_MARK, log_level, rv, c, APLOGNO(02968)
300 "Can't check pipelined data");
304 if (mode == AP_MODE_READBYTES) {
305 /* [CR]LF consumed, try next */
306 mode = AP_MODE_SPECULATIVE;
310 AP_DEBUG_ASSERT(len == 2 && buf[0] == APR_ASCII_CR);
311 if (buf[1] == APR_ASCII_LF) {
312 /* consume this CRLF */
313 mode = AP_MODE_READBYTES;
317 /* CR(?!LF) is data */
322 if (buf[0] == APR_ASCII_LF) {
323 /* consume this LF */
324 mode = AP_MODE_READBYTES;
327 else if (buf[0] == APR_ASCII_CR) {
331 /* Not [CR]LF, some data */
335 if (num_blank_lines > max_blank_lines) {
336 /* Enough blank lines with this connection,
337 * stop and don't recycle it.
339 c->keepalive = AP_CONN_CLOSE;
348 AP_DECLARE(void) ap_process_request_after_handler(request_rec *r)
350 apr_bucket_brigade *bb;
352 conn_rec *c = r->connection;
355 bb = ap_acquire_brigade(c);
357 /* Send an EOR bucket through the output filter chain. When
358 * this bucket is destroyed, the request will be logged and
359 * its pool will be freed
361 b = ap_bucket_eor_create(c->bucket_alloc, r);
362 APR_BRIGADE_INSERT_HEAD(bb, b);
364 /* Find the last request, taking into account internal
365 * redirects. We want to send the EOR bucket at the end of
366 * all the buckets so it does not jump the queue.
372 /* All the request filters should have bailed out on EOS, and in any
373 * case they shouldn't have to handle this EOR which will destroy the
374 * request underneath them. So go straight to the core request filter
375 * which (if any) will take care of the setaside buckets.
377 for (f = r->output_filters; f; f = f->next) {
378 if (f->frec == ap_request_core_filter_handle) {
382 ap_pass_brigade(f ? f : c->output_filters, bb);
384 /* The EOR bucket has either been handled by an output filter (eg.
385 * deleted or moved to a buffered_bb => no more in bb), or an error
386 * occurred before that (eg. c->aborted => still in bb) and we ought
387 * to destroy it now. So cleanup any remaining bucket along with
388 * the orphan request (if any).
390 apr_brigade_cleanup(bb);
392 /* From here onward, it is no longer safe to reference r
393 * or r->pool, because r->pool may have been destroyed
394 * already by the EOR bucket's cleanup function.
397 /* Check pipeline consuming blank lines, they must not be interpreted as
398 * the next pipelined request, otherwise we would block on the next read
399 * without flushing data, and hence possibly delay pending response(s)
400 * until the next/real request comes in or the keepalive timeout expires.
402 (void)ap_check_pipeline(c, bb, DEFAULT_LIMIT_BLANK_LINES);
404 ap_release_brigade(c, bb);
408 c->cs->state = CONN_STATE_LINGER;
411 /* If we have still data in the output filters here it means that
412 * the last (recent) nonblocking write was EAGAIN, so tell the MPM
413 * to not try another useless/stressful one but to go straight to
416 c->cs->state = CONN_STATE_WRITE_COMPLETION;
419 AP_PROCESS_REQUEST_RETURN((uintptr_t)r, r->uri, r->status);
420 if (ap_extended_status) {
421 ap_time_process_request(c->sbh, STOP_PREQUEST);
425 void ap_process_async_request(request_rec *r)
427 conn_rec *c = r->connection;
430 /* Give quick handlers a shot at serving the request on the fast
431 * path, bypassing all of the other Apache hooks.
433 * This hook was added to enable serving files out of a URI keyed
434 * content cache ( e.g., Mike Abbott's Quick Shortcut Cache,
435 * described here: http://oss.sgi.com/projects/apache/mod_qsc.html )
437 * It may have other uses as well, such as routing requests directly to
438 * content handlers that have the ability to grok HTTP and do their
439 * own access checking, etc (e.g. servlet engines).
441 * Use this hook with extreme care and only if you know what you are
444 AP_PROCESS_REQUEST_ENTRY((uintptr_t)r, r->uri);
445 if (ap_extended_status) {
446 ap_time_process_request(r->connection->sbh, START_PREQUEST);
449 if (APLOGrtrace4(r)) {
451 const apr_array_header_t *t_h = apr_table_elts(r->headers_in);
452 const apr_table_entry_t *t_elt = (apr_table_entry_t *)t_h->elts;
453 ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r,
454 "Headers received from client:");
455 for (i = 0; i < t_h->nelts; i++, t_elt++) {
456 ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r, " %s: %s",
457 ap_escape_logitem(r->pool, t_elt->key),
458 ap_escape_logitem(r->pool, t_elt->val));
463 apr_thread_mutex_create(&r->invoke_mtx, APR_THREAD_MUTEX_DEFAULT, r->pool);
464 apr_thread_mutex_lock(r->invoke_mtx);
466 access_status = ap_run_quick_handler(r, 0); /* Not a look-up request */
467 if (access_status == DECLINED) {
468 access_status = ap_process_request_internal(r);
469 if (access_status == OK) {
470 access_status = ap_invoke_handler(r);
474 if (access_status == SUSPENDED) {
475 /* TODO: Should move these steps into a generic function, so modules
476 * working on a suspended request can also call _ENTRY again.
478 AP_PROCESS_REQUEST_RETURN((uintptr_t)r, r->uri, access_status);
479 if (ap_extended_status) {
480 ap_time_process_request(c->sbh, STOP_PREQUEST);
483 c->cs->state = CONN_STATE_SUSPENDED;
485 apr_thread_mutex_unlock(r->invoke_mtx);
490 apr_thread_mutex_unlock(r->invoke_mtx);
493 ap_die_r(access_status, r, HTTP_OK);
495 ap_process_request_after_handler(r);
498 AP_DECLARE(void) ap_process_request(request_rec *r)
500 apr_bucket_brigade *bb;
502 conn_rec *c = r->connection;
505 ap_process_async_request(r);
507 if (ap_run_input_pending(c) != OK) {
508 bb = ap_acquire_brigade(c);
509 b = apr_bucket_flush_create(c->bucket_alloc);
510 APR_BRIGADE_INSERT_HEAD(bb, b);
511 rv = ap_pass_brigade(c->output_filters, bb);
512 if (APR_STATUS_IS_TIMEUP(rv)) {
514 * Notice a timeout as an error message. This might be
515 * valuable for detecting clients with broken network
516 * connections or possible DoS attacks.
518 ap_log_cerror(APLOG_MARK, APLOG_INFO, rv, c, APLOGNO(01581)
519 "flushing data to the client");
521 ap_release_brigade(c, bb);
523 if (ap_extended_status) {
524 ap_time_process_request(c->sbh, STOP_PREQUEST);
528 static apr_table_t *rename_original_env(apr_pool_t *p, apr_table_t *t)
530 const apr_array_header_t *env_arr = apr_table_elts(t);
531 const apr_table_entry_t *elts = (const apr_table_entry_t *) env_arr->elts;
532 apr_table_t *new = apr_table_make(p, env_arr->nalloc);
535 for (i = 0; i < env_arr->nelts; ++i) {
538 apr_table_setn(new, apr_pstrcat(p, "REDIRECT_", elts[i].key, NULL),
545 static request_rec *internal_internal_redirect(const char *new_uri,
549 const char *vary_header;
551 if (ap_is_recursion_limit_exceeded(r)) {
552 ap_die(HTTP_INTERNAL_SERVER_ERROR, r);
556 new = (request_rec *) apr_pcalloc(r->pool, sizeof(request_rec));
558 new->connection = r->connection;
559 new->server = r->server;
563 * A whole lot of this really ought to be shared with http_protocol.c...
564 * another missing cleanup. It's particularly inappropriate to be
565 * setting header_only, etc., here.
568 new->method = r->method;
569 new->method_number = r->method_number;
570 new->allowed_methods = ap_make_method_list(new->pool, 2);
571 ap_parse_uri(new, new_uri);
572 new->parsed_uri.port_str = r->parsed_uri.port_str;
573 new->parsed_uri.port = r->parsed_uri.port;
575 new->request_config = ap_create_request_config(r->pool);
577 new->per_dir_config = r->server->lookup_defaults;
582 new->useragent_addr = r->useragent_addr;
583 new->useragent_ip = r->useragent_ip;
585 /* Must have prev and next pointers set before calling create_request
588 ap_run_create_request(new);
590 /* Inherit the rest of the protocol info... */
592 new->the_request = r->the_request;
594 new->allowed = r->allowed;
596 new->status = r->status;
597 new->assbackwards = r->assbackwards;
598 new->header_only = r->header_only;
599 new->protocol = r->protocol;
600 new->proto_num = r->proto_num;
601 new->hostname = r->hostname;
602 new->request_time = r->request_time;
605 new->headers_in = r->headers_in;
606 new->trailers_in = r->trailers_in;
607 new->headers_out = apr_table_make(r->pool, 12);
608 if (ap_is_HTTP_REDIRECT(new->status)) {
609 const char *location = apr_table_get(r->headers_out, "Location");
611 apr_table_setn(new->headers_out, "Location", location);
614 /* A module (like mod_rewrite) can force an internal redirect
615 * to carry over the Vary header (if present).
617 if (apr_table_get(r->notes, "redirect-keeps-vary")) {
618 if((vary_header = apr_table_get(r->headers_out, "Vary"))) {
619 apr_table_setn(new->headers_out, "Vary", vary_header);
623 new->err_headers_out = r->err_headers_out;
624 new->trailers_out = apr_table_make(r->pool, 5);
625 new->subprocess_env = rename_original_env(r->pool, r->subprocess_env);
626 new->notes = apr_table_make(r->pool, 5);
628 new->htaccess = r->htaccess;
629 new->no_cache = r->no_cache;
630 new->expecting_100 = r->expecting_100;
631 new->no_local_copy = r->no_local_copy;
632 new->read_length = r->read_length; /* We can only read it once */
633 new->vlist_validator = r->vlist_validator;
635 new->proto_output_filters = r->proto_output_filters;
636 new->proto_input_filters = r->proto_input_filters;
638 new->input_filters = new->proto_input_filters;
641 ap_filter_t *f, *nextf;
643 /* If this is a subrequest, the filter chain may contain a
644 * mixture of filters specific to the old request (r), and
645 * some inherited from r->main. Here, inherit that filter
646 * chain, and remove all those which are specific to the old
647 * request; ensuring the subreq filter is left in place. */
648 new->output_filters = r->output_filters;
650 f = new->output_filters;
654 if (f->r == r && f->frec != ap_subreq_core_filter_handle) {
655 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01582)
656 "dropping filter '%s' in internal redirect from %s to %s",
657 f->frec->name, r->unparsed_uri, new_uri);
659 /* To remove the filter, first set f->r to the *new*
660 * request_rec, so that ->output_filters on 'new' is
661 * changed (if necessary) when removing the filter. */
663 ap_remove_output_filter(f);
668 /* Stop at the protocol filters. If a protocol filter has
669 * been newly installed for this resource, better leave it
670 * in place, though it's probably a misconfiguration or
671 * filter bug to get into this state. */
672 } while (f && f != new->proto_output_filters);
675 /* If this is not a subrequest, clear out all
676 * resource-specific filters. */
677 new->output_filters = new->proto_output_filters;
680 update_r_in_filters(new->input_filters, r, new);
681 update_r_in_filters(new->output_filters, r, new);
683 apr_table_setn(new->subprocess_env, "REDIRECT_STATUS",
684 apr_itoa(r->pool, r->status));
686 /* Begin by presuming any module can make its own path_info assumptions,
687 * until some module interjects and changes the value.
689 new->used_path_info = AP_REQ_DEFAULT_PATH_INFO;
692 new->invoke_mtx = r->invoke_mtx;
696 * XXX: hmm. This is because mod_setenvif and mod_unique_id really need
697 * to do their thing on internal redirects as well. Perhaps this is a
700 if ((access_status = ap_run_post_read_request(new))) {
701 ap_die(access_status, new);
708 /* XXX: Is this function is so bogus and fragile that we deep-6 it? */
709 AP_DECLARE(void) ap_internal_fast_redirect(request_rec *rr, request_rec *r)
711 /* We need to tell POOL_DEBUG that we're guaranteeing that rr->pool
712 * will exist as long as r->pool. Otherwise we run into troubles because
713 * some values in this request will be allocated in r->pool, and others in
716 apr_pool_join(r->pool, rr->pool);
717 r->proxyreq = rr->proxyreq;
718 r->no_cache = (r->no_cache && rr->no_cache);
719 r->no_local_copy = (r->no_local_copy && rr->no_local_copy);
720 r->mtime = rr->mtime;
722 r->filename = rr->filename;
723 r->canonical_filename = rr->canonical_filename;
724 r->path_info = rr->path_info;
726 r->finfo = rr->finfo;
727 r->handler = rr->handler;
728 ap_set_content_type(r, rr->content_type);
729 r->content_encoding = rr->content_encoding;
730 r->content_languages = rr->content_languages;
731 r->per_dir_config = rr->per_dir_config;
732 /* copy output headers from subrequest, but leave negotiation headers */
733 r->notes = apr_table_overlay(r->pool, rr->notes, r->notes);
734 r->headers_out = apr_table_overlay(r->pool, rr->headers_out,
736 r->err_headers_out = apr_table_overlay(r->pool, rr->err_headers_out,
738 r->trailers_out = apr_table_overlay(r->pool, rr->trailers_out,
740 r->subprocess_env = apr_table_overlay(r->pool, rr->subprocess_env,
743 r->output_filters = rr->output_filters;
744 r->input_filters = rr->input_filters;
746 /* If any filters pointed at the now-defunct rr, we must point them
747 * at our "new" instance of r. In particular, some of rr's structures
748 * will now be bogus (say rr->headers_out). If a filter tried to modify
749 * their f->r structure when it is pointing to rr, the real request_rec
750 * will not get updated. Fix that here.
752 update_r_in_filters(r->input_filters, rr, r);
753 update_r_in_filters(r->output_filters, rr, r);
756 ap_filter_t *next = r->output_filters;
757 while (next && (next != r->proto_output_filters)) {
758 if (next->frec == ap_subreq_core_filter_handle) {
763 if (!next || next == r->proto_output_filters) {
764 ap_add_output_filter_handle(ap_subreq_core_filter_handle,
765 NULL, r, r->connection);
770 * We need to check if we now have the SUBREQ_CORE filter in our filter
771 * chain. If this is the case we need to remove it since we are NO
772 * subrequest. But we need to keep in mind that the SUBREQ_CORE filter
773 * does not necessarily need to be the first filter in our chain. So we
774 * need to go through the chain. But we only need to walk up the chain
775 * until the proto_output_filters as the SUBREQ_CORE filter is below the
780 next = r->output_filters;
781 while (next && (next->frec != ap_subreq_core_filter_handle)
782 && (next != r->proto_output_filters)) {
785 if (next && (next->frec == ap_subreq_core_filter_handle)) {
786 ap_remove_output_filter(next);
791 AP_DECLARE(void) ap_internal_redirect(const char *new_uri, request_rec *r)
794 request_rec *new = internal_internal_redirect(new_uri, r);
796 AP_INTERNAL_REDIRECT(r->uri, new_uri);
798 /* ap_die was already called, if an error occurred */
803 access_status = ap_run_quick_handler(new, 0); /* Not a look-up request */
804 if (access_status == DECLINED) {
805 access_status = ap_process_request_internal(new);
806 if (access_status == OK) {
807 access_status = ap_invoke_handler(new);
810 ap_die(access_status, new);
813 /* This function is designed for things like actions or CGI scripts, when
814 * using AddHandler, and you want to preserve the content type across
815 * an internal redirect.
817 AP_DECLARE(void) ap_internal_redirect_handler(const char *new_uri, request_rec *r)
820 request_rec *new = internal_internal_redirect(new_uri, r);
822 /* ap_die was already called, if an error occurred */
828 ap_set_content_type(new, r->content_type);
829 access_status = ap_process_request_internal(new);
830 if (access_status == OK) {
831 access_status = ap_invoke_handler(new);
833 ap_die(access_status, new);
836 AP_DECLARE(void) ap_allow_methods(request_rec *r, int reset, ...)
842 * Get rid of any current settings if requested; not just the
843 * well-known methods but any extensions as well.
846 ap_clear_method_list(r->allowed_methods);
849 va_start(methods, reset);
850 while ((method = va_arg(methods, const char *)) != NULL) {
851 ap_method_list_add(r->allowed_methods, method);
856 AP_DECLARE(void) ap_allow_standard_methods(request_rec *r, int reset, ...)
863 * Get rid of any current settings if requested; not just the
864 * well-known methods but any extensions as well.
867 ap_clear_method_list(r->allowed_methods);
871 va_start(methods, reset);
872 while ((method = va_arg(methods, int)) != -1) {
873 mask |= (AP_METHOD_BIT << method);
877 r->allowed_methods->method_mask |= mask;