Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
httpd.h
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 
36 #ifndef APACHE_HTTPD_H
37 #define APACHE_HTTPD_H
38 
39 /* XXX - We need to push more stuff to other .h files, or even .c files, to
40  * make this file smaller
41  */
42 
43 /* Headers in which EVERYONE has an interest... */
44 #include "ap_config.h"
45 #include "ap_mmn.h"
46 
47 #include "ap_release.h"
48 
49 #include "apr.h"
50 #include "apr_general.h"
51 #include "apr_tables.h"
52 #include "apr_pools.h"
53 #include "apr_time.h"
54 #include "apr_network_io.h"
55 #include "apr_buckets.h"
56 #include "apr_poll.h"
57 #include "apr_thread_proc.h"
58 #include "apr_hash.h"
59 
60 #include "os.h"
61 
62 #include "ap_regex.h"
63 
64 #if APR_HAVE_STDLIB_H
65 #include <stdlib.h>
66 #endif
67 
68 /* Note: apr_uri.h is also included, see below */
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 /* ----------------------------- config dir ------------------------------ */
75 
79 #ifndef HTTPD_ROOT
80 #ifdef OS2
81 
82 #define HTTPD_ROOT "/os2httpd"
83 #elif defined(WIN32)
84 
85 #define HTTPD_ROOT "/apache"
86 #elif defined (NETWARE)
87 
88 #define HTTPD_ROOT "/apache"
89 #else
90 
91 #define HTTPD_ROOT "/usr/local/apache"
92 #endif
93 #endif /* HTTPD_ROOT */
94 
95 /*
96  * --------- You shouldn't have to edit anything below this line ----------
97  *
98  * Any modifications to any defaults not defined above should be done in the
99  * respective configuration file.
100  *
101  */
102 
107 #ifndef DOCUMENT_LOCATION
108 #ifdef OS2
109 /* Set default for OS/2 file system */
110 #define DOCUMENT_LOCATION HTTPD_ROOT "/docs"
111 #else
112 /* Set default for non OS/2 file system */
113 #define DOCUMENT_LOCATION HTTPD_ROOT "/htdocs"
114 #endif
115 #endif /* DOCUMENT_LOCATION */
116 
118 #ifndef DYNAMIC_MODULE_LIMIT
119 #define DYNAMIC_MODULE_LIMIT 256
120 #endif
121 
123 #define DEFAULT_ADMIN "[no address given]"
124 
126 #ifndef DEFAULT_ERRORLOG
127 #if defined(OS2) || defined(WIN32)
128 #define DEFAULT_ERRORLOG "logs/error.log"
129 #else
130 #define DEFAULT_ERRORLOG "logs/error_log"
131 #endif
132 #endif /* DEFAULT_ERRORLOG */
133 
135 #ifndef DEFAULT_ACCESS_FNAME
136 #ifdef OS2
137 /* Set default for OS/2 file system */
138 #define DEFAULT_ACCESS_FNAME "htaccess"
139 #else
140 #define DEFAULT_ACCESS_FNAME ".htaccess"
141 #endif
142 #endif /* DEFAULT_ACCESS_FNAME */
143 
145 #ifndef SERVER_CONFIG_FILE
146 #define SERVER_CONFIG_FILE "conf/httpd.conf"
147 #endif
148 
150 #ifndef DEFAULT_PATH
151 #define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
152 #endif
153 
155 #ifndef SUEXEC_BIN
156 #define SUEXEC_BIN HTTPD_ROOT "/bin/suexec"
157 #endif
158 
160 #ifndef DEFAULT_TIMEOUT
161 #define DEFAULT_TIMEOUT 60
162 #endif
163 
165 #ifndef DEFAULT_KEEPALIVE_TIMEOUT
166 #define DEFAULT_KEEPALIVE_TIMEOUT 5
167 #endif
168 
170 #ifndef DEFAULT_KEEPALIVE
171 #define DEFAULT_KEEPALIVE 100
172 #endif
173 
174 /*
175  * Limits on the size of various request items. These limits primarily
176  * exist to prevent simple denial-of-service attacks on a server based
177  * on misuse of the protocol. The recommended values will depend on the
178  * nature of the server resources -- CGI scripts and database backends
179  * might require large values, but most servers could get by with much
180  * smaller limits than we use below. The request message body size can
181  * be limited by the per-dir config directive LimitRequestBody.
182  *
183  * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
184  * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
185  * These two limits can be lowered or raised by the server config
186  * directives LimitRequestLine and LimitRequestFieldsize, respectively.
187  *
188  * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
189  * the server config directive LimitRequestFields.
190  */
191 
193 #ifndef DEFAULT_LIMIT_REQUEST_LINE
194 #define DEFAULT_LIMIT_REQUEST_LINE 8190
195 #endif
196 
197 #ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE
198 #define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190
199 #endif
200 
201 #ifndef DEFAULT_LIMIT_REQUEST_FIELDS
202 #define DEFAULT_LIMIT_REQUEST_FIELDS 100
203 #endif
204 
205 #ifndef DEFAULT_LIMIT_BLANK_LINES
206 #define DEFAULT_LIMIT_BLANK_LINES 10
207 #endif
208 
213 #define DEFAULT_ADD_DEFAULT_CHARSET_NAME "iso-8859-1"
214 
216 #define AP_SERVER_PROTOCOL "HTTP/1.1"
217 
218 
219 /* ------------------ stuff that modules are allowed to look at ----------- */
220 
222 #ifndef AP_DEFAULT_INDEX
223 #define AP_DEFAULT_INDEX "index.html"
224 #endif
225 
227 #ifndef AP_TYPES_CONFIG_FILE
228 #define AP_TYPES_CONFIG_FILE "conf/mime.types"
229 #endif
230 
231 /*
232  * Define the HTML doctype strings centrally.
233  */
235 #define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
236  "DTD HTML 2.0//EN\">\n"
237 
238 #define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
239  "DTD HTML 3.2 Final//EN\">\n"
240 
241 #define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
242  "DTD HTML 4.0//EN\"\n" \
243  "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
244 
245 #define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
246  "DTD HTML 4.0 Transitional//EN\"\n" \
247  "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
248 
249 #define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
250  "DTD HTML 4.0 Frameset//EN\"\n" \
251  "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
252 
253 #define DOCTYPE_XHTML_1_0S "<!DOCTYPE html PUBLIC \"-//W3C//" \
254  "DTD XHTML 1.0 Strict//EN\"\n" \
255  "\"http://www.w3.org/TR/xhtml1/DTD/" \
256  "xhtml1-strict.dtd\">\n"
257 
258 #define DOCTYPE_XHTML_1_0T "<!DOCTYPE html PUBLIC \"-//W3C//" \
259  "DTD XHTML 1.0 Transitional//EN\"\n" \
260  "\"http://www.w3.org/TR/xhtml1/DTD/" \
261  "xhtml1-transitional.dtd\">\n"
262 
263 #define DOCTYPE_XHTML_1_0F "<!DOCTYPE html PUBLIC \"-//W3C//" \
264  "DTD XHTML 1.0 Frameset//EN\"\n" \
265  "\"http://www.w3.org/TR/xhtml1/DTD/" \
266  "xhtml1-frameset.dtd\">"
267 
269 #define HTTP_VERSION(major,minor) (1000*(major)+(minor))
270 
271 #define HTTP_VERSION_MAJOR(number) ((number)/1000)
272 
273 #define HTTP_VERSION_MINOR(number) ((number)%1000)
274 
275 /* -------------- Port number for server running standalone --------------- */
276 
278 #define DEFAULT_HTTP_PORT 80
279 
280 #define DEFAULT_HTTPS_PORT 443
281 
287 #define ap_is_default_port(port,r) ((port) == ap_default_port(r))
288 
292 #define ap_default_port(r) ap_run_default_port(r)
293 
297 #define ap_http_scheme(r) ap_run_http_scheme(r)
298 
300 #define MAX_STRING_LEN HUGE_STRING_LEN
301 
303 #define HUGE_STRING_LEN 8192
304 
306 #define AP_IOBUFSIZE 8192
307 
309 #define AP_MAX_REG_MATCH 10
310 
317 #define AP_MAX_SENDFILE 16777216 /* 2^24 */
318 
325 #define APEXIT_OK 0x0
326 
327 #define APEXIT_INIT 0x2
328 
329 #define APEXIT_CHILDINIT 0x3
330 
335 #define APEXIT_CHILDSICK 0x7
336 
341 #define APEXIT_CHILDFATAL 0xf
342 
343 #ifndef AP_DECLARE
344 
349 # define AP_DECLARE(type) type
350 #endif
351 
352 #ifndef AP_DECLARE_NONSTD
353 
360 # define AP_DECLARE_NONSTD(type) type
361 #endif
362 #ifndef AP_DECLARE_DATA
363 # define AP_DECLARE_DATA
364 #endif
365 
366 #ifndef AP_MODULE_DECLARE
367 # define AP_MODULE_DECLARE(type) type
368 #endif
369 #ifndef AP_MODULE_DECLARE_NONSTD
370 # define AP_MODULE_DECLARE_NONSTD(type) type
371 #endif
372 #ifndef AP_MODULE_DECLARE_DATA
373 # define AP_MODULE_DECLARE_DATA
374 #endif
375 
380 #ifndef AP_CORE_DECLARE
381 # define AP_CORE_DECLARE AP_DECLARE
382 #endif
383 
389 #ifndef AP_CORE_DECLARE_NONSTD
390 # define AP_CORE_DECLARE_NONSTD AP_DECLARE_NONSTD
391 #endif
392 
397 #define AP_START_USERERR (APR_OS_START_USERERR + 2000)
398 #define AP_USERERR_LEN 1000
399 
401 #define AP_DECLINED (AP_START_USERERR + 0)
402 
409 typedef struct {
410  int major;
411  int minor;
412  int patch;
413  const char *add_string;
414 } ap_version_t;
415 
423 
430 AP_DECLARE(const char *) ap_get_server_banner(void);
431 
439 AP_DECLARE(const char *) ap_get_server_description(void);
440 
446 AP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
447 
452 AP_DECLARE(const char *) ap_get_server_built(void);
453 
454 /* non-HTTP status codes returned by hooks */
455 
456 #define OK 0
457 #define DECLINED -1
458 #define DONE -2
461 #define SUSPENDED -3
466 #define AP_NOBODY_WROTE -100
467 
469 #define AP_NOBODY_READ -101
470 
473 #define AP_FILTER_ERROR -102
474 
485 #define RESPONSE_CODES 103
486 
487 #define HTTP_CONTINUE 100
488 #define HTTP_SWITCHING_PROTOCOLS 101
489 #define HTTP_PROCESSING 102
490 #define HTTP_OK 200
491 #define HTTP_CREATED 201
492 #define HTTP_ACCEPTED 202
493 #define HTTP_NON_AUTHORITATIVE 203
494 #define HTTP_NO_CONTENT 204
495 #define HTTP_RESET_CONTENT 205
496 #define HTTP_PARTIAL_CONTENT 206
497 #define HTTP_MULTI_STATUS 207
498 #define HTTP_ALREADY_REPORTED 208
499 #define HTTP_IM_USED 226
500 #define HTTP_MULTIPLE_CHOICES 300
501 #define HTTP_MOVED_PERMANENTLY 301
502 #define HTTP_MOVED_TEMPORARILY 302
503 #define HTTP_SEE_OTHER 303
504 #define HTTP_NOT_MODIFIED 304
505 #define HTTP_USE_PROXY 305
506 #define HTTP_TEMPORARY_REDIRECT 307
507 #define HTTP_PERMANENT_REDIRECT 308
508 #define HTTP_BAD_REQUEST 400
509 #define HTTP_UNAUTHORIZED 401
510 #define HTTP_PAYMENT_REQUIRED 402
511 #define HTTP_FORBIDDEN 403
512 #define HTTP_NOT_FOUND 404
513 #define HTTP_METHOD_NOT_ALLOWED 405
514 #define HTTP_NOT_ACCEPTABLE 406
515 #define HTTP_PROXY_AUTHENTICATION_REQUIRED 407
516 #define HTTP_REQUEST_TIME_OUT 408
517 #define HTTP_CONFLICT 409
518 #define HTTP_GONE 410
519 #define HTTP_LENGTH_REQUIRED 411
520 #define HTTP_PRECONDITION_FAILED 412
521 #define HTTP_REQUEST_ENTITY_TOO_LARGE 413
522 #define HTTP_REQUEST_URI_TOO_LARGE 414
523 #define HTTP_UNSUPPORTED_MEDIA_TYPE 415
524 #define HTTP_RANGE_NOT_SATISFIABLE 416
525 #define HTTP_EXPECTATION_FAILED 417
526 #define HTTP_IM_A_TEAPOT 418
527 #define HTTP_MISDIRECTED_REQUEST 421
528 #define HTTP_UNPROCESSABLE_ENTITY 422
529 #define HTTP_LOCKED 423
530 #define HTTP_FAILED_DEPENDENCY 424
531 #define HTTP_TOO_EARLY 425
532 #define HTTP_UPGRADE_REQUIRED 426
533 #define HTTP_PRECONDITION_REQUIRED 428
534 #define HTTP_TOO_MANY_REQUESTS 429
535 #define HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
536 #define HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
537 #define HTTP_INTERNAL_SERVER_ERROR 500
538 #define HTTP_NOT_IMPLEMENTED 501
539 #define HTTP_BAD_GATEWAY 502
540 #define HTTP_SERVICE_UNAVAILABLE 503
541 #define HTTP_GATEWAY_TIME_OUT 504
542 #define HTTP_VERSION_NOT_SUPPORTED 505
543 #define HTTP_VARIANT_ALSO_VARIES 506
544 #define HTTP_INSUFFICIENT_STORAGE 507
545 #define HTTP_LOOP_DETECTED 508
546 #define HTTP_NOT_EXTENDED 510
547 #define HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
550 #define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
551 
552 #define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
554 #define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
556 #define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
558 #define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
560 #define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
562 #define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
565 #define ap_status_drops_connection(x) \
566  (((x) == HTTP_BAD_REQUEST) || \
567  ((x) == HTTP_REQUEST_TIME_OUT) || \
568  ((x) == HTTP_LENGTH_REQUIRED) || \
569  ((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
570  ((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
571  ((x) == HTTP_INTERNAL_SERVER_ERROR) || \
572  ((x) == HTTP_SERVICE_UNAVAILABLE) || \
573  ((x) == HTTP_NOT_IMPLEMENTED))
574 
576 #define AP_STATUS_IS_HEADER_ONLY(x) ((x) == HTTP_NO_CONTENT || \
577  (x) == HTTP_NOT_MODIFIED)
578 
594 #define M_GET 0
595 #define M_PUT 1 /* : */
596 #define M_POST 2
597 #define M_DELETE 3
598 #define M_CONNECT 4
599 #define M_OPTIONS 5
600 #define M_TRACE 6
601 #define M_PATCH 7
602 #define M_PROPFIND 8
603 #define M_PROPPATCH 9 /* : */
604 #define M_MKCOL 10
605 #define M_COPY 11
606 #define M_MOVE 12
607 #define M_LOCK 13
608 #define M_UNLOCK 14
609 #define M_VERSION_CONTROL 15
610 #define M_CHECKOUT 16 /* : */
611 #define M_UNCHECKOUT 17
612 #define M_CHECKIN 18
613 #define M_UPDATE 19
614 #define M_LABEL 20
615 #define M_REPORT 21
616 #define M_MKWORKSPACE 22
617 #define M_MKACTIVITY 23
618 #define M_BASELINE_CONTROL 24
619 #define M_MERGE 25
620 /* Additional methods must be registered by the implementor, we have only
621  * room for 64 bit-wise methods available, so do not squander them (more of
622  * the above methods should probably move here)
623  */
624 /* #define M_BREW nn */
625 /* #define M_WHEN nn */
626 #define M_INVALID 26
634 #define METHODS 64
635 
639 #define AP_METHOD_BIT ((apr_int64_t)1)
640 
644 typedef struct ap_method_list_t ap_method_list_t;
645 
653 struct ap_method_list_t {
658 };
659 
665 #define CGI_MAGIC_TYPE "application/x-httpd-cgi"
666 
667 #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
669 #define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
671 #define DIR_MAGIC_TYPE "httpd/unix-directory"
673 #define AP_DEFAULT_HANDLER_NAME ""
674 #define AP_IS_DEFAULT_HANDLER_NAME(x) (*x == '\0')
675 
677 /* Just in case your linefeed isn't the one the other end is expecting. */
678 #if !APR_CHARSET_EBCDIC
679 
680 #define LF 10
681 
682 #define CR 13
684 #define CRLF "\015\012"
685 #else /* APR_CHARSET_EBCDIC */
686 /* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
687  * in the buff package (bread/bputs/bwrite). Everywhere else, we use
688  * "native EBCDIC" CR and NL characters. These are therefore
689  * defined as
690  * '\r' and '\n'.
691  */
692 #define CR '\r'
693 #define LF '\n'
694 #define CRLF "\r\n"
695 #endif /* APR_CHARSET_EBCDIC */
696 
697 #define CRLF_ASCII "\015\012"
698 #define ZERO_ASCII "\060"
699 
707 #define REQUEST_NO_BODY 0
708 
709 #define REQUEST_CHUNKED_ERROR 1
711 #define REQUEST_CHUNKED_DECHUNK 2
722 #define AP_REQ_ACCEPT_PATH_INFO 0
723 
724 #define AP_REQ_REJECT_PATH_INFO 1
726 #define AP_REQ_DEFAULT_PATH_INFO 2
731 /*
732  * Things which may vary per file-lookup WITHIN a request ---
733  * e.g., state of MIME config. Basically, the name of an object, info
734  * about the object, and any other info we may ahve which may need to
735  * change as we go poking around looking for it (e.g., overridden by
736  * .htaccess files).
737  *
738  * Note how the default state of almost all these things is properly
739  * zero, so that allocating it with pcalloc does the right thing without
740  * a whole lot of hairy initialization... so long as we are willing to
741  * make the (fairly) portable assumption that the bit pattern of a NULL
742  * pointer is, in fact, zero.
743  */
744 
749 struct htaccess_result {
751  const char *dir;
753  int override;
755  int override_opts;
759  struct ap_conf_vector_t *htaccess;
761  const struct htaccess_result *next;
762 };
763 
764 /* The following four types define a hierarchy of activities, so that
765  * given a request_rec r you can write r->connection->server->process
766  * to get to the process_rec. While this reduces substantially the
767  * number of arguments that various hooks require beware that in
768  * threaded versions of the server you must consider multiplexing
769  * issues. */
770 
771 
773 typedef struct process_rec process_rec;
775 typedef struct server_rec server_rec;
777 typedef struct conn_rec conn_rec;
779 typedef struct conn_slave_rec conn_slave_rec;
781 typedef struct request_rec request_rec;
783 typedef struct conn_state_t conn_state_t;
785 /* ### would be nice to not include this from httpd.h ... */
786 /* This comes after we have defined the request_rec type */
787 #include "apr_uri.h"
788 
792 struct process_rec {
794  apr_pool_t *pool;
796  apr_pool_t *pconf;
798  const char *short_name;
800  const char * const *argv;
802  int argc;
803 };
804 
808 struct request_rec {
810  apr_pool_t *pool;
819  request_rec *prev;
823  request_rec *main;
824 
825  /* Info about the request itself... we begin with stuff that only
826  * protocol.c should ever touch...
827  */
829  char *the_request;
831  int assbackwards;
836  int proxyreq;
838  int header_only;
840  int proto_num;
842  const char *protocol;
846  const char *hostname;
847 
850 
852  const char *status_line;
854  int status;
856  /* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
857  * look, but don't touch.
858  */
859 
861  int method_number;
863  const char *method;
898  /* HTTP/1.1 connection-level features */
901  const char *range;
905  int chunked;
910  int read_body;
912  int read_chunked;
914  unsigned expecting_100;
918  /* XXX: ap_body_to_table has been removed. Remove body_table too or
919  * XXX: keep it to reintroduce ap_body_to_table without major bump? */
926  /* MIME header environments, in and out. Also, an array containing
927  * environment variables to be passed to subprocesses, so people can
928  * write modules to add to that environment.
929  *
930  * The difference between headers_out and err_headers_out is that the
931  * latter are printed even on error, and persist across internal redirects
932  * (so the headers printed for ErrorDocument handlers will have them).
933  *
934  * The 'notes' apr_table_t is for notes from one module to another, with no
935  * other set purpose in mind...
936  */
937 
950  /* content_type, handler, content_encoding, and all content_languages
951  * MUST be lowercased strings. They may be pointers to static strings;
952  * they should not be modified in place.
953  */
955  const char *content_type; /* Break these out --- we dispatch on 'em */
957  const char *handler; /* What we *really* dispatch on */
960  const char *content_encoding;
966 
968  char *user;
970  char *ap_auth_type;
972  /* What object is being requested (either directly, or via include
973  * or content-negotiation mapping).
974  */
975 
977  char *unparsed_uri;
979  char *uri;
981  char *filename;
985  char *canonical_filename;
987  char *path_info;
989  char *args;
999  int used_path_info;
1000 
1003 
1004  /* Various other config info which may change with .htaccess files
1005  * These are config vectors, with one void* pointer for each module
1006  * (the thing pointed to being the module's business).
1007  */
1008 
1017  const struct ap_logconf *log;
1018 
1022  const char *log_id;
1023 
1030  const struct htaccess_result *htaccess;
1031 
1035  struct ap_filter_t *input_filters;
1043 
1047  int no_local_copy;
1052 #if APR_HAS_THREADS
1054 #endif
1055 
1066  char *useragent_ip;
1067 
1076  char *useragent_host;
1081  int double_reverse;
1086  int taint;
1087 };
1088 
1099 #define PROXYREQ_NONE 0
1100 #define PROXYREQ_PROXY 1
1101 #define PROXYREQ_REVERSE 2
1102 #define PROXYREQ_RESPONSE 3
1104 /* @} */
1109 typedef enum {
1111  AP_CONN_CLOSE,
1115 /* For struct ap_filter and ap_filter_conn_ctx */
1116 #include "util_filter.h"
1117 
1121 struct conn_rec {
1123  apr_pool_t *pool;
1127  void *vhost_lookup_data;
1129  /* Information about the connection itself */
1136 
1140  char *client_ip;
1144  char *remote_host;
1147  /* TODO: Remove from request_rec, make local to mod_ident */
1148  char *remote_logname;
1149 
1151  char *local_ip;
1154  char *local_host;
1155 
1157  long id;
1165  struct ap_filter_t *input_filters;
1167  struct ap_filter_t *output_filters;
1169  void *sbh;
1173  conn_state_t *cs;
1178  unsigned int clogging_input_filters:1;
1179 
1182  signed int double_reverse:2;
1183 
1185  unsigned aborted;
1186 
1190 
1193 
1196  const struct ap_logconf *log;
1197 
1201  const char *log_id;
1202 
1203 
1209 #if APR_HAS_THREADS
1211 #endif
1212 
1215 
1218 
1220  void *ctx;
1221 
1224 
1227 
1229  struct ap_filter_conn_ctx *filter_conn_ctx;
1230 
1233 };
1234 
1236  conn_rec *c;
1237 };
1244 typedef enum {
1250  CONN_STATE_LINGER, /* connection may be closed with lingering */
1251  CONN_STATE_LINGER_NORMAL, /* MPM has started lingering close with normal timeout */
1252  CONN_STATE_LINGER_SHORT, /* MPM has started lingering close with short timeout */
1254  CONN_STATE_NUM /* Number of states (keep/kept last) */
1256 
1257 typedef enum {
1259  CONN_SENSE_WANT_READ, /* next event must be read */
1260  CONN_SENSE_WANT_WRITE /* next event must be write */
1266 struct conn_state_t {
1271 };
1272 
1273 /* Per-vhost config... */
1274 
1279 #define DEFAULT_VHOST_ADDR 0xfffffffful
1280 
1281 
1286 typedef struct server_addr_rec server_addr_rec;
1287 struct server_addr_rec {
1291  char *virthost;
1296 };
1297 
1298 struct ap_logconf {
1300  signed char *module_levels;
1303  int level;
1304 };
1308 struct server_rec {
1312  server_rec *next;
1314  /* Log files --- note that transfer log is now in the modules... */
1317  char *error_fname;
1321  struct ap_logconf log;
1327  /* Module-specific configuration for server, and defaults... */
1336  const char *defn_name;
1338  unsigned defn_line_number;
1340  char is_virtual;
1342 
1343  /* Information for redirects */
1344 
1346  apr_port_t port;
1348  const char *server_scheme;
1350  /* Contact information */
1353  char *server_admin;
1355  char *server_hostname;
1357  /* Transaction handling */
1366  int keep_alive_max;
1368  int keep_alive;
1376  const char *path;
1378  int pathlen;
1383  int limit_req_fieldsize;
1385  int limit_req_fields;
1388  void *context;
1389 
1393  unsigned int keep_alive_timeout_set:1;
1394 };
1395 
1400 typedef struct ap_sload_t ap_sload_t;
1401 struct ap_sload_t {
1402  /* percentage of process/threads ready/idle (0->100)*/
1403  int idle;
1404  /* percentage of process/threads busy (0->100) */
1405  int busy;
1406  /* total bytes served */
1408  /* total access count */
1409  unsigned long access_count;
1410 };
1411 
1416 typedef struct ap_loadavg_t ap_loadavg_t;
1417 struct ap_loadavg_t {
1418  /* current loadavg, ala getloadavg() */
1419  float loadavg;
1420  /* 5 min loadavg */
1421  float loadavg5;
1422  /* 15 min loadavg */
1423  float loadavg15;
1424 };
1425 
1436 
1442 AP_DECLARE(const char *) ap_context_prefix(request_rec *r);
1443 
1452 AP_DECLARE(void) ap_set_context_info(request_rec *r, const char *prefix,
1453  const char *document_root);
1454 
1460 AP_DECLARE(void) ap_set_document_root(request_rec *r, const char *document_root);
1461 
1469 AP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
1470 
1479 AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
1480 
1481 /* String handling. The *_nc variants allow you to use non-const char **s as
1482  arguments (unfortunately C won't automatically convert a char ** to a const
1483  char **) */
1484 
1492 AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
1493 
1502 AP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
1503 
1511 AP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);
1512 
1521 AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
1522 
1531 AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line,
1532  char stop);
1533 
1543 AP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
1544 
1551 AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);
1552 
1560 AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
1561 
1569 AP_DECLARE(char *) ap_getword_conf2(apr_pool_t *p, const char **line);
1570 
1579 AP_DECLARE(char *) ap_getword_conf2_nc(apr_pool_t *p, char **line);
1580 
1591 AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word);
1592 
1602 AP_DECLARE(const char *) ap_size_list_item(const char **field, int *len);
1603 
1614 AP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field);
1615 
1624 AP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
1625 
1633 AP_DECLARE(int) ap_find_etag_weak(apr_pool_t *p, const char *line, const char *tok);
1634 
1642 AP_DECLARE(int) ap_find_etag_strong(apr_pool_t *p, const char *line, const char *tok);
1643 
1644 /* Scan a string for field content chars, as defined by RFC7230 section 3.2
1645  * including VCHAR/obs-text, as well as HT and SP
1646  * @param ptr The string to scan
1647  * @return A pointer to the first (non-HT) ASCII ctrl character.
1648  * @note lws and trailing whitespace are scanned, the caller is responsible
1649  * for trimming leading and trailing whitespace
1650  */
1651 AP_DECLARE(const char *) ap_scan_http_field_content(const char *ptr);
1652 
1653 /* Scan a string for token characters, as defined by RFC7230 section 3.2.6
1654  * @param ptr The string to scan
1655  * @return A pointer to the first non-token character.
1656  */
1657 AP_DECLARE(const char *) ap_scan_http_token(const char *ptr);
1658 
1659 /* Scan a string for visible ASCII (0x21-0x7E) or obstext (0x80+)
1660  * and return a pointer to the first SP/CTL/NUL character encountered.
1661  * @param ptr The string to scan
1662  * @return A pointer to the first SP/CTL character.
1663  */
1664 AP_DECLARE(const char *) ap_scan_vchar_obstext(const char *ptr);
1665 
1679 AP_DECLARE(const char *) ap_parse_token_list_strict(apr_pool_t *p, const char *tok,
1680  apr_array_header_t **tokens,
1681  int skip_invalid);
1682 
1693 AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
1694 
1702 AP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
1703 
1711 AP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
1712 
1718 AP_DECLARE(int) ap_is_url(const char *u);
1719 
1725 AP_DECLARE(int) ap_unescape_all(char *url);
1726 
1733 AP_DECLARE(int) ap_unescape_url(char *url);
1734 
1742 AP_DECLARE(int) ap_unescape_url_keep2f(char *url, int decode_slashes);
1743 
1750 AP_DECLARE(int) ap_unescape_urlencoded(char *query);
1751 
1756 AP_DECLARE(void) ap_no2slash(char *name)
1758 
1764 AP_DECLARE(void) ap_getparents(char *name)
1765  AP_FN_ATTR_NONNULL_ALL;
1766 
1774 AP_DECLARE(char *) ap_escape_path_segment(apr_pool_t *p, const char *s)
1775  AP_FN_ATTR_NONNULL_ALL;
1776 
1784 AP_DECLARE(char *) ap_escape_path_segment_buffer(char *c, const char *s)
1785  AP_FN_ATTR_NONNULL_ALL;
1786 
1797 AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial)
1798  AP_FN_ATTR_NONNULL_ALL;
1799 
1801 #define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
1802 
1810 AP_DECLARE(char *) ap_escape_urlencoded(apr_pool_t *p, const char *s)
1811  AP_FN_ATTR_NONNULL_ALL;
1812 
1820 AP_DECLARE(char *) ap_escape_urlencoded_buffer(char *c, const char *s)
1821  AP_FN_ATTR_NONNULL_ALL;
1822 
1830 #define ap_escape_html(p,s) ap_escape_html2(p,s,0)
1831 
1839 AP_DECLARE(char *) ap_escape_html2(apr_pool_t *p, const char *s, int toasc)
1840  AP_FN_ATTR_NONNULL_ALL;
1841 
1849 AP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str)
1850  AP_FN_ATTR_NONNULL((1));
1851 
1860 AP_DECLARE(apr_size_t) ap_escape_errorlog_item(char *dest, const char *source,
1861  apr_size_t buflen)
1862  AP_FN_ATTR_NONNULL((1));
1863 
1872 AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
1873  apr_port_t port, const request_rec *r)
1874  AP_FN_ATTR_NONNULL((1,4));
1875 
1883 AP_DECLARE(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s)
1884  AP_FN_ATTR_NONNULL_ALL;
1885 
1891 AP_DECLARE(int) ap_count_dirs(const char *path)
1892  AP_FN_ATTR_NONNULL_ALL;
1893 
1905 AP_DECLARE(char *) ap_make_dirstr_prefix(char *d, const char *s, int n)
1906  AP_FN_ATTR_NONNULL_ALL;
1907 
1915 AP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s)
1916  AP_FN_ATTR_NONNULL_ALL;
1917 
1931 AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f)
1932  AP_FN_ATTR_NONNULL_ALL;
1933 
1942 AP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir)
1943  AP_FN_ATTR_NONNULL_ALL;
1944 
1952 AP_DECLARE(int) ap_is_matchexp(const char *str)
1953  AP_FN_ATTR_NONNULL_ALL;
1954 
1961 AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected)
1962  AP_FN_ATTR_NONNULL_ALL;
1963 
1971 AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected)
1972  AP_FN_ATTR_NONNULL_ALL;
1973 
1981 AP_DECLARE(char *) ap_strcasestr(const char *s1, const char *s2)
1982  AP_FN_ATTR_NONNULL_ALL;
1983 
1990 AP_DECLARE(const char *) ap_stripprefix(const char *bigstring,
1991  const char *prefix)
1992  AP_FN_ATTR_NONNULL_ALL;
1993 
2001 AP_DECLARE(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
2002 
2021  const char *encoded,
2022  char **decoded,
2023  apr_size_t *len);
2024 
2032 AP_DECLARE(char *) ap_pbase64encode(apr_pool_t *p, char *string);
2033 
2047 AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
2048  int cflags);
2049 
2058 
2072 AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input,
2073  const char *source, apr_size_t nmatch,
2074  ap_regmatch_t pmatch[]);
2075 
2090 AP_DECLARE(apr_status_t) ap_pregsub_ex(apr_pool_t *p, char **result,
2091  const char *input, const char *source,
2092  apr_size_t nmatch,
2093  ap_regmatch_t pmatch[],
2094  apr_size_t maxlen);
2095 
2101 AP_DECLARE(void) ap_content_type_tolower(char *s);
2102 
2107 AP_DECLARE(void) ap_str_tolower(char *s);
2108 
2113 AP_DECLARE(void) ap_str_toupper(char *s);
2114 
2122 AP_DECLARE(int) ap_ind(const char *str, char c); /* Sigh... */
2123 
2131 AP_DECLARE(int) ap_rind(const char *str, char c);
2132 
2140 AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring);
2141 
2152 AP_DECLARE(char *) ap_append_pid(apr_pool_t *p, const char *string,
2153  const char *delim);
2154 
2174  const char *timeout_parameter,
2175  apr_interval_time_t *timeout,
2176  const char *default_time_unit);
2177 
2185 
2187 #define AP_TAINT_HTACCESS 0x1
2188 
2196 
2208  const char **dest);
2209 
2219 AP_DECLARE(apr_status_t) ap_str2_alnum(const char *src, char *dest);
2220 
2229 typedef struct {
2230  const char *name;
2231  apr_bucket_brigade *value;
2245  apr_array_header_t **ptr,
2246  apr_size_t num, apr_size_t size);
2247 
2248 /* Misc system hackery */
2255 AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *name);
2256 
2263 AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *name);
2264 
2265 #ifdef _OSD_POSIX
2266 extern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
2267 #endif /* _OSD_POSIX */
2268 
2274 char *ap_get_local_host(apr_pool_t *p);
2275 
2282 AP_DECLARE(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
2283  __attribute__((noreturn));
2284 
2288 #define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
2289 
2297 #ifdef AP_DEBUG
2298 #define AP_DEBUG_ASSERT(exp) ap_assert(exp)
2299 #else
2300 #define AP_DEBUG_ASSERT(exp) ((void)0)
2301 #endif
2302 
2312 #define SIGSTOP_DETACH 1
2313 
2314 #define SIGSTOP_MAKE_CHILD 2
2316 #define SIGSTOP_SPAWN_CHILD 4
2318 #define SIGSTOP_PIPED_LOG_SPAWN 8
2320 #define SIGSTOP_CGI_CHILD 16
2323 #ifdef DEBUG_SIGSTOP
2324 extern int raise_sigstop_flags;
2325 #define RAISE_SIGSTOP(x) do { \
2326  if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
2327  } while (0)
2328 #else
2329 #define RAISE_SIGSTOP(x)
2330 #endif
2331 
2338 AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r);
2339 
2340  /* The C library has functions that allow const to be silently dropped ...
2341  these macros detect the drop in maintainer mode, but use the native
2342  methods for normal builds
2343 
2344  Note that on some platforms (e.g., AIX with gcc, Solaris with gcc), string.h needs
2345  to be included before the macros are defined or compilation will fail.
2346  */
2347 #include <string.h>
2348 
2349 AP_DECLARE(char *) ap_strchr(char *s, int c);
2350 AP_DECLARE(const char *) ap_strchr_c(const char *s, int c);
2351 AP_DECLARE(char *) ap_strrchr(char *s, int c);
2352 AP_DECLARE(const char *) ap_strrchr_c(const char *s, int c);
2353 AP_DECLARE(char *) ap_strstr(char *s, const char *c);
2354 AP_DECLARE(const char *) ap_strstr_c(const char *s, const char *c);
2357 
2358 #ifdef AP_DEBUG
2359 
2360 #undef strchr
2361 # define strchr(s, c) ap_strchr(s,c)
2362 #undef strrchr
2363 # define strrchr(s, c) ap_strrchr(s,c)
2364 #undef strstr
2365 # define strstr(s, c) ap_strstr(s,c)
2366 
2367 #if !defined(AP_DEBUG_NO_ALLOC_POISON) && !APR_POOL_DEBUG
2368 /*
2369  * ap_palloc_debug initializes allocated memory to non-zero
2370  */
2371 #define apr_palloc ap_palloc_debug
2372 /*
2373  * this is necessary to avoid useless double memset of memory
2374  * with ap_palloc_debug
2375  */
2376 #ifdef apr_pcalloc
2377 #undef apr_pcalloc
2378 #endif
2379 #define apr_pcalloc ap_pcalloc_debug
2380 #endif
2381 
2382 #else
2383 
2385 # define ap_strchr(s, c) strchr(s, c)
2386 
2387 # define ap_strchr_c(s, c) strchr(s, c)
2389 # define ap_strrchr(s, c) strrchr(s, c)
2391 # define ap_strrchr_c(s, c) strrchr(s, c)
2393 # define ap_strstr(s, c) strstr(s, c)
2395 # define ap_strstr_c(s, c) strstr(s, c)
2397 #endif
2408 AP_DECLARE(void) ap_random_insecure_bytes(void *buf, apr_size_t size);
2409 
2417 
2421 AP_DECLARE(void) ap_abort_on_oom(void) __attribute__((noreturn));
2422 
2429 AP_DECLARE(void *) ap_malloc(size_t size)
2432 
2440 AP_DECLARE(void *) ap_calloc(size_t nelem, size_t size)
2443 
2451 AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
2453  AP_FN_ATTR_ALLOC_SIZE(2);
2454 
2460  AP_FN_ATTR_NONNULL_ALL;
2461 
2467  AP_FN_ATTR_NONNULL_ALL;
2468 
2477 AP_DECLARE(void) ap_bin2hex(const void *src, apr_size_t srclen, char *dest)
2478  AP_FN_ATTR_NONNULL_ALL;
2479 
2493  const char *username,
2494  const char *passwd,
2495  const char *hash);
2496 
2506  const char *cmd,
2507  const char * const *argv);
2508 
2509 
2510 #define AP_NORESTART APR_OS_START_USEERR + 1
2511 
2522  const char *s,
2523  int start);
2524 
2532  const char *s);
2533 
2546 AP_DECLARE(int) ap_cstr_casecmp(const char *s1, const char *s2);
2547 
2560 AP_DECLARE(int) ap_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n);
2561 
2565 #define AP_DIR_FLAG_NONE 0
2566 
2571 #define AP_DIR_FLAG_OPTIONAL 1
2572 
2577 #define AP_DIR_FLAG_RECURSIVE 2
2578 
2582 typedef struct ap_dir_match_t ap_dir_match_t;
2583 
2587 struct ap_dir_match_t {
2589  apr_pool_t *p;
2591  apr_pool_t *ptemp;
2593  const char *prefix;
2595  const char *(*cb)(ap_dir_match_t *w, const char *fname);
2597  void *ctx;
2599  int flags;
2601  unsigned int depth;
2602 };
2603 
2624 AP_DECLARE(const char *)ap_dir_nofnmatch(ap_dir_match_t *w, const char *fname)
2625  __attribute__((nonnull(1,2)));
2626 
2645 AP_DECLARE(const char *)ap_dir_fnmatch(ap_dir_match_t *w, const char *path,
2646  const char *fname) __attribute__((nonnull(1,3)));
2647 
2648 #ifdef __cplusplus
2649 }
2650 #endif
2651 
2652 #endif /* !APACHE_HTTPD_H */
2653 
apr_uri_t parsed_uri
Definition: httpd.h:1060
apr_bucket_brigade * kept_body
Definition: httpd.h:919
void * sbh
Definition: httpd.h:1172
char * user
Definition: httpd.h:971
void void * ap_realloc(void *ptr, size_t size) AP_FN_ATTR_WARN_UNUSED_RESULT AP_FN_ATTR_ALLOC_SIZE(2)
apr_port_t port
Definition: httpd.h:1349
void * context
Definition: httpd.h:1391
size_t apr_size_t
Definition: apr.h:375
int major
Definition: httpd.h:410
ap_regex_t * ap_pregcomp(apr_pool_t *p, const char *pattern, int cflags)
char * ap_getword(apr_pool_t *p, const char **line, char stop)
int ap_os_is_path_absolute(apr_pool_t *p, const char *dir) AP_FN_ATTR_NONNULL_ALL
char * ap_pbase64encode(apr_pool_t *p, char *string)
char * ap_pregsub(apr_pool_t *p, const char *input, const char *source, apr_size_t nmatch, ap_regmatch_t pmatch[])
struct ap_conf_vector_t * module_config
Definition: httpd.h:1334
const struct ap_logconf * log
Definition: httpd.h:1199
int idle
Definition: httpd.h:1406
#define ap_strrchr_c(s, c)
Definition: httpd.h:2394
struct ap_filter_conn_ctx * filter_conn_ctx
Definition: httpd.h:1232
APR Network library.
const char * ap_context_prefix(request_rec *r)
apr_pool_t * ptemp
Definition: httpd.h:2594
struct ap_errorlog_provider * errorlog_provider
Definition: httpd.h:1326
char * args
Definition: httpd.h:992
char * local_host
Definition: httpd.h:1157
const char * content_type
Definition: httpd.h:958
char * ap_make_dirstr_parent(apr_pool_t *p, const char *s) AP_FN_ATTR_NONNULL_ALL
apr_off_t remaining
Definition: httpd.h:925
Definition: apr_arch_thread_mutex.h:28
Definition: apr_arch_file_io.h:107
const char * log_id
Definition: httpd.h:1025
Definition: httpd.h:1257
Definition: apr_tables.h:62
const char * ap_size_list_item(const char **field, int *len)
request_rec * prev
Definition: httpd.h:822
#define ap_strrchr(s, c)
Definition: httpd.h:2392
int ap_unescape_urlencoded(char *query)
char * ap_getword_conf(apr_pool_t *p, const char **line)
char * ap_getword_nc(apr_pool_t *p, char **line, char stop)
ap_method_list_t * allowed_methods
Definition: httpd.h:892
apr_table_t * override_list
Definition: httpd.h:760
float loadavg15
Definition: httpd.h:1426
server_rec * server
Definition: httpd.h:817
struct apr_bucket_alloc_t * bucket_alloc
Definition: httpd.h:1174
int eos_sent
Definition: httpd.h:1005
apr_table_t * subprocess_env
Definition: httpd.h:949
char * ap_pbase64decode(apr_pool_t *p, const char *bufcoded)
void * ap_palloc_debug(apr_pool_t *p, apr_size_t size)
apr_size_t ap_escape_errorlog_item(char *dest, const char *source, apr_size_t buflen) AP_FN_ATTR_NONNULL((1))
The representation of a filter chain.
Definition: util_filter.h:278
Definition: httpd.h:1251
int taint
Definition: httpd.h:1089
A structure to be used for Per-vhost config.
Definition: httpd.h:1290
Definition: httpd.h:2590
apr_uint32_t ap_random_pick(apr_uint32_t min, apr_uint32_t max)
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:123
int no_local_copy
Definition: httpd.h:1050
void ap_set_document_root(request_rec *r, const char *document_root)
const char * ap_get_server_description(void)
char * ap_get_local_host(apr_pool_t *p)
float loadavg5
Definition: httpd.h:1424
unsigned long access_count
Definition: httpd.h:1412
#define AP_DECLARE(x)
Definition: macros.h:1
apr_array_header_t * allowed_xmethods
Definition: httpd.h:890
apr_array_header_t * wild_names
Definition: httpd.h:1376
#define ap_strstr_c(s, c)
Definition: httpd.h:2398
apr_interval_time_t timeout
Definition: httpd.h:1365
char * ap_getword_conf_nc(apr_pool_t *p, char **line)
const char * method
Definition: httpd.h:866
conn_rec * connection
Definition: httpd.h:815
void ap_bin2hex(const void *src, apr_size_t srclen, char *dest) AP_FN_ATTR_NONNULL_ALL
char * ap_make_dirstr_prefix(char *d, const char *s, int n) AP_FN_ATTR_NONNULL_ALL
server_rec * base_server
Definition: httpd.h:1128
char * vlist_validator
Definition: httpd.h:968
request_rec * next
Definition: httpd.h:820
apr_thread_mutex_t * invoke_mtx
Definition: httpd.h:1056
const char * ap_get_server_banner(void)
char * server_hostname
Definition: httpd.h:1358
APR Hash Tables.
Apache Regex defines.
apr_thread_t * current_thread
Definition: httpd.h:1213
unsigned int clogging_input_filters
Definition: httpd.h:1181
apr_int64_t allowed
Definition: httpd.h:888
struct ap_filter_t * proto_input_filters
Definition: httpd.h:1045
apr_file_t * error_log
Definition: httpd.h:1322
char * error_fname
Definition: httpd.h:1320
int double_reverse
Definition: httpd.h:1084
const char * hostname
Definition: httpd.h:849
char * ap_auth_type
Definition: httpd.h:973
struct ap_filter_t * proto_output_filters
Definition: httpd.h:1042
const char * short_name
Definition: httpd.h:801
int ap_cstr_casecmp(const char *s1, const char *s2)
void * suspended_baton
Definition: httpd.h:1226
This represents the result of calling htaccess; these are cached for each request.
Definition: httpd.h:752
#define ap_strchr_c(s, c)
Definition: httpd.h:2390
apr_table_t * trailers_out
Definition: httpd.h:1074
apr_sockaddr_t * host_addr
Definition: httpd.h:1296
int ap_is_url(const char *u)
apr_table_t * notes
Definition: httpd.h:951
apr_pool_t * pool
Definition: httpd.h:797
signed int double_reverse
Definition: httpd.h:1185
char * ap_escape_urlencoded(apr_pool_t *p, const char *s) AP_FN_ATTR_NONNULL_ALL
void * vhost_lookup_data
Definition: httpd.h:1130
char * ap_get_list_item(apr_pool_t *p, const char **field)
Definition: httpd.h:1114
const char * path
Definition: httpd.h:1379
apr_table_t * headers_out
Definition: httpd.h:944
A structure that represents one process.
Definition: httpd.h:795
char * ap_getword_conf2(apr_pool_t *p, const char **line)
Definition: apr_buckets.h:258
The numeric version information is broken out into fields within this structure.
Definition: httpd.h:409
int keep_alive
Definition: httpd.h:1371
float loadavg
Definition: httpd.h:1422
const char * handler
Definition: httpd.h:960
server_addr_rec * next
Definition: httpd.h:1292
apr_status_t ap_pstr2_alnum(apr_pool_t *p, const char *src, const char **dest)
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
const char * prefix
Definition: mod_dav.h:614
APR Miscellaneous library routines.
int ap_parse_form_data(request_rec *r, struct ap_filter_t *f, apr_array_header_t **ptr, apr_size_t num, apr_size_t size)
void * ctx
Definition: httpd.h:2600
APR Poll interface.
int ap_ind(const char *str, char c)
char * ap_escape_quotes(apr_pool_t *p, const char *instring)
int ap_strcmp_match(const char *str, const char *expected) AP_FN_ATTR_NONNULL_ALL
const char * defn_name
Definition: httpd.h:1339
Structure to store things which are per connection.
Definition: httpd.h:1124
int keepalives
Definition: httpd.h:1195
char * server_admin
Definition: httpd.h:1356
apr_sockaddr_t * local_addr
Definition: httpd.h:1134
Definition: httpd.h:1250
char * ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt)
Definition: httpd.h:1253
dav_buffer apr_size_t size
Definition: mod_dav.h:457
const char * ap_resolve_env(apr_pool_t *p, const char *word)
struct ap_filter_t * output_filters
Definition: httpd.h:1036
Symbol export macros and hook functions.
int proto_num
Definition: httpd.h:843
apr_array_header_t * method_list
Definition: httpd.h:660
char * ap_escape_html2(apr_pool_t *p, const char *s, int toasc) AP_FN_ATTR_NONNULL_ALL
apr_status_t ap_pbase64decode_strict(apr_pool_t *p, const char *encoded, char **decoded, apr_size_t *len)
int method_number
Definition: httpd.h:864
char * ap_getword_white_nc(apr_pool_t *p, char **line)
int ap_find_etag_weak(apr_pool_t *p, const char *line, const char *tok)
char * client_ip
Definition: httpd.h:1143
#define AP_FN_ATTR_NONNULL_ALL
Definition: ap_config.h:260
char * ap_getword_nulls(apr_pool_t *p, const char **line, char stop)
struct ap_conf_vector_t * conn_config
Definition: httpd.h:1163
apr_time_t request_time
Definition: httpd.h:852
apr_int64_t apr_time_t
Definition: apr_time.h:45
conn_state_e
Definition: httpd.h:1247
const char * log_id
Definition: httpd.h:1204
conn_state_t * cs
Definition: httpd.h:1176
APR memory allocation.
Definition: httpd.h:1238
const char * ap_stripprefix(const char *bigstring, const char *prefix) AP_FN_ATTR_NONNULL_ALL
const char const char * ap_dir_fnmatch(ap_dir_match_t *w, const char *path, const char *fname) __attribute__((nonnull(1
struct ap_conf_vector_t * htaccess
Definition: httpd.h:762
const char * dir
Definition: httpd.h:754
unsigned int keep_alive_timeout_set
Definition: httpd.h:1396
const char * server_scheme
Definition: httpd.h:1351
int level
Definition: httpd.h:1306
int header_only
Definition: httpd.h:841
Definition: httpd.h:1252
char * the_request
Definition: httpd.h:832
A structure to store information for each virtual server.
Definition: httpd.h:1311
char * ap_getword_white(apr_pool_t *p, const char **line)
int no_cache
Definition: httpd.h:1048
char * uri
Definition: httpd.h:982
int ap_array_str_contains(const apr_array_header_t *array, const char *s)
int chunked
Definition: httpd.h:908
struct ap_conf_vector_t * request_config
Definition: httpd.h:1015
char * path_info
Definition: httpd.h:990
int ap_find_etag_strong(apr_pool_t *p, const char *line, const char *tok)
apr_table_t * trailers_in
Definition: httpd.h:1072
const struct htaccess_result * next
Definition: httpd.h:764
A structure to contain connection state information.
Definition: httpd.h:1269
int flags
Definition: httpd.h:2602
dav_error * src
Definition: mod_dav.h:186
char * ap_escape_path_segment(apr_pool_t *p, const char *s) AP_FN_ATTR_NONNULL_ALL
const char * add_string
Definition: httpd.h:413
const char * ap_scan_vchar_obstext(const char *ptr)
apr_pool_t * pool
Definition: httpd.h:813
char * ap_escape_urlencoded_buffer(char *c, const char *s) AP_FN_ATTR_NONNULL_ALL
APR Table library.
const char * ap_context_document_root(request_rec *r)
int limit_req_fields
Definition: httpd.h:1388
process_rec * process
Definition: httpd.h:1313
apr_array_header_t * names
Definition: httpd.h:1374
int ap_array_str_index(const apr_array_header_t *array, const char *s, int start)
ap_conn_keepalive_e
Enumeration of connection keepalive options.
Definition: httpd.h:1112
Definition: apr_arch_threadproc.h:42
long id
Definition: httpd.h:1160
apr_table_t * notes
Definition: httpd.h:1166
Definition: ap_regex.h:107
A structure to hold server load params.
Definition: httpd.h:1404
APR-UTIL Buckets/Bucket Brigades.
int busy
Definition: httpd.h:1408
void ap_no2slash(char *name) AP_FN_ATTR_NONNULL_ALL
apr_port_t host_port
Definition: httpd.h:1298
apr_off_t sent_bodyct
Definition: httpd.h:895
conn_rec * master
Definition: httpd.h:1220
proxy_worker proxy_server_conf char * url
Definition: mod_proxy.h:611
const char * ap_parse_token_list_strict(apr_pool_t *p, const char *tok, apr_array_header_t **tokens, int skip_invalid)
char * remote_host
Definition: httpd.h:1147
char * ap_strcasestr(const char *s1, const char *s2) AP_FN_ATTR_NONNULL_ALL
server_rec * next
Definition: httpd.h:1315
apr_int64_t method_mask
Definition: httpd.h:658
#define AP_FN_ATTR_NONNULL(x)
Definition: ap_config.h:261
int ap_unescape_all(char *url)
apr_status_t ap_password_validate(request_rec *r, const char *username, const char *passwd, const char *hash)
int ap_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n)
int ap_unescape_url(char *url)
unsigned int apr_uint32_t
Definition: apr.h:334
APR Platform Definitions.
const char * ap_dir_nofnmatch(ap_dir_match_t *w, const char *fname) __attribute__((nonnull(1
char * useragent_host
Definition: httpd.h:1079
void ap_pregfree(apr_pool_t *p, ap_regex_t *reg)
char * ap_make_full_path(apr_pool_t *a, const char *dir, const char *f) AP_FN_ATTR_NONNULL_ALL
request_rec * main
Definition: httpd.h:826
struct ap_conf_vector_t * per_dir_config
Definition: httpd.h:1013
char * ap_escape_path_segment_buffer(char *c, const char *s) AP_FN_ATTR_NONNULL_ALL
apr_sockaddr_t * useragent_addr
Definition: httpd.h:1068
Definition: httpd.h:1254
apr_pool_t * p
Definition: httpd.h:2592
void ap_abort_on_oom(void) __attribute__((noreturn))
conn_state_e state
Definition: httpd.h:1271
server_addr_rec * addrs
Definition: httpd.h:1363
char is_virtual
Definition: httpd.h:1343
unsigned int depth
Definition: httpd.h:2604
Definition: httpd.h:1255
Definition: httpd.h:1249
void * errorlog_provider_handle
Definition: httpd.h:1328
Definition: apr_uri.h:85
int status
Definition: httpd.h:857
char * remote_logname
Definition: httpd.h:1151
void ap_add_version_component(apr_pool_t *pconf, const char *component)
void * ap_malloc(size_t size) __attribute__((malloc)) AP_FN_ATTR_ALLOC_SIZE(1)
void ap_log_assert(const char *szExp, const char *szFile, int nLine) __attribute__((noreturn))
int ap_unescape_url_keep2f(char *url, int decode_slashes)
apr_pool_t * p
Version Release defines.
int ap_find_token(apr_pool_t *p, const char *line, const char *tok)
int read_chunked
Definition: httpd.h:915
Definition: httpd.h:1263
int keep_alive_max
Definition: httpd.h:1369
#define AP_FN_ATTR_ALLOC_SIZE(x)
Definition: ap_config.h:248
char * virthost
Definition: httpd.h:1294
char * canonical_filename
Definition: httpd.h:988
int async_filter
Definition: httpd.h:1235
APR Thread and Process Library.
struct ap_logconf log
Definition: httpd.h:1324
int used_path_info
Definition: httpd.h:1002
int ap_strcasecmp_match(const char *str, const char *expected) AP_FN_ATTR_NONNULL_ALL
char * ap_escape_logitem(apr_pool_t *p, const char *str) AP_FN_ATTR_NONNULL((1))
conn_rec * c
Definition: httpd.h:1239
apr_status_t ap_timeout_parameter_parse(const char *timeout_parameter, apr_interval_time_t *timeout, const char *default_time_unit)
int override_opts
Definition: httpd.h:758
apr_sockaddr_t * client_addr
Definition: httpd.h:1138
int ap_count_dirs(const char *path) AP_FN_ATTR_NONNULL_ALL
const char * prefix
Definition: httpd.h:2596
int ap_find_last_token(apr_pool_t *p, const char *line, const char *tok)
A structure that represents the current request.
Definition: httpd.h:811
int minor
Definition: httpd.h:411
char * ap_get_exec_line(apr_pool_t *p, const char *cmd, const char *const *argv)
conn_sense_e sense
Definition: httpd.h:1273
Apache filter library.
const char * content_encoding
Definition: httpd.h:963
Definition: httpd.h:1261
int ap_rind(const char *str, char c)
int proxyreq
Definition: httpd.h:839
struct ap_filter_t * input_filters
Definition: httpd.h:1168
Structure for handling HTTP methods.
Definition: httpd.h:656
int limit_req_line
Definition: httpd.h:1384
const char * range
Definition: httpd.h:904
int ap_is_directory(apr_pool_t *p, const char *name)
apr_finfo_t finfo
Definition: httpd.h:1062
int limit_req_fieldsize
Definition: httpd.h:1386
A structure to hold various server loadavg.
Definition: httpd.h:1420
const char * ap_scan_http_field_content(const char *ptr)
void * ap_pcalloc_debug(apr_pool_t *p, apr_size_t size)
dav_buffer const char * str
Definition: mod_dav.h:461
void ap_content_type_tolower(char *s)
const char * protocol
Definition: httpd.h:845
apr_pool_t * pconf
Definition: httpd.h:799
Definition: httpd.h:1262
apr_table_t * body_table
Definition: httpd.h:923
apr_pool_t * pool
Definition: httpd.h:1126
void ap_get_loadavg(ap_loadavg_t *ld) AP_FN_ATTR_NONNULL_ALL
int ap_is_matchexp(const char *str) AP_FN_ATTR_NONNULL_ALL
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
apr_off_t clength
Definition: httpd.h:906
#define __attribute__(__x)
Definition: apr.h:63
int assbackwards
Definition: httpd.h:834
void ap_get_server_revision(ap_version_t *version)
apr_table_t * headers_in
Definition: httpd.h:942
long apr_int64_t
Definition: apr.h:371
const char * name
Definition: mod_dav.h:726
apr_table_t * err_headers_out
Definition: httpd.h:947
char * ap_field_noparam(apr_pool_t *p, const char *intype)
unsigned defn_line_number
Definition: httpd.h:1341
char * unparsed_uri
Definition: httpd.h:980
int read_body
Definition: httpd.h:913
apr_array_header_t * requests
Definition: httpd.h:1229
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int argc
Definition: httpd.h:805
Definition: httpd.h:2232
apr_status_t ap_pregsub_ex(apr_pool_t *p, char **result, const char *input, const char *source, apr_size_t nmatch, ap_regmatch_t pmatch[], apr_size_t maxlen)
void ap_str_tolower(char *s)
Definition: ap_regex.h:114
const struct ap_logconf * log
Definition: httpd.h:1020
int apr_status_t
Definition: apr_errno.h:44
char * ap_getword_conf2_nc(apr_pool_t *p, char **line)
#define AP_FN_ATTR_WARN_UNUSED_RESULT
Definition: ap_config.h:239
Definition: httpd.h:1113
char * local_ip
Definition: httpd.h:1154
void * ctx
Definition: httpd.h:1223
request_rec * r
Definition: mod_dav.h:515
char * ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white)
#define ap_strstr(s, c)
Definition: httpd.h:2396
char * ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop)
char * ap_construct_server(apr_pool_t *p, const char *hostname, apr_port_t port, const request_rec *r) AP_FN_ATTR_NONNULL((1
void ap_random_insecure_bytes(void *buf, apr_size_t size)
apr_off_t read_length
Definition: httpd.h:927
APR-UTIL URI Routines.
apr_uint16_t apr_port_t
Definition: apr_network_io.h:257
APR Time Library.
Module Magic Number.
apr_status_t ap_str2_alnum(const char *src, char *dest)
void ap_getparents(char *name) AP_FN_ATTR_NONNULL_ALL
conn_sense_e
Definition: httpd.h:1260
void ap_str_toupper(char *s)
unsigned expecting_100
Definition: httpd.h:917
apr_time_t mtime
Definition: httpd.h:899
struct ap_conf_vector_t ap_conf_vector_t
Definition: http_config.h:519
int ap_request_has_body(request_rec *r)
char * filename
Definition: httpd.h:984
ap_conn_keepalive_e keepalive
Definition: httpd.h:1192
apr_array_header_t * slaves
Definition: httpd.h:1217
Definition: httpd.h:1301
void * ap_calloc(size_t nelem, size_t size) __attribute__((malloc)) AP_FN_ATTR_ALLOC_SIZE2(1
char * useragent_ip
Definition: httpd.h:1069
apr_off_t bytes_served
Definition: httpd.h:1410
#define malloc(x)
Definition: apr_private.h:170
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1346
void ap_get_sload(ap_sload_t *ld) AP_FN_ATTR_NONNULL_ALL
char char * ap_escape_shell_cmd(apr_pool_t *p, const char *s) AP_FN_ATTR_NONNULL_ALL
struct ap_filter_t * input_filters
Definition: httpd.h:1038
void ap_set_context_info(request_rec *r, const char *prefix, const char *document_root)
unsigned aborted
Definition: httpd.h:1188
char * ap_os_escape_path(apr_pool_t *p, const char *path, int partial) AP_FN_ATTR_NONNULL_ALL
apr_interval_time_t keep_alive_timeout
Definition: httpd.h:1367
Definition: httpd.h:1115
struct ap_conf_vector_t * lookup_defaults
Definition: httpd.h:1336
int ap_request_tainted(request_rec *r, int flags)
int ap_find_list_item(apr_pool_t *p, const char *line, const char *tok)
off_t apr_off_t
Definition: apr.h:377
Definition: apr_file_info.h:174
int ap_is_rdirectory(apr_pool_t *p, const char *name)
int patch
Definition: httpd.h:412
#define ap_strchr(s, c)
Definition: httpd.h:2388
signed char * module_levels
Definition: httpd.h:1303
const char * status_line
Definition: httpd.h:855
Definition: apr_network_io.h:266
int pathlen
Definition: httpd.h:1381
#define AP_FN_ATTR_ALLOC_SIZE2(x, y)
Definition: ap_config.h:249
const struct htaccess_result * htaccess
Definition: httpd.h:1033
const char * ap_psignature(const char *prefix, request_rec *r)
char * ap_append_pid(apr_pool_t *p, const char *string, const char *delim)
const char * ap_scan_http_token(const char *ptr)
apr_off_t bytes_sent
Definition: httpd.h:897
apr_array_header_t * content_languages
Definition: httpd.h:965
const char * ap_get_server_built(void)
Definition: http_core.h:948
struct ap_filter_t * output_filters
Definition: httpd.h:1170
const char *const * argv
Definition: httpd.h:803