Apache HTTPD
http_request.c
Go to the documentation of this file.
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17/*
18 * http_request.c: functions to get and process requests
19 *
20 * Rob McCool 3/21/93
21 *
22 * Thoroughly revamped by rst for Apache. NB this file reads
23 * best from the bottom up.
24 *
25 */
26
27#include "apr_strings.h"
28#include "apr_file_io.h"
29#include "apr_fnmatch.h"
30
31#define APR_WANT_STRFUNC
32#include "apr_want.h"
33
34#include "ap_config.h"
35#include "httpd.h"
36#include "http_config.h"
37#include "http_request.h"
38#include "http_core.h"
39#include "http_protocol.h"
40#include "http_log.h"
41#include "http_main.h"
42#include "util_filter.h"
43#include "util_charset.h"
44#include "scoreboard.h"
45
46#include "mod_core.h"
47
48#if APR_HAVE_STDARG_H
49#include <stdarg.h>
50#endif
51
53
54/*****************************************************************
55 *
56 * Mainline request processing...
57 */
58
59/* XXX A cleaner and faster way to do this might be to pass the request_rec
60 * down the filter chain as a parameter. It would need to change for
61 * subrequest vs. main request filters; perhaps the subrequest filter could
62 * make the switch.
63 */
65 request_rec *from,
67{
68 while (f) {
69 if (f->r == from) {
70 f->r = to;
71 }
72 f = f->next;
73 }
74}
75
76static void ap_die_r(int type, request_rec *r, int recursive_error)
77{
78 char *custom_response;
80
81 if (type == OK || type == DONE) {
83 return;
84 }
85
87 ap_filter_t *next;
88
89 /*
90 * Check if we still have the ap_http_header_filter in place. If
91 * this is the case we should not ignore the error here because
92 * it means that we have not sent any response at all and never
93 * will. This is bad. Sent an internal server error instead.
94 */
95 next = r->output_filters;
96 while (next && (next->frec != ap_http_header_filter_handle)) {
97 next = next->next;
98 }
99
100 /*
101 * If next != NULL then we left the while above because of
102 * next->frec == ap_http_header_filter
103 */
104 if (next) {
105 if (type != AP_FILTER_ERROR) {
107 "Invalid response status %i", type);
108 }
109 else {
111 "Response from AP_FILTER_ERROR");
112 }
114 }
115 else {
116 return;
117 }
118 }
119
120 /*
121 * The following takes care of Apache redirects to custom response URLs
122 * Note that if we are already dealing with the response to some other
123 * error condition, we just report on the original error, and give up on
124 * any attempt to handle the other thing "intelligently"...
125 */
126 if (recursive_error != HTTP_OK) {
127 while (r_1st_err->prev && (r_1st_err->prev->status != HTTP_OK))
128 r_1st_err = r_1st_err->prev; /* Get back to original error */
129
130 if (r_1st_err != r) {
131 /* The recursive error was caused by an ErrorDocument specifying
132 * an internal redirect to a bad URI. ap_internal_redirect has
133 * changed the filter chains to point to the ErrorDocument's
134 * request_rec. Back out those changes so we can safely use the
135 * original failing request_rec to send the canned error message.
136 *
137 * ap_send_error_response gets rid of existing resource filters
138 * on the output side, so we can skip those.
139 */
140 update_r_in_filters(r_1st_err->proto_output_filters, r, r_1st_err);
141 update_r_in_filters(r_1st_err->input_filters, r, r_1st_err);
142 }
143
144 custom_response = NULL; /* Do NOT retry the custom thing! */
145 }
146 else {
149 recursive_error = 0;
150 }
151
152 r->status = type;
153
154 /*
155 * This test is done here so that none of the auth modules needs to know
156 * about proxy authentication. They treat it like normal auth, and then
157 * we tweak the status.
158 */
161 }
162
163 /* If we don't want to keep the connection, make sure we mark that the
164 * connection is not eligible for keepalive. If we want to keep the
165 * connection, be sure that the request body (if any) has been read.
166 */
169 }
170
171 /*
172 * Two types of custom redirects --- plain text, and URLs. Plain text has
173 * a leading '"', so the URL code, here, is triggered on its absence
174 */
175
176 if (custom_response && custom_response[0] != '"') {
177
179 /*
180 * The URL isn't local, so lets drop through the rest of this
181 * apache code, and continue with the usual REDIRECT handler.
182 * But note that the client will ultimately see the wrong
183 * status...
184 */
187 }
188 else if (custom_response[0] == '/') {
189 const char *error_notes, *original_method;
191 r->no_local_copy = 1; /* Do NOT send HTTP_NOT_MODIFIED for
192 * error documents! */
193 /*
194 * This redirect needs to be a GET no matter what the original
195 * method was.
196 */
197 apr_table_setn(r->subprocess_env, "REQUEST_METHOD", r->method);
198
199 /*
200 * Provide a special method for modules to communicate
201 * more informative (than the plain canned) messages to us.
202 * Propagate them to ErrorDocuments via the ERROR_NOTES variable:
203 */
205 "error-notes")) != NULL) {
206 apr_table_setn(r->subprocess_env, "ERROR_NOTES", error_notes);
207 }
210 r->method = "GET";
213 /* preserve ability to see %<m in the access log */
216 return;
217 }
218 else {
219 /*
220 * Dumb user has given us a bad url to redirect to --- fake up
221 * dying with a recursive server error...
222 */
225 "Invalid error redirection directive: %s",
227 }
228 }
230}
231
233{
234 ap_die_r(type, r, r->status);
235}
236
238 unsigned int max_blank_lines)
239{
242 unsigned int num_blank_lines = 0;
243 apr_size_t cr = 0;
244 char buf[2];
245
246 while (c->keepalive != AP_CONN_CLOSE && !c->aborted) {
247 apr_size_t len = cr + 1;
248
250 rv = ap_get_brigade(c->input_filters, bb, mode,
252 if (rv != APR_SUCCESS || APR_BRIGADE_EMPTY(bb)) {
253 if (mode == AP_MODE_READBYTES) {
254 /* Unexpected error, stop with this connection */
256 "Can't consume pipelined empty lines");
257 c->keepalive = AP_CONN_CLOSE;
258 rv = APR_EGENERAL;
259 }
260 else if (rv != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(rv)) {
261 /* Pipe is dead */
262 c->keepalive = AP_CONN_CLOSE;
263 }
264 else {
265 /* Pipe is up and empty */
266 rv = APR_EAGAIN;
267 }
268 break;
269 }
270 if (!max_blank_lines) {
271 apr_off_t n = 0;
272 /* Single read asked, (non-meta-)data available? */
273 rv = apr_brigade_length(bb, 0, &n);
274 if (rv == APR_SUCCESS && n <= 0) {
275 rv = APR_EAGAIN;
276 }
277 break;
278 }
279
280 /* Lookup and consume blank lines */
281 rv = apr_brigade_flatten(bb, buf, &len);
282 if (rv != APR_SUCCESS || len != cr + 1) {
283 int log_level;
284 if (mode == AP_MODE_READBYTES) {
285 /* Unexpected error, stop with this connection */
286 c->keepalive = AP_CONN_CLOSE;
288 rv = APR_EGENERAL;
289 }
290 else {
291 /* Let outside (non-speculative/blocking) read determine
292 * where this possible failure comes from (metadata,
293 * morphed EOF socket, ...). Debug only here.
294 */
296 rv = APR_SUCCESS;
297 }
299 "Can't check pipelined data");
300 break;
301 }
302
303 if (mode == AP_MODE_READBYTES) {
304 /* [CR]LF consumed, try next */
306 cr = 0;
307 }
308 else if (cr) {
309 AP_DEBUG_ASSERT(len == 2 && buf[0] == APR_ASCII_CR);
310 if (buf[1] == APR_ASCII_LF) {
311 /* consume this CRLF */
314 }
315 else {
316 /* CR(?!LF) is data */
317 break;
318 }
319 }
320 else {
321 if (buf[0] == APR_ASCII_LF) {
322 /* consume this LF */
325 }
326 else if (buf[0] == APR_ASCII_CR) {
327 cr = 1;
328 }
329 else {
330 /* Not [CR]LF, some data */
331 break;
332 }
333 }
335 /* Enough blank lines with this connection,
336 * stop and don't recycle it.
337 */
338 c->keepalive = AP_CONN_CLOSE;
339 rv = APR_NOTFOUND;
340 break;
341 }
342 }
343
344 return rv;
345}
346
347#define RETRIEVE_BRIGADE_FROM_POOL(bb, key, pool, allocator) do { \
348 apr_pool_userdata_get((void **)&bb, key, pool); \
349 if (bb == NULL) { \
350 bb = apr_brigade_create(pool, allocator); \
351 apr_pool_userdata_setn((const void *)bb, key, NULL, pool); \
352 } \
353 else { \
354 apr_brigade_cleanup(bb); \
355 } \
356} while(0)
357
359{
361 apr_bucket *b;
363 apr_status_t rv;
364
365 /* Send an EOR bucket through the output filter chain. When
366 * this bucket is destroyed, the request will be logged and
367 * its pool will be freed
368 */
369 RETRIEVE_BRIGADE_FROM_POOL(bb, "ap_process_request_after_handler_brigade",
370 c->pool, c->bucket_alloc);
371 b = ap_bucket_eor_create(c->bucket_alloc, r);
373
374 ap_pass_brigade(c->output_filters, bb);
375
376 /* The EOR bucket has either been handled by an output filter (eg.
377 * deleted or moved to a buffered_bb => no more in bb), or an error
378 * occured before that (eg. c->aborted => still in bb) and we ought
379 * to destroy it now. So cleanup any remaining bucket along with
380 * the orphan request (if any).
381 */
383
384 /* From here onward, it is no longer safe to reference r
385 * or r->pool, because r->pool may have been destroyed
386 * already by the EOR bucket's cleanup function.
387 */
388
389 /* Check pipeline consuming blank lines, they must not be interpreted as
390 * the next pipelined request, otherwise we would block on the next read
391 * without flushing data, and hence possibly delay pending response(s)
392 * until the next/real request comes in or the keepalive timeout expires.
393 */
395 c->data_in_input_filters = (rv == APR_SUCCESS);
397
398 if (c->cs)
399 c->cs->state = (c->aborted) ? CONN_STATE_LINGER
402 if (ap_extended_status) {
404 }
405}
406
408{
410 int access_status;
411
412 /* Give quick handlers a shot at serving the request on the fast
413 * path, bypassing all of the other Apache hooks.
414 *
415 * This hook was added to enable serving files out of a URI keyed
416 * content cache ( e.g., Mike Abbott's Quick Shortcut Cache,
417 * described here: http://oss.sgi.com/projects/apache/mod_qsc.html )
418 *
419 * It may have other uses as well, such as routing requests directly to
420 * content handlers that have the ability to grok HTTP and do their
421 * own access checking, etc (e.g. servlet engines).
422 *
423 * Use this hook with extreme care and only if you know what you are
424 * doing.
425 */
427 if (ap_extended_status) {
429 }
430
431 if (APLOGrtrace4(r)) {
432 int i;
436 "Headers received from client:");
437 for (i = 0; i < t_h->nelts; i++, t_elt++) {
438 ap_log_rerror(APLOG_MARK, APLOG_TRACE4, 0, r, " %s: %s",
440 ap_escape_logitem(r->pool, t_elt->val));
441 }
442 }
443
444#if APR_HAS_THREADS
447#endif
448 access_status = ap_run_quick_handler(r, 0); /* Not a look-up request */
449 if (access_status == DECLINED) {
451 if (access_status == OK) {
453 }
454 }
455
456 if (access_status == SUSPENDED) {
457 /* TODO: Should move these steps into a generic function, so modules
458 * working on a suspended request can also call _ENTRY again.
459 */
461 if (ap_extended_status) {
463 }
464 if (c->cs)
465 c->cs->state = CONN_STATE_SUSPENDED;
466#if APR_HAS_THREADS
468#endif
469 return;
470 }
471#if APR_HAS_THREADS
473#endif
474
476
478}
479
481{
483 apr_bucket *b;
485 apr_status_t rv;
486
488
489 if (!c->data_in_input_filters) {
490 RETRIEVE_BRIGADE_FROM_POOL(bb, "ap_process_request_brigade",
491 c->pool, c->bucket_alloc);
492 b = apr_bucket_flush_create(c->bucket_alloc);
494 rv = ap_pass_brigade(c->output_filters, bb);
495 if (APR_STATUS_IS_TIMEUP(rv)) {
496 /*
497 * Notice a timeout as an error message. This might be
498 * valuable for detecting clients with broken network
499 * connections or possible DoS attacks.
500 */
502 "flushing data to the client");
503 }
505 }
506 if (ap_extended_status) {
508 }
509}
510
512{
514 const apr_table_entry_t *elts = (const apr_table_entry_t *) env_arr->elts;
515 apr_table_t *new = apr_table_make(p, env_arr->nalloc);
516 int i;
517
518 for (i = 0; i < env_arr->nelts; ++i) {
519 if (!elts[i].key)
520 continue;
521 apr_table_setn(new, apr_pstrcat(p, "REDIRECT_", elts[i].key, NULL),
522 elts[i].val);
523 }
524
525 return new;
526}
527
529 request_rec *r) {
530 int access_status;
531 request_rec *new;
532 const char *vary_header;
533
536 return NULL;
537 }
538
539 new = (request_rec *) apr_pcalloc(r->pool, sizeof(request_rec));
540
541 new->connection = r->connection;
542 new->server = r->server;
543 new->pool = r->pool;
544
545 /*
546 * A whole lot of this really ought to be shared with http_protocol.c...
547 * another missing cleanup. It's particularly inappropriate to be
548 * setting header_only, etc., here.
549 */
550
551 new->method = r->method;
552 new->method_number = r->method_number;
553 new->allowed_methods = ap_make_method_list(new->pool, 2);
554 ap_parse_uri(new, new_uri);
555 new->parsed_uri.port_str = r->parsed_uri.port_str;
556 new->parsed_uri.port = r->parsed_uri.port;
557
558 new->request_config = ap_create_request_config(r->pool);
559
560 new->per_dir_config = r->server->lookup_defaults;
561
562 new->prev = r;
563 r->next = new;
564
566 new->useragent_ip = r->useragent_ip;
567
568 /* Must have prev and next pointers set before calling create_request
569 * hook.
570 */
572
573 /* Inherit the rest of the protocol info... */
574
575 new->the_request = r->the_request;
576
577 new->allowed = r->allowed;
578
579 new->status = r->status;
580 new->assbackwards = r->assbackwards;
581 new->header_only = r->header_only;
582 new->protocol = r->protocol;
583 new->proto_num = r->proto_num;
584 new->hostname = r->hostname;
585 new->request_time = r->request_time;
586 new->main = r->main;
587
588 new->headers_in = r->headers_in;
589 new->trailers_in = r->trailers_in;
590 new->headers_out = apr_table_make(r->pool, 12);
591 if (ap_is_HTTP_REDIRECT(new->status)) {
592 const char *location = apr_table_get(r->headers_out, "Location");
593 if (location)
594 apr_table_setn(new->headers_out, "Location", location);
595 }
596
597 /* A module (like mod_rewrite) can force an internal redirect
598 * to carry over the Vary header (if present).
599 */
600 if (apr_table_get(r->notes, "redirect-keeps-vary")) {
601 if((vary_header = apr_table_get(r->headers_out, "Vary"))) {
602 apr_table_setn(new->headers_out, "Vary", vary_header);
603 }
604 }
605
606 new->err_headers_out = r->err_headers_out;
607 new->trailers_out = apr_table_make(r->pool, 5);
608 new->subprocess_env = rename_original_env(r->pool, r->subprocess_env);
609 new->notes = apr_table_make(r->pool, 5);
610
611 new->htaccess = r->htaccess;
612 new->no_cache = r->no_cache;
613 new->expecting_100 = r->expecting_100;
614 new->no_local_copy = r->no_local_copy;
615 new->read_length = r->read_length; /* We can only read it once */
616 new->vlist_validator = r->vlist_validator;
617
618 new->proto_output_filters = r->proto_output_filters;
619 new->proto_input_filters = r->proto_input_filters;
620
621 new->input_filters = new->proto_input_filters;
622
623 if (new->main) {
625
626 /* If this is a subrequest, the filter chain may contain a
627 * mixture of filters specific to the old request (r), and
628 * some inherited from r->main. Here, inherit that filter
629 * chain, and remove all those which are specific to the old
630 * request; ensuring the subreq filter is left in place. */
631 new->output_filters = r->output_filters;
632
633 f = new->output_filters;
634 do {
635 nextf = f->next;
636
637 if (f->r == r && f->frec != ap_subreq_core_filter_handle) {
639 "dropping filter '%s' in internal redirect from %s to %s",
640 f->frec->name, r->unparsed_uri, new_uri);
641
642 /* To remove the filter, first set f->r to the *new*
643 * request_rec, so that ->output_filters on 'new' is
644 * changed (if necessary) when removing the filter. */
645 f->r = new;
647 }
648
649 f = nextf;
650
651 /* Stop at the protocol filters. If a protocol filter has
652 * been newly installed for this resource, better leave it
653 * in place, though it's probably a misconfiguration or
654 * filter bug to get into this state. */
655 } while (f && f != new->proto_output_filters);
656 }
657 else {
658 /* If this is not a subrequest, clear out all
659 * resource-specific filters. */
660 new->output_filters = new->proto_output_filters;
661 }
662
663 update_r_in_filters(new->input_filters, r, new);
664 update_r_in_filters(new->output_filters, r, new);
665
666 apr_table_setn(new->subprocess_env, "REDIRECT_STATUS",
667 apr_itoa(r->pool, r->status));
668
669 /* Begin by presuming any module can make its own path_info assumptions,
670 * until some module interjects and changes the value.
671 */
672 new->used_path_info = AP_REQ_DEFAULT_PATH_INFO;
673
674#if APR_HAS_THREADS
675 new->invoke_mtx = r->invoke_mtx;
676#endif
677
678 /*
679 * XXX: hmm. This is because mod_setenvif and mod_unique_id really need
680 * to do their thing on internal redirects as well. Perhaps this is a
681 * misnamed function.
682 */
683 if ((access_status = ap_post_read_request(new))) {
684 ap_die(access_status, new);
685 return NULL;
686 }
687
688 return new;
689}
690
691/* XXX: Is this function is so bogus and fragile that we deep-6 it? */
693{
694 /* We need to tell POOL_DEBUG that we're guaranteeing that rr->pool
695 * will exist as long as r->pool. Otherwise we run into troubles because
696 * some values in this request will be allocated in r->pool, and others in
697 * rr->pool.
698 */
699 apr_pool_join(r->pool, rr->pool);
700 r->proxyreq = rr->proxyreq;
701 r->no_cache = (r->no_cache && rr->no_cache);
702 r->no_local_copy = (r->no_local_copy && rr->no_local_copy);
703 r->mtime = rr->mtime;
704 r->uri = rr->uri;
705 r->filename = rr->filename;
706 r->canonical_filename = rr->canonical_filename;
707 r->path_info = rr->path_info;
708 r->args = rr->args;
709 r->finfo = rr->finfo;
710 r->handler = rr->handler;
712 r->content_encoding = rr->content_encoding;
713 r->content_languages = rr->content_languages;
714 r->per_dir_config = rr->per_dir_config;
715 /* copy output headers from subrequest, but leave negotiation headers */
716 r->notes = apr_table_overlay(r->pool, rr->notes, r->notes);
717 r->headers_out = apr_table_overlay(r->pool, rr->headers_out,
718 r->headers_out);
719 r->err_headers_out = apr_table_overlay(r->pool, rr->err_headers_out,
721 r->trailers_out = apr_table_overlay(r->pool, rr->trailers_out,
722 r->trailers_out);
723 r->subprocess_env = apr_table_overlay(r->pool, rr->subprocess_env,
725
726 r->output_filters = rr->output_filters;
727 r->input_filters = rr->input_filters;
728
729 /* If any filters pointed at the now-defunct rr, we must point them
730 * at our "new" instance of r. In particular, some of rr's structures
731 * will now be bogus (say rr->headers_out). If a filter tried to modify
732 * their f->r structure when it is pointing to rr, the real request_rec
733 * will not get updated. Fix that here.
734 */
737
738 if (r->main) {
740 while (next && (next != r->proto_output_filters)) {
741 if (next->frec == ap_subreq_core_filter_handle) {
742 break;
743 }
744 next = next->next;
745 }
746 if (!next || next == r->proto_output_filters) {
748 NULL, r, r->connection);
749 }
750 }
751 else {
752 /*
753 * We need to check if we now have the SUBREQ_CORE filter in our filter
754 * chain. If this is the case we need to remove it since we are NO
755 * subrequest. But we need to keep in mind that the SUBREQ_CORE filter
756 * does not necessarily need to be the first filter in our chain. So we
757 * need to go through the chain. But we only need to walk up the chain
758 * until the proto_output_filters as the SUBREQ_CORE filter is below the
759 * protocol filters.
760 */
761 ap_filter_t *next;
762
763 next = r->output_filters;
764 while (next && (next->frec != ap_subreq_core_filter_handle)
765 && (next != r->proto_output_filters)) {
766 next = next->next;
767 }
768 if (next && (next->frec == ap_subreq_core_filter_handle)) {
770 }
771 }
772}
773
775{
776 int access_status;
778
780
781 /* ap_die was already called, if an error occured */
782 if (!new) {
783 return;
784 }
785
786 access_status = ap_run_quick_handler(new, 0); /* Not a look-up request */
787 if (access_status == DECLINED) {
789 if (access_status == OK) {
791 }
792 }
793 ap_die(access_status, new);
794}
795
796/* This function is designed for things like actions or CGI scripts, when
797 * using AddHandler, and you want to preserve the content type across
798 * an internal redirect.
799 */
801{
802 int access_status;
804
805 /* ap_die was already called, if an error occured */
806 if (!new) {
807 return;
808 }
809
810 if (r->handler)
813 if (access_status == OK) {
815 }
816 ap_die(access_status, new);
817}
818
820{
821 const char *method;
823
824 /*
825 * Get rid of any current settings if requested; not just the
826 * well-known methods but any extensions as well.
827 */
828 if (reset) {
830 }
831
833 while ((method = va_arg(methods, const char *)) != NULL) {
835 }
837}
838
840{
841 int method;
844
845 /*
846 * Get rid of any current settings if requested; not just the
847 * well-known methods but any extensions as well.
848 */
849 if (reset) {
851 }
852
853 mask = 0;
855 while ((method = va_arg(methods, int)) != -1) {
856 mask |= (AP_METHOD_BIT << method);
857 }
859
861}
Symbol export macros and hook functions.
#define AP_DECLARE(type)
Definition ap_config.h:67
int n
Definition ap_regex.h:278
const char apr_size_t len
Definition ap_regex.h:187
#define AP_PROCESS_REQUEST_ENTRY(arg0, arg1)
#define AP_PROCESS_REQUEST_RETURN(arg0, arg1, arg2)
#define AP_INTERNAL_REDIRECT(arg0, arg1)
APR File I/O Handling.
APR FNMatch Functions.
APR Strings library.
APR Standard Headers Support.
int ap_invoke_handler(request_rec *r)
Definition config.c:389
int ap_run_quick_handler(request_rec *r, int lookup_uri)
Definition config.c:173
#define APLOG_USE_MODULE(foo)
ap_conf_vector_t * ap_create_request_config(apr_pool_t *p)
Definition config.c:356
request_rec * r
#define DEFAULT_LIMIT_BLANK_LINES
Definition httpd.h:206
#define AP_FILTER_ERROR
Definition httpd.h:473
#define DECLINED
Definition httpd.h:457
#define OK
Definition httpd.h:456
#define DONE
Definition httpd.h:458
#define SUSPENDED
Definition httpd.h:461
apr_status_t ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket)
ap_filter_t * ap_add_output_filter_handle(ap_filter_rec_t *f, void *ctx, request_rec *r, conn_rec *c)
apr_status_t ap_get_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
void ap_remove_output_filter(ap_filter_t *f)
ap_filter_rec_t * ap_subreq_core_filter_handle
Definition core.c:131
int ap_is_recursion_limit_exceeded(const request_rec *r)
Definition core.c:3992
#define APLOGNO(n)
Definition http_log.h:117
#define APLOG_TRACE4
Definition http_log.h:75
#define APLOG_INFO
Definition http_log.h:70
#define ap_log_rerror
Definition http_log.h:454
#define APLOG_ERR
Definition http_log.h:67
#define APLOGrtrace4(r)
Definition http_log.h:249
#define ap_log_cerror
Definition http_log.h:498
#define APLOG_MARK
Definition http_log.h:283
#define APLOG_DEBUG
Definition http_log.h:71
const unsigned char * buf
Definition util_md5.h:50
ap_method_list_t * ap_make_method_list(apr_pool_t *p, int nelts)
void ap_method_list_add(ap_method_list_t *l, const char *method)
void ap_parse_uri(request_rec *r, const char *uri)
Definition protocol.c:580
void ap_send_error_response(request_rec *r, int recursive_error)
void ap_finalize_request_protocol(request_rec *r)
Definition protocol.c:1723
int ap_index_of_response(int status)
int ap_post_read_request(request_rec *r)
Definition protocol.c:1608
void ap_set_content_type_ex(request_rec *r, const char *ct, int trusted)
void ap_clear_method_list(ap_method_list_t *l)
void ap_set_content_type(request_rec *r, const char *ct)
void ap_internal_fast_redirect(request_rec *rr, request_rec *r)
void ap_allow_methods(request_rec *r, int reset,...)
void ap_process_request(request_rec *r)
void ap_internal_redirect_handler(const char *new_uri, request_rec *r)
int ap_process_request_internal(request_rec *r)
Definition request.c:187
apr_bucket * ap_bucket_eor_create(apr_bucket_alloc_t *list, request_rec *r)
Definition eor_bucket.c:68
int ap_run_create_request(request_rec *r)
Definition request.c:98
void ap_process_request_after_handler(request_rec *r)
void ap_allow_standard_methods(request_rec *r, int reset,...)
void ap_die(int type, request_rec *r)
void ap_internal_redirect(const char *new_uri, request_rec *r)
void ap_process_async_request(request_rec *r)
apr_status_t ap_check_pipeline(conn_rec *c, apr_bucket_brigade *bb, unsigned int max_blank_lines)
#define AP_REQUEST_IS_TRUSTED_CT(r)
Definition httpd.h:696
#define APR_EAGAIN
Definition apr_errno.h:730
#define APR_EGENERAL
Definition apr_errno.h:313
#define APR_EOF
Definition apr_errno.h:461
#define APR_NOTFOUND
Definition apr_errno.h:463
#define APR_STATUS_IS_TIMEUP(s)
Definition apr_errno.h:534
#define APR_STATUS_IS_EAGAIN(s)
Definition apr_errno.h:1272
apr_file_t * f
#define APR_BRIGADE_INSERT_HEAD(b, e)
#define APR_BRIGADE_EMPTY(b)
@ APR_NONBLOCK_READ
Definition apr_buckets.h:59
apr_dbd_transaction_t int mode
Definition apr_dbd.h:261
const char * mask
Definition apr_date.h:60
#define HTTP_OK
Definition httpd.h:490
#define ap_is_HTTP_VALID_RESPONSE(x)
Definition httpd.h:560
#define HTTP_PROXY_AUTHENTICATION_REQUIRED
Definition httpd.h:515
#define HTTP_INTERNAL_SERVER_ERROR
Definition httpd.h:535
#define HTTP_MOVED_TEMPORARILY
Definition httpd.h:502
#define ap_is_HTTP_REDIRECT(x)
Definition httpd.h:552
#define HTTP_UNAUTHORIZED
Definition httpd.h:509
#define ap_status_drops_connection(x)
Definition httpd.h:563
char * ap_response_code_string(request_rec *r, int error_index)
Definition core.c:878
ap_filter_rec_t * ap_http_header_filter_handle
Definition http_core.c:39
#define AP_METHOD_BIT
Definition httpd.h:629
#define M_GET
Definition httpd.h:592
#define apr_pool_join(a, b)
Definition apr_pools.h:800
int ap_is_url(const char *u)
Definition util.c:2377
char * ap_escape_logitem(apr_pool_t *p, const char *str)
Definition util.c:2183
#define AP_DEBUG_ASSERT(exp)
Definition httpd.h:2283
#define PROXYREQ_PROXY
Definition httpd.h:1134
@ AP_CONN_CLOSE
Definition httpd.h:1145
@ CONN_STATE_LINGER
Definition httpd.h:1264
@ CONN_STATE_WRITE_COMPLETION
Definition httpd.h:1262
@ CONN_STATE_SUSPENDED
Definition httpd.h:1263
apr_size_t size
apr_uint32_t val
Definition apr_atomic.h:66
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
const char * key
int type
#define APR_ASCII_CR
Definition apr_general.h:61
#define APR_ASCII_LF
Definition apr_general.h:63
apr_vformatter_buff_t * c
Definition apr_lib.h:175
apr_interval_time_t t
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
Definition apr_poll.h:195
apr_pool_t * b
Definition apr_pools.h:529
#define apr_pcalloc(p, size)
Definition apr_pools.h:465
int to
#define AP_REQ_DEFAULT_PATH_INFO
Definition httpd.h:765
Apache Configuration.
CORE HTTP Daemon.
Apache Logging library.
Command line options.
HTTP protocol handling.
static void update_r_in_filters(ap_filter_t *f, request_rec *from, request_rec *to)
#define RETRIEVE_BRIGADE_FROM_POOL(bb, key, pool, allocator)
static request_rec * internal_internal_redirect(const char *new_uri, request_rec *r)
static apr_table_t * rename_original_env(apr_pool_t *p, apr_table_t *t)
static void ap_die_r(int type, request_rec *r, int recursive_error)
Apache Request library.
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
static md_log_level_cb * log_level
Definition md_log.c:50
mod_core private header file
static apr_status_t reset(proxy_balancer *balancer, server_rec *s)
return NULL
Definition mod_so.c:359
int i
Definition mod_so.c:347
Apache scoreboard library.
#define START_PREQUEST
Definition scoreboard.h:249
void ap_time_process_request(ap_sb_handle_t *sbh, int status)
Definition scoreboard.c:632
int ap_extended_status
Definition scoreboard.c:61
#define STOP_PREQUEST
Definition scoreboard.h:250
The representation of a filter chain.
ap_filter_rec_t * frec
ap_filter_t * next
apr_int64_t method_mask
Definition httpd.h:645
Definition apr_tables.h:81
apr_port_t port
Definition apr_uri.h:109
char * port_str
Definition apr_uri.h:97
Structure to store things which are per connection.
Definition httpd.h:1152
ap_conn_keepalive_e keepalive
Definition httpd.h:1223
void * sbh
Definition httpd.h:1199
A structure that represents the current request.
Definition httpd.h:845
apr_array_header_t * content_languages
Definition httpd.h:999
int status
Definition httpd.h:891
char * uri
Definition httpd.h:1016
const char * content_type
Definition httpd.h:992
apr_table_t * trailers_in
Definition httpd.h:1104
struct ap_filter_t * output_filters
Definition httpd.h:1070
char * useragent_ip
Definition httpd.h:1101
int assbackwards
Definition httpd.h:868
int header_only
Definition httpd.h:875
apr_time_t mtime
Definition httpd.h:933
struct ap_filter_t * proto_input_filters
Definition httpd.h:1079
const char * handler
Definition httpd.h:994
apr_table_t * notes
Definition httpd.h:985
unsigned expecting_100
Definition httpd.h:951
const char * hostname
Definition httpd.h:883
const struct htaccess_result * htaccess
Definition httpd.h:1067
char * the_request
Definition httpd.h:866
int method_number
Definition httpd.h:898
apr_pool_t * pool
Definition httpd.h:847
apr_sockaddr_t * useragent_addr
Definition httpd.h:1100
char * filename
Definition httpd.h:1018
apr_time_t request_time
Definition httpd.h:886
apr_uri_t parsed_uri
Definition httpd.h:1092
char * unparsed_uri
Definition httpd.h:1014
int proxyreq
Definition httpd.h:873
conn_rec * connection
Definition httpd.h:849
ap_method_list_t * allowed_methods
Definition httpd.h:926
int no_cache
Definition httpd.h:1082
apr_table_t * err_headers_out
Definition httpd.h:981
struct ap_filter_t * proto_output_filters
Definition httpd.h:1076
apr_finfo_t finfo
Definition httpd.h:1094
int no_local_copy
Definition httpd.h:1084
char * canonical_filename
Definition httpd.h:1022
int proto_num
Definition httpd.h:877
struct ap_filter_t * input_filters
Definition httpd.h:1072
apr_table_t * headers_in
Definition httpd.h:976
char * protocol
Definition httpd.h:879
apr_int64_t allowed
Definition httpd.h:922
apr_off_t read_length
Definition httpd.h:961
request_rec * main
Definition httpd.h:860
apr_table_t * subprocess_env
Definition httpd.h:983
server_rec * server
Definition httpd.h:851
struct ap_conf_vector_t * per_dir_config
Definition httpd.h:1047
char * vlist_validator
Definition httpd.h:1002
apr_thread_mutex_t * invoke_mtx
Definition httpd.h:1089
const char * method
Definition httpd.h:900
char * path_info
Definition httpd.h:1024
request_rec * next
Definition httpd.h:854
char * args
Definition httpd.h:1026
apr_table_t * trailers_out
Definition httpd.h:1106
const char * content_encoding
Definition httpd.h:997
apr_table_t * headers_out
Definition httpd.h:978
struct ap_conf_vector_t * lookup_defaults
Definition httpd.h:1343
charset conversion
Apache filter library.
ap_input_mode_t
input filtering modes
Definition util_filter.h:41
@ AP_MODE_SPECULATIVE
Definition util_filter.h:53
@ AP_MODE_READBYTES
Definition util_filter.h:43