Apache HTTPD
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_version.h"
51#include "apr_general.h"
52#include "apr_tables.h"
53#include "apr_pools.h"
54#include "apr_time.h"
55#include "apr_network_io.h"
56#include "apr_buckets.h"
57#include "apr_poll.h"
58#include "apr_thread_proc.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
71extern "C" {
72#endif
73
74/* ----------------------------- config dir ------------------------------ */
75
79#ifndef HTTPD_ROOT
80#ifdef OS2
82#define HTTPD_ROOT "/os2httpd"
83#elif defined(WIN32)
85#define HTTPD_ROOT "/apache"
86#elif defined (NETWARE)
88#define HTTPD_ROOT "/apache"
89#else
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
197#ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE
198#define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190
199#endif
201#ifndef DEFAULT_LIMIT_REQUEST_FIELDS
202#define DEFAULT_LIMIT_REQUEST_FIELDS 100
203#endif
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"
238#define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
239 "DTD HTML 3.2 Final//EN\">\n"
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"
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"
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"
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"
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"
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))
271#define HTTP_VERSION_MAJOR(number) ((number)/1000)
273#define HTTP_VERSION_MINOR(number) ((number)%1000)
274
275/* -------------- Port number for server running standalone --------------- */
276
278#define DEFAULT_HTTP_PORT 80
280#define DEFAULT_HTTPS_PORT 443
287#define ap_is_default_port(port,r) ((port) == ap_default_port(r))
292#define ap_default_port(r) ap_run_default_port(r)
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
327#define APEXIT_INIT 0x2
329#define APEXIT_CHILDINIT 0x3
335#define APEXIT_CHILDSICK 0x7
341#define APEXIT_CHILDFATAL 0xf
342
343#ifndef AP_DECLARE
349# define AP_DECLARE(type) type
350#endif
351
352#ifndef AP_DECLARE_NONSTD
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
409typedef struct {
410 int major;
411 int minor;
412 int patch;
413 const char *add_string;
415
423
430AP_DECLARE(const char *) ap_get_server_banner(void);
431
439AP_DECLARE(const char *) ap_get_server_description(void);
440
446AP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
447
452AP_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
469#define AP_NOBODY_READ -101
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_MISDIRECTED_REQUEST 421
527#define HTTP_UNPROCESSABLE_ENTITY 422
528#define HTTP_LOCKED 423
529#define HTTP_FAILED_DEPENDENCY 424
530#define HTTP_UPGRADE_REQUIRED 426
531#define HTTP_PRECONDITION_REQUIRED 428
532#define HTTP_TOO_MANY_REQUESTS 429
533#define HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE 431
534#define HTTP_UNAVAILABLE_FOR_LEGAL_REASONS 451
535#define HTTP_INTERNAL_SERVER_ERROR 500
536#define HTTP_NOT_IMPLEMENTED 501
537#define HTTP_BAD_GATEWAY 502
538#define HTTP_SERVICE_UNAVAILABLE 503
539#define HTTP_GATEWAY_TIME_OUT 504
540#define HTTP_VERSION_NOT_SUPPORTED 505
541#define HTTP_VARIANT_ALSO_VARIES 506
542#define HTTP_INSUFFICIENT_STORAGE 507
543#define HTTP_LOOP_DETECTED 508
544#define HTTP_NOT_EXTENDED 510
545#define HTTP_NETWORK_AUTHENTICATION_REQUIRED 511
546
548#define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
550#define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
552#define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
554#define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
556#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
558#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
560#define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
561
563#define ap_status_drops_connection(x) \
564 (((x) == HTTP_BAD_REQUEST) || \
565 ((x) == HTTP_REQUEST_TIME_OUT) || \
566 ((x) == HTTP_LENGTH_REQUIRED) || \
567 ((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
568 ((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
569 ((x) == HTTP_INTERNAL_SERVER_ERROR) || \
570 ((x) == HTTP_SERVICE_UNAVAILABLE) || \
571 ((x) == HTTP_NOT_IMPLEMENTED))
572
574#define AP_STATUS_IS_HEADER_ONLY(x) ((x) == HTTP_NO_CONTENT || \
575 (x) == HTTP_NOT_MODIFIED)
592#define M_GET 0
593#define M_PUT 1 /* : */
594#define M_POST 2
595#define M_DELETE 3
596#define M_CONNECT 4
597#define M_OPTIONS 5
598#define M_TRACE 6
599#define M_PATCH 7
600#define M_PROPFIND 8
601#define M_PROPPATCH 9 /* : */
602#define M_MKCOL 10
603#define M_COPY 11
604#define M_MOVE 12
605#define M_LOCK 13
606#define M_UNLOCK 14
607#define M_VERSION_CONTROL 15
608#define M_CHECKOUT 16 /* : */
609#define M_UNCHECKOUT 17
610#define M_CHECKIN 18
611#define M_UPDATE 19
612#define M_LABEL 20
613#define M_REPORT 21
614#define M_MKWORKSPACE 22
615#define M_MKACTIVITY 23
616#define M_BASELINE_CONTROL 24
617#define M_MERGE 25
618#define M_INVALID 26
624#define METHODS 64
625
629#define AP_METHOD_BIT ((apr_int64_t)1)
635
662typedef apr_uint64_t ap_request_bnotes_t;
663
669#define AP_REQUEST_STRONG_ETAG 1 >> 0
670#define AP_REQUEST_TRUSTED_CT 1 << 1
671
676#define AP_REQUEST_GET_BNOTE(r, mask) \
677 ((mask) & ((r)->bnotes))
678
683#define AP_REQUEST_SET_BNOTE(r, mask, val) \
684 (r)->bnotes = (((r)->bnotes & ~(mask)) | (val))
685
689#define AP_REQUEST_IS_STRONG_ETAG(r) \
690 AP_REQUEST_GET_BNOTE((r), AP_REQUEST_STRONG_ETAG)
696#define AP_REQUEST_IS_TRUSTED_CT(r) \
697 (!!AP_REQUEST_GET_BNOTE((r), AP_REQUEST_TRUSTED_CT))
705#define CGI_MAGIC_TYPE "application/x-httpd-cgi"
707#define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
709#define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
711#define DIR_MAGIC_TYPE "httpd/unix-directory"
713#define AP_DEFAULT_HANDLER_NAME ""
714#define AP_IS_DEFAULT_HANDLER_NAME(x) (*x == '\0')
715
717/* Just in case your linefeed isn't the one the other end is expecting. */
718#if !APR_CHARSET_EBCDIC
720#define LF 10
722#define CR 13
724#define CRLF "\015\012"
725#else /* APR_CHARSET_EBCDIC */
726/* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
727 * in the buff package (bread/bputs/bwrite). Everywhere else, we use
728 * "native EBCDIC" CR and NL characters. These are therefore
729 * defined as
730 * '\r' and '\n'.
731 */
732#define CR '\r'
733#define LF '\n'
734#define CRLF "\r\n"
735#endif /* APR_CHARSET_EBCDIC */
737#define CRLF_ASCII "\015\012"
738
746#define REQUEST_NO_BODY 0
748#define REQUEST_CHUNKED_ERROR 1
750#define REQUEST_CHUNKED_DECHUNK 2
761#define AP_REQ_ACCEPT_PATH_INFO 0
763#define AP_REQ_REJECT_PATH_INFO 1
765#define AP_REQ_DEFAULT_PATH_INFO 2
766
770/*
771 * Things which may vary per file-lookup WITHIN a request ---
772 * e.g., state of MIME config. Basically, the name of an object, info
773 * about the object, and any other info we may have which may need to
774 * change as we go poking around looking for it (e.g., overridden by
775 * .htaccess files).
776 *
777 * Note how the default state of almost all these things is properly
778 * zero, so that allocating it with pcalloc does the right thing without
779 * a whole lot of hairy initialization... so long as we are willing to
780 * make the (fairly) portable assumption that the bit pattern of a NULL
781 * pointer is, in fact, zero.
782 */
783
802
803/* The following four types define a hierarchy of activities, so that
804 * given a request_rec r you can write r->connection->server->process
805 * to get to the process_rec. While this reduces substantially the
806 * number of arguments that various hooks require beware that in
807 * threaded versions of the server you must consider multiplexing
808 * issues. */
809
810
814typedef struct server_rec server_rec;
816typedef struct conn_rec conn_rec;
821
822/* ### would be nice to not include this from httpd.h ... */
823/* This comes after we have defined the request_rec type */
824#include "apr_uri.h"
825
835 const char *short_name;
837 const char * const *argv;
839 int argc;
840};
841
852
857
861
862 /* Info about the request itself... we begin with stuff that only
863 * protocol.c should ever touch...
864 */
879 char *protocol;
883 const char *hostname;
884
887
889 const char *status_line;
892
893 /* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
894 * look, but don't touch.
895 */
896
900 const char *method;
901
922 apr_int64_t allowed;
927
929 apr_off_t sent_bodyct;
931 apr_off_t bytes_sent;
934
935 /* HTTP/1.1 connection-level features */
936
938 const char *range;
940 apr_off_t clength;
943
955 /* XXX: ap_body_to_table has been removed. Remove body_table too or
956 * XXX: keep it to reintroduce ap_body_to_table without major bump? */
959 apr_off_t remaining;
961 apr_off_t read_length;
962
963 /* MIME header environments, in and out. Also, an array containing
964 * environment variables to be passed to subprocesses, so people can
965 * write modules to add to that environment.
966 *
967 * The difference between headers_out and err_headers_out is that the
968 * latter are printed even on error, and persist across internal redirects
969 * (so the headers printed for ErrorDocument handlers will have them).
970 *
971 * The 'notes' apr_table_t is for notes from one module to another, with no
972 * other set purpose in mind...
973 */
974
986
987 /* content_type, handler, content_encoding, and all content_languages
988 * MUST be lowercased strings. They may be pointers to static strings;
989 * they should not be modified in place.
990 */
992 const char *content_type; /* Break these out --- we dispatch on 'em */
994 const char *handler; /* What we *really* dispatch on */
995
997 const char *content_encoding;
1000
1003
1005 char *user;
1008
1009 /* What object is being requested (either directly, or via include
1010 * or content-negotiation mapping).
1011 */
1012
1016 char *uri;
1026 char *args;
1027
1037
1040
1041 /* Various other config info which may change with .htaccess files
1042 * These are config vectors, with one void* pointer for each module
1043 * (the thing pointed to being the module's business).
1044 */
1045
1050
1054 const struct ap_logconf *log;
1055
1059 const char *log_id;
1060
1068
1073
1080
1085
1090
1095
1102
1107
1121};
1122
1133#define PROXYREQ_NONE 0
1134#define PROXYREQ_PROXY 1
1135#define PROXYREQ_REVERSE 2
1136#define PROXYREQ_RESPONSE 3
1138/* @} */
1139
1148
1152struct conn_rec {
1159
1160 /* Information about the connection itself */
1167
1179
1185
1187 long id;
1199 void *sbh;
1208
1213
1216 signed int double_reverse:2;
1217
1219 unsigned aborted;
1220
1224
1227
1230 const struct ap_logconf *log;
1231
1235 const char *log_id;
1236
1237
1243#if APR_HAS_THREADS
1244 apr_thread_t *current_thread;
1245#endif
1246
1249
1251};
1252
1258typedef enum {
1264 CONN_STATE_LINGER, /* connection may be closed with lingering */
1265 CONN_STATE_LINGER_NORMAL, /* MPM has started lingering close with normal timeout */
1266 CONN_STATE_LINGER_SHORT, /* MPM has started lingering close with short timeout */
1267
1268 CONN_STATE_NUM /* Number of states (keep/kept last) */
1270
1271typedef enum {
1273 CONN_SENSE_WANT_READ, /* next event must be read */
1274 CONN_SENSE_WANT_WRITE /* next event must be write */
1276
1286
1287/* Per-vhost config... */
1288
1293#define DEFAULT_VHOST_ADDR 0xfffffffful
1294
1295
1311
1314 signed char *module_levels;
1315
1318};
1327
1328 /* Log files --- note that transfer log is now in the modules... */
1329
1336
1337 /* Module-specific configuration for server, and defaults... */
1338
1344
1346 const char *defn_name;
1351
1352
1353 /* Information for redirects */
1354
1358 const char *server_scheme;
1359
1360 /* Contact information */
1361
1366
1367 /* Transaction handling */
1368
1379
1384
1386 const char *path;
1389
1396
1398 void *context;
1399
1404};
1405
1410typedef struct ap_sload_t ap_sload_t;
1412 /* percentage of process/threads ready/idle (0->100)*/
1413 int idle;
1414 /* percentage of process/threads busy (0->100) */
1415 int busy;
1416 /* total bytes served */
1417 apr_off_t bytes_served;
1418 /* total access count */
1419 unsigned long access_count;
1420};
1421
1428 /* current loadavg, ala getloadavg() */
1429 float loadavg;
1430 /* 5 min loadavg */
1432 /* 15 min loadavg */
1434};
1435
1446
1453
1463 const char *document_root);
1464
1470AP_DECLARE(void) ap_set_document_root(request_rec *r, const char *document_root);
1471
1479AP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
1480
1489AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
1490
1491/* String handling. The *_nc variants allow you to use non-const char **s as
1492 arguments (unfortunately C won't automatically convert a char ** to a const
1493 char **) */
1494
1502AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
1503
1512AP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
1513
1521AP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);
1522
1531AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
1532
1541AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line,
1542 char stop);
1543
1553AP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
1554
1561AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);
1562
1570AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
1571
1579AP_DECLARE(char *) ap_getword_conf2(apr_pool_t *p, const char **line);
1580
1589AP_DECLARE(char *) ap_getword_conf2_nc(apr_pool_t *p, char **line);
1590
1601AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word);
1602
1612AP_DECLARE(const char *) ap_size_list_item(const char **field, int *len);
1613
1624AP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field);
1625
1634AP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
1635
1643AP_DECLARE(int) ap_find_etag_weak(apr_pool_t *p, const char *line, const char *tok);
1644
1652AP_DECLARE(int) ap_find_etag_strong(apr_pool_t *p, const char *line, const char *tok);
1653
1654/* Scan a string for field content chars, as defined by RFC7230 section 3.2
1655 * including VCHAR/obs-text, as well as HT and SP
1656 * @param ptr The string to scan
1657 * @return A pointer to the first (non-HT) ASCII ctrl character.
1658 * @note lws and trailing whitespace are scanned, the caller is responsible
1659 * for trimming leading and trailing whitespace
1660 */
1661AP_DECLARE(const char *) ap_scan_http_field_content(const char *ptr);
1662
1663/* Scan a string for token characters, as defined by RFC7230 section 3.2.6
1664 * @param ptr The string to scan
1665 * @return A pointer to the first non-token character.
1666 */
1667AP_DECLARE(const char *) ap_scan_http_token(const char *ptr);
1668
1669/* Scan a string for visible ASCII (0x21-0x7E) or obstext (0x80+)
1670 * and return a pointer to the first SP/CTL/NUL character encountered.
1671 * @param ptr The string to scan
1672 * @return A pointer to the first SP/CTL character.
1673 */
1674AP_DECLARE(const char *) ap_scan_vchar_obstext(const char *ptr);
1675
1689AP_DECLARE(const char *) ap_parse_token_list_strict(apr_pool_t *p, const char *tok,
1690 apr_array_header_t **tokens,
1691 int skip_invalid);
1692
1703AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
1704
1712AP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
1713
1721AP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
1722
1728AP_DECLARE(int) ap_is_url(const char *u);
1729
1735AP_DECLARE(int) ap_unescape_all(char *url);
1736
1742AP_DECLARE(int) ap_unescape_url(char *url);
1743
1750AP_DECLARE(int) ap_unescape_url_keep2f(char *url, int decode_slashes);
1751
1752#define AP_UNESCAPE_URL_KEEP_UNRESERVED (1u << 0)
1753#define AP_UNESCAPE_URL_FORBID_SLASHES (1u << 1)
1754#define AP_UNESCAPE_URL_KEEP_SLASHES (1u << 2)
1755
1762AP_DECLARE(int) ap_unescape_url_ex(char *url, unsigned int flags);
1763
1770
1776AP_DECLARE(void) ap_no2slash(char *name);
1777
1785AP_DECLARE(void) ap_no2slash_ex(char *name, int is_fs_path);
1786
1787#define AP_NORMALIZE_ALLOW_RELATIVE (1u << 0)
1788#define AP_NORMALIZE_NOT_ABOVE_ROOT (1u << 1)
1789#define AP_NORMALIZE_DECODE_UNRESERVED (1u << 2)
1790#define AP_NORMALIZE_MERGE_SLASHES (1u << 3)
1791#define AP_NORMALIZE_DROP_PARAMETERS (0) /* deprecated */
1792
1800AP_DECLARE(int) ap_normalize_path(char *path, unsigned int flags);
1801
1807AP_DECLARE(void) ap_getparents(char *name);
1808
1815AP_DECLARE(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
1816
1823AP_DECLARE(char *) ap_escape_path_segment_buffer(char *c, const char *s);
1824
1833AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
1834
1836#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
1837
1844AP_DECLARE(char *) ap_escape_urlencoded(apr_pool_t *p, const char *s);
1845
1852AP_DECLARE(char *) ap_escape_urlencoded_buffer(char *c, const char *s);
1853
1860#define ap_escape_html(p,s) ap_escape_html2(p,s,0)
1868AP_DECLARE(char *) ap_escape_html2(apr_pool_t *p, const char *s, int toasc);
1869
1876AP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str);
1877
1885AP_DECLARE(apr_size_t) ap_escape_errorlog_item(char *dest, const char *source,
1886 apr_size_t buflen);
1887
1896AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
1897 apr_port_t port, const request_rec *r);
1898
1905AP_DECLARE(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s);
1906
1912AP_DECLARE(int) ap_count_dirs(const char *path);
1913
1925AP_DECLARE(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
1926
1934AP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
1935
1948AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f);
1949
1959
1967AP_DECLARE(int) ap_is_matchexp(const char *str);
1968
1975AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected);
1976
1984AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected);
1985
1993AP_DECLARE(char *) ap_strcasestr(const char *s1, const char *s2);
1994
2001AP_DECLARE(const char *) ap_stripprefix(const char *bigstring,
2002 const char *prefix);
2003
2010AP_DECLARE(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
2011
2018AP_DECLARE(char *) ap_pbase64encode(apr_pool_t *p, char *string);
2019
2034 int cflags);
2035
2044
2058AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input,
2059 const char *source, apr_size_t nmatch,
2061
2077 const char *input, const char *source,
2078 apr_size_t nmatch,
2080 apr_size_t maxlen);
2081
2088
2093AP_DECLARE(void) ap_str_tolower(char *s);
2094
2099AP_DECLARE(void) ap_str_toupper(char *s);
2100
2108AP_DECLARE(int) ap_ind(const char *str, char c); /* Sigh... */
2109
2117AP_DECLARE(int) ap_rind(const char *str, char c);
2118
2125AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring);
2126
2137AP_DECLARE(char *) ap_append_pid(apr_pool_t *p, const char *string,
2138 const char *delim);
2139
2147AP_DECLARE(int) ap_parse_strict_length(apr_off_t *len, const char *str);
2148
2168 const char *timeout_parameter,
2170 const char *default_time_unit);
2171
2179
2191 const char **dest);
2192
2202AP_DECLARE(apr_status_t) ap_str2_alnum(const char *src, char *dest);
2203
2212typedef struct {
2213 const char *name;
2216
2228 apr_array_header_t **ptr,
2229 apr_size_t num, apr_size_t size);
2230
2231/* Misc system hackery */
2238AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *name);
2239
2246AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *name);
2247
2248#ifdef _OSD_POSIX
2249extern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
2250#endif /* _OSD_POSIX */
2251
2258
2265AP_DECLARE(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
2266 __attribute__((noreturn));
2267
2271#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
2272
2280#ifdef AP_DEBUG
2281#define AP_DEBUG_ASSERT(exp) ap_assert(exp)
2282#else
2283#define AP_DEBUG_ASSERT(exp) ((void)0)
2284#endif
2285
2295#define SIGSTOP_DETACH 1
2297#define SIGSTOP_MAKE_CHILD 2
2299#define SIGSTOP_SPAWN_CHILD 4
2301#define SIGSTOP_PIPED_LOG_SPAWN 8
2303#define SIGSTOP_CGI_CHILD 16
2304
2306#ifdef DEBUG_SIGSTOP
2307extern int raise_sigstop_flags;
2308#define RAISE_SIGSTOP(x) do { \
2309 if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
2310 } while (0)
2311#else
2312#define RAISE_SIGSTOP(x)
2313#endif
2321AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r);
2322
2323 /* The C library has functions that allow const to be silently dropped ...
2324 these macros detect the drop in maintainer mode, but use the native
2325 methods for normal builds
2326
2327 Note that on some platforms (e.g., AIX with gcc, Solaris with gcc), string.h needs
2328 to be included before the macros are defined or compilation will fail.
2329 */
2330#include <string.h>
2331
2332AP_DECLARE(char *) ap_strchr(char *s, int c);
2333AP_DECLARE(const char *) ap_strchr_c(const char *s, int c);
2334AP_DECLARE(char *) ap_strrchr(char *s, int c);
2335AP_DECLARE(const char *) ap_strrchr_c(const char *s, int c);
2336AP_DECLARE(char *) ap_strstr(char *s, const char *c);
2337AP_DECLARE(const char *) ap_strstr_c(const char *s, const char *c);
2338
2339#ifdef AP_DEBUG
2340
2341#undef strchr
2342# define strchr(s, c) ap_strchr(s,c)
2343#undef strrchr
2344# define strrchr(s, c) ap_strrchr(s,c)
2345#undef strstr
2346# define strstr(s, c) ap_strstr(s,c)
2347
2348#else
2349
2351# define ap_strchr(s, c) strchr(s, c)
2353# define ap_strchr_c(s, c) strchr(s, c)
2355# define ap_strrchr(s, c) strrchr(s, c)
2357# define ap_strrchr_c(s, c) strrchr(s, c)
2359# define ap_strstr(s, c) strstr(s, c)
2361# define ap_strstr_c(s, c) strstr(s, c)
2362
2363#endif
2364
2374AP_DECLARE(void) ap_random_insecure_bytes(void *buf, apr_size_t size);
2375
2382AP_DECLARE(apr_uint32_t) ap_random_pick(apr_uint32_t min, apr_uint32_t max);
2383
2387AP_DECLARE(void) ap_abort_on_oom(void) __attribute__((noreturn));
2388
2395AP_DECLARE(void *) ap_malloc(size_t size)
2396 __attribute__((malloc))
2398
2406AP_DECLARE(void *) ap_calloc(size_t nelem, size_t size)
2407 __attribute__((malloc))
2409
2417AP_DECLARE(void *) ap_realloc(void *ptr, size_t size)
2420
2421#if APR_HAS_THREADS
2422
2423#if APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL)
2424
2428#if APR_HAS_THREAD_LOCAL
2429#define AP_HAS_THREAD_LOCAL 1
2430#define AP_THREAD_LOCAL APR_THREAD_LOCAL
2431#else
2432#define AP_HAS_THREAD_LOCAL 0
2433#endif
2434#define ap_thread_create apr_thread_create
2435#define ap_thread_current apr_thread_current
2436#define ap_thread_current_create apr_thread_current_create
2437#define ap_thread_current_after_fork apr_thread_current_after_fork
2438
2439#else /* APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL) */
2440
2441#ifndef AP_NO_THREAD_LOCAL
2445#if defined(__cplusplus) && __cplusplus >= 201103L
2446#define AP_THREAD_LOCAL thread_local
2447#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112 && \
2448 (!defined(__GNUC__) || \
2449 __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))
2450#define AP_THREAD_LOCAL _Thread_local
2451#elif defined(__GNUC__) /* works for clang too */
2452#define AP_THREAD_LOCAL __thread
2453#elif defined(WIN32) && defined(_MSC_VER)
2454#define AP_THREAD_LOCAL __declspec(thread)
2455#endif
2456#endif /* ndef AP_NO_THREAD_LOCAL */
2457
2458#ifndef AP_THREAD_LOCAL
2459#define AP_HAS_THREAD_LOCAL 0
2460#define ap_thread_create apr_thread_create
2461#else /* AP_THREAD_LOCAL */
2462#define AP_HAS_THREAD_LOCAL 1
2463AP_DECLARE(apr_status_t) ap_thread_create(apr_thread_t **thread,
2466 void *data, apr_pool_t *pool);
2467#endif /* AP_THREAD_LOCAL */
2468
2469AP_DECLARE(apr_status_t) ap_thread_current_create(apr_thread_t **current,
2471 apr_pool_t *pool);
2472AP_DECLARE(void) ap_thread_current_after_fork(void);
2473AP_DECLARE(apr_thread_t *) ap_thread_current(void);
2474
2475#endif /* APR_VERSION_AT_LEAST(1,8,0) && !defined(AP_NO_THREAD_LOCAL) */
2476
2477AP_DECLARE(apr_status_t) ap_thread_main_create(apr_thread_t **thread,
2478 apr_pool_t *pool);
2479
2480#else /* APR_HAS_THREADS */
2481
2482#define AP_HAS_THREAD_LOCAL 0
2483
2484#endif /* APR_HAS_THREADS */
2485
2491
2497
2505AP_DECLARE(void) ap_bin2hex(const void *src, apr_size_t srclen, char *dest);
2506
2516 const char *cmd,
2517 const char * const *argv);
2518
2519#define AP_NORESTART APR_OS_START_USEERR + 1
2520
2531 const char *s,
2532 int start);
2533
2541 const char *s);
2542
2555AP_DECLARE(int) ap_cstr_casecmp(const char *s1, const char *s2);
2556
2569AP_DECLARE(int) ap_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n);
2570
2574#define AP_DIR_FLAG_NONE 0
2575
2580#define AP_DIR_FLAG_OPTIONAL 1
2581
2586#define AP_DIR_FLAG_RECURSIVE 2
2587
2592
2602 const char *prefix;
2604 const char *(*cb)(ap_dir_match_t *w, const char *fname);
2606 void *ctx;
2610 unsigned int depth;
2611};
2612
2634 __attribute__((nonnull(1,2)));
2635
2654AP_DECLARE(const char *)ap_dir_fnmatch(ap_dir_match_t *w, const char *path,
2655 const char *fname) __attribute__((nonnull(1,3)));
2656
2664AP_DECLARE(int) ap_is_chunked(apr_pool_t *p, const char *line);
2665
2666
2682 const char *rootpath,
2683 const char *addpath,
2684 apr_int32_t flags,
2685 apr_pool_t *p);
2686
2687#ifdef WIN32
2688#define apr_filepath_merge ap_filepath_merge
2689#endif
2690
2691/* Win32/NetWare/OS2 need to check for both forward and back slashes
2692 * in ap_normalize_path() and ap_escape_url().
2693 */
2694#ifdef CASE_BLIND_FILESYSTEM
2695#define AP_IS_SLASH(s) ((s == '/') || (s == '\\'))
2696#define AP_SLASHES "/\\"
2697#else
2698#define AP_IS_SLASH(s) (s == '/')
2699#define AP_SLASHES "/"
2700#endif
2701
2702#ifdef __cplusplus
2703}
2704#endif
2705
2706#endif /* !APACHE_HTTPD_H */
2707
Symbol export macros and hook functions.
#define AP_FN_ATTR_WARN_UNUSED_RESULT
Definition ap_config.h:193
#define AP_FN_ATTR_ALLOC_SIZE2(x, y)
Definition ap_config.h:203
#define AP_FN_ATTR_ALLOC_SIZE(x)
Definition ap_config.h:202
#define AP_DECLARE(type)
Definition ap_config.h:67
Module Magic Number.
Apache Regex defines.
int n
Definition ap_regex.h:278
const char * pattern
Definition ap_regex.h:243
const char apr_size_t ap_regmatch_t * pmatch
Definition ap_regex.h:172
const char int cflags
Definition ap_regex.h:159
const char apr_size_t len
Definition ap_regex.h:187
const char apr_size_t nmatch
Definition ap_regex.h:172
Version Release defines.
APR-UTIL Buckets/Bucket Brigades.
APR Miscellaneous library routines.
APR Network library.
APR Poll interface.
APR memory allocation.
#define min(a, b)
Definition apr_random.c:32
apr_size_t const unsigned char unsigned int unsigned int d
Definition apr_siphash.h:72
APR Table library.
APR Thread and Process Library.
APR Time Library.
APR-UTIL URI Routines.
APR Versioning Interface.
static int one_process
Definition event.c:435
static apr_pool_t * pconf
Definition event.c:441
struct ap_conf_vector_t ap_conf_vector_t
const char * hostname
request_rec int int apr_table_t const char * path
request_rec * r
void ap_get_server_revision(ap_version_t *version)
Definition core.c:3579
void ap_add_version_component(apr_pool_t *pconf, const char *component)
Definition core.c:3598
const char * ap_get_server_built(void)
Definition buildmark.c:26
const char * ap_get_server_description(void)
Definition core.c:3587
const char * ap_get_server_banner(void)
Definition core.c:3593
const unsigned char * buf
Definition util_md5.h:50
const char apr_port_t port
Definition http_vhost.h:125
apr_file_t * f
apr_file_t apr_off_t start
apr_bucket apr_bucket_brigade * a
apr_pool_t apr_dbd_t const char * query
Definition apr_dbd.h:396
const char * src
Definition apr_encode.h:167
const char apr_ssize_t int flags
Definition apr_encode.h:168
const char * url
Definition apr_escape.h:120
const char apr_ssize_t int partial
Definition apr_escape.h:188
const void apr_size_t srclen
Definition apr_escape.h:355
const char apr_ssize_t int toasc
Definition apr_escape.h:254
char * ap_append_pid(apr_pool_t *p, const char *string, const char *delim)
Definition util.c:2595
#define ap_strchr(s, c)
Definition httpd.h:2351
int ap_array_str_index(const apr_array_header_t *array, const char *s, int start)
Definition util.c:3428
#define ap_strstr(s, c)
Definition httpd.h:2359
void ap_random_insecure_bytes(void *buf, apr_size_t size)
Definition core.c:5455
char * ap_getword_white(apr_pool_t *p, const char **line)
Definition util.c:751
int ap_strcmp_match(const char *str, const char *expected)
Definition util.c:175
ap_conn_keepalive_e
Enumeration of connection keepalive options.
Definition httpd.h:1143
int ap_strcasecmp_match(const char *str, const char *expected)
Definition util.c:199
void ap_set_document_root(request_rec *r, const char *document_root)
Definition core.c:857
char * ap_get_exec_line(apr_pool_t *p, const char *cmd, const char *const *argv)
Definition util.c:3386
char * ap_getword_white_nc(apr_pool_t *p, char **line)
Definition util.c:746
const char const char int ap_is_chunked(apr_pool_t *p, const char *line)
Definition util.c:1786
int ap_is_directory(apr_pool_t *p, const char *name)
Definition util.c:2326
char * ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop)
Definition util.c:773
#define ap_strrchr(s, c)
Definition httpd.h:2355
char * ap_escape_urlencoded_buffer(char *c, const char *s)
Definition util.c:2102
char * ap_get_local_host(apr_pool_t *p)
Definition util.c:2429
int ap_is_url(const char *u)
Definition util.c:2377
char * ap_make_full_path(apr_pool_t *a, const char *dir, const char *f)
Definition util.c:2346
int ap_count_dirs(const char *path)
Definition util.c:708
const char * ap_scan_http_token(const char *ptr)
Definition util.c:1664
char * ap_getword_conf2(apr_pool_t *p, const char **line)
Definition util.c:882
int ap_cstr_casecmp(const char *s1, const char *s2)
Definition util.c:3542
const char * ap_psignature(const char *prefix, request_rec *r)
Definition core.c:3516
const char * ap_parse_token_list_strict(apr_pool_t *p, const char *tok, apr_array_header_t **tokens, int skip_invalid)
Definition util.c:1562
char * ap_pbase64encode(apr_pool_t *p, char *string)
Definition util.c:2487
char * ap_make_dirstr_prefix(char *d, const char *s, int n)
Definition util.c:669
void ap_get_loadavg(ap_loadavg_t *ld)
Definition util.c:3360
int ap_unescape_url_ex(char *url, unsigned int flags)
Definition util.c:1955
char * ap_getword(apr_pool_t *p, const char **line, char stop)
Definition util.c:723
char * ap_escape_logitem(apr_pool_t *p, const char *str)
Definition util.c:2183
char * ap_escape_path_segment(apr_pool_t *p, const char *s)
Definition util.c:2068
int ap_normalize_path(char *path, unsigned int flags)
Definition util.c:489
#define ap_strrchr_c(s, c)
Definition httpd.h:2357
char * ap_strcasestr(const char *s1, const char *s2)
Definition util.c:289
#define ap_strstr_c(s, c)
Definition httpd.h:2361
int ap_find_etag_weak(apr_pool_t *p, const char *line, const char *tok)
Definition util.c:1555
char * ap_getword_conf_nc(apr_pool_t *p, char **line)
Definition util.c:828
char * ap_escape_path_segment_buffer(char *c, const char *s)
Definition util.c:2049
void ap_set_context_info(request_rec *r, const char *prefix, const char *document_root)
Definition core.c:863
void ap_bin2hex(const void *src, apr_size_t srclen, char *dest)
Definition util.c:2314
int ap_unescape_urlencoded(char *query)
Definition util.c:1977
void ap_log_assert(const char *szExp, const char *szFile, int nLine) __attribute__((noreturn))
Definition log.c:1743
char * ap_escape_shell_cmd(apr_pool_t *p, const char *s)
Definition util.c:1812
const char * ap_dir_nofnmatch(ap_dir_match_t *w, const char *fname) __attribute__((nonnull(1
#define ap_strchr_c(s, c)
Definition httpd.h:2353
char * ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white)
Definition util.c:1687
conn_state_e
Definition httpd.h:1258
const char * ap_context_prefix(request_rec *r)
Definition core.c:839
const char * ap_context_document_root(request_rec *r)
Definition core.c:848
const char * ap_resolve_env(apr_pool_t *p, const char *word)
Definition core.c:1376
char * ap_get_list_item(apr_pool_t *p, const char **field)
Definition util.c:1314
void ap_no2slash(char *name)
Definition util.c:640
int ap_find_etag_strong(apr_pool_t *p, const char *line, const char *tok)
Definition util.c:1546
int ap_unescape_all(char *url)
Definition util.c:2005
apr_status_t ap_str2_alnum(const char *src, char *dest)
Definition util.c:2717
void ap_str_toupper(char *s)
Definition util.c:2418
char * ap_make_dirstr_parent(apr_pool_t *p, const char *s)
Definition util.c:692
int ap_rind(const char *str, char c)
Definition util.c:2401
char * ap_pregsub(apr_pool_t *p, const char *input, const char *source, apr_size_t nmatch, ap_regmatch_t pmatch[])
Definition util.c:457
void ap_abort_on_oom(void) __attribute__((noreturn))
Definition util.c:3136
int ap_is_rdirectory(apr_pool_t *p, const char *name)
Definition util.c:2336
char * ap_getword_conf2_nc(apr_pool_t *p, char **line)
Definition util.c:877
apr_status_t ap_filepath_merge(char **newpath, const char *rootpath, const char *addpath, apr_int32_t flags, apr_pool_t *p)
Definition core.c:5712
int ap_request_has_body(request_rec *r)
Definition util.c:2698
char * ap_pbase64decode(apr_pool_t *p, const char *bufcoded)
Definition util.c:2477
const char * ap_scan_vchar_obstext(const char *ptr)
Definition util.c:1674
void ap_content_type_tolower(char *s)
Definition util.c:2505
int ap_find_token(apr_pool_t *p, const char *line, const char *tok)
Definition util.c:1726
void ap_getparents(char *name)
Definition util.c:602
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)
Definition util.c:2787
char * ap_getword_nulls(apr_pool_t *p, const char **line, char stop)
Definition util.c:779
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)
Definition util.c:469
int ap_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n)
Definition util.c:3559
void * ap_calloc(size_t nelem, size_t size) __attribute__((malloc))
Definition util.c:3160
char * ap_escape_html2(apr_pool_t *p, const char *s, int toasc)
Definition util.c:2131
conn_sense_e
Definition httpd.h:1271
int ap_is_matchexp(const char *str)
Definition util.c:240
const char * ap_scan_http_field_content(const char *ptr)
Definition util.c:1654
char * ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt)
Definition util.c:109
void ap_no2slash_ex(char *name, int is_fs_path)
Definition util.c:610
void ap_str_tolower(char *s)
Definition util.c:2410
int ap_parse_strict_length(apr_off_t *len, const char *str)
Definition util.c:2683
char * ap_escape_urlencoded(apr_pool_t *p, const char *s)
Definition util.c:2124
apr_size_t ap_escape_errorlog_item(char *dest, const char *source, apr_size_t buflen)
Definition util.c:2251
int ap_array_str_contains(const apr_array_header_t *array, const char *s)
Definition util.c:3446
int ap_unescape_url(char *url)
Definition util.c:1939
char * ap_construct_server(apr_pool_t *p, const char *hostname, apr_port_t port, const request_rec *r)
Definition util.c:1994
int ap_ind(const char *str, char c)
Definition util.c:2392
apr_status_t ap_pstr2_alnum(apr_pool_t *p, const char *src, const char **dest)
Definition util.c:2733
ap_regex_t * ap_pregcomp(apr_pool_t *p, const char *pattern, int cflags)
Definition util.c:262
char * ap_field_noparam(apr_pool_t *p, const char *intype)
Definition util.c:91
const char * ap_size_list_item(const char **field, int *len)
Definition util.c:1254
apr_uint32_t ap_random_pick(apr_uint32_t min, apr_uint32_t max)
Definition core.c:5485
void * ap_realloc(void *ptr, size_t size)
Definition util.c:3168
int ap_unescape_url_keep2f(char *url, int decode_slashes)
Definition util.c:1944
void ap_pregfree(apr_pool_t *p, ap_regex_t *reg)
Definition util.c:279
const char * ap_stripprefix(const char *bigstring, const char *prefix)
Definition util.c:328
char * ap_os_escape_path(apr_pool_t *p, const char *path, int partial)
Definition util.c:2073
void ap_get_sload(ap_sload_t *ld)
Definition util.c:3305
int ap_find_list_item(apr_pool_t *p, const char *line, const char *tok)
Definition util.c:1537
apr_status_t ap_timeout_parameter_parse(const char *timeout_parameter, apr_interval_time_t *timeout, const char *default_time_unit)
Definition util.c:2622
char * ap_getword_nc(apr_pool_t *p, char **line, char stop)
Definition util.c:718
void * ap_malloc(size_t size) __attribute__((malloc))
Definition util.c:3152
char * ap_escape_quotes(apr_pool_t *p, const char *instring)
Definition util.c:2524
int ap_find_last_token(apr_pool_t *p, const char *line, const char *tok)
Definition util.c:1780
const char const char * ap_dir_fnmatch(ap_dir_match_t *w, const char *path, const char *fname) __attribute__((nonnull(1
char * ap_getword_conf(apr_pool_t *p, const char **line)
Definition util.c:833
int ap_os_is_path_absolute(apr_pool_t *p, const char *dir)
Definition util.c:229
@ AP_CONN_KEEPALIVE
Definition httpd.h:1146
@ AP_CONN_UNKNOWN
Definition httpd.h:1144
@ AP_CONN_CLOSE
Definition httpd.h:1145
@ CONN_STATE_NUM
Definition httpd.h:1268
@ CONN_STATE_LINGER
Definition httpd.h:1264
@ CONN_STATE_LINGER_NORMAL
Definition httpd.h:1265
@ CONN_STATE_READ_REQUEST_LINE
Definition httpd.h:1260
@ CONN_STATE_LINGER_SHORT
Definition httpd.h:1266
@ CONN_STATE_CHECK_REQUEST_LINE_READABLE
Definition httpd.h:1259
@ CONN_STATE_WRITE_COMPLETION
Definition httpd.h:1262
@ CONN_STATE_SUSPENDED
Definition httpd.h:1263
@ CONN_STATE_HANDLER
Definition httpd.h:1261
@ CONN_SENSE_WANT_WRITE
Definition httpd.h:1274
@ CONN_SENSE_DEFAULT
Definition httpd.h:1272
@ CONN_SENSE_WANT_READ
Definition httpd.h:1273
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
const char * input
Definition apr_cstr.h:93
int apr_status_t
Definition apr_errno.h:44
void * data
const char * fname
const char const char * addpath
const char * rootpath
apr_array_header_t ** result
apr_vformatter_buff_t const char * fmt
Definition apr_lib.h:175
apr_vformatter_buff_t * c
Definition apr_lib.h:175
apr_sockaddr_t apr_sockaddr_t apr_sockaddr_t * source
apr_interval_time_t t
apr_size_t buflen
apr_uint16_t apr_port_t
apr_interval_time_t apr_int32_t * num
Definition apr_poll.h:273
apr_interval_time_t apr_pollcb_cb_t func
Definition apr_poll.h:422
const char apr_status_t(*) apr_pool_t *poo __attribute__)((nonnull(2, 4)))
Definition apr_pools.h:567
apr_dir_t * dir
const char * s
Definition apr_strings.h:95
void *(APR_THREAD_FUNC * apr_thread_start_t)(apr_thread_t *, void *)
const char const char *const const char *const apr_procattr_t * attr
apr_cmdtype_e cmd
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
apr_size_t apr_size_t max
Definition apr_time.h:220
apr_int64_t apr_time_t
Definition apr_time.h:45
apr_uint64_t ap_request_bnotes_t
Definition httpd.h:662
apr_pool_t * p
Definition md_event.c:32
const char * argv[3]
char * name
void * ctx
Definition httpd.h:2606
const char * prefix
Definition httpd.h:2602
apr_pool_t * p
Definition httpd.h:2598
apr_pool_t * ptemp
Definition httpd.h:2600
unsigned int depth
Definition httpd.h:2610
The representation of a filter chain.
apr_bucket_brigade * value
Definition httpd.h:2214
const char * name
Definition httpd.h:2213
A structure to hold various server loadavg.
Definition httpd.h:1427
float loadavg5
Definition httpd.h:1431
float loadavg
Definition httpd.h:1429
float loadavg15
Definition httpd.h:1433
signed char * module_levels
Definition httpd.h:1314
int level
Definition httpd.h:1317
Structure for handling HTTP methods.
Definition httpd.h:643
apr_array_header_t * method_list
Definition httpd.h:647
apr_int64_t method_mask
Definition httpd.h:645
A structure to hold server load params.
Definition httpd.h:1411
apr_off_t bytes_served
Definition httpd.h:1417
unsigned long access_count
Definition httpd.h:1419
int idle
Definition httpd.h:1413
int busy
Definition httpd.h:1415
The numeric version information is broken out into fields within this structure.
Definition httpd.h:409
int patch
Definition httpd.h:412
int minor
Definition httpd.h:411
int major
Definition httpd.h:410
const char * add_string
Definition httpd.h:413
Structure to store things which are per connection.
Definition httpd.h:1152
unsigned int clogging_input_filters
Definition httpd.h:1212
const struct ap_logconf * log
Definition httpd.h:1230
char * remote_logname
Definition httpd.h:1178
int data_in_output_filters
Definition httpd.h:1207
apr_sockaddr_t * client_addr
Definition httpd.h:1166
conn_state_t * cs
Definition httpd.h:1203
apr_pool_t * pool
Definition httpd.h:1154
server_rec * base_server
Definition httpd.h:1156
ap_conn_keepalive_e keepalive
Definition httpd.h:1223
apr_sockaddr_t * local_addr
Definition httpd.h:1162
struct ap_filter_t * input_filters
Definition httpd.h:1195
struct ap_filter_t * output_filters
Definition httpd.h:1197
int outgoing
Definition httpd.h:1250
struct apr_bucket_alloc_t * bucket_alloc
Definition httpd.h:1201
signed int double_reverse
Definition httpd.h:1216
char * client_ip
Definition httpd.h:1171
apr_table_t * notes
Definition httpd.h:1193
const char * log_id
Definition httpd.h:1235
char * local_host
Definition httpd.h:1184
int keepalives
Definition httpd.h:1226
char * remote_host
Definition httpd.h:1175
conn_rec * master
Definition httpd.h:1248
struct ap_conf_vector_t * conn_config
Definition httpd.h:1190
void * vhost_lookup_data
Definition httpd.h:1158
int data_in_input_filters
Definition httpd.h:1205
char * local_ip
Definition httpd.h:1181
unsigned aborted
Definition httpd.h:1219
void * sbh
Definition httpd.h:1199
long id
Definition httpd.h:1187
A structure to contain connection state information.
Definition httpd.h:1280
conn_state_e state
Definition httpd.h:1282
conn_sense_e sense
Definition httpd.h:1284
This represents the result of calling htaccess; these are cached for each request.
Definition httpd.h:788
const char * dir
Definition httpd.h:790
apr_table_t * override_list
Definition httpd.h:796
struct ap_conf_vector_t * htaccess
Definition httpd.h:798
const struct htaccess_result * next
Definition httpd.h:800
int override_opts
Definition httpd.h:794
A structure that represents one process.
Definition httpd.h:829
int argc
Definition httpd.h:839
apr_pool_t * pool
Definition httpd.h:831
const char * short_name
Definition httpd.h:835
apr_pool_t * pconf
Definition httpd.h:833
const char *const * argv
Definition httpd.h:837
A structure that represents the current request.
Definition httpd.h:845
char * user
Definition httpd.h:1005
char * useragent_host
Definition httpd.h:1111
apr_array_header_t * content_languages
Definition httpd.h:999
int status
Definition httpd.h:891
int eos_sent
Definition httpd.h:1039
apr_off_t bytes_sent
Definition httpd.h:931
char * uri
Definition httpd.h:1016
const char * content_type
Definition httpd.h:992
apr_table_t * trailers_in
Definition httpd.h:1104
apr_table_t * body_table
Definition httpd.h:957
struct ap_filter_t * output_filters
Definition httpd.h:1070
int double_reverse
Definition httpd.h:1115
char * useragent_ip
Definition httpd.h:1101
request_rec * prev
Definition httpd.h:856
int assbackwards
Definition httpd.h:868
int read_body
Definition httpd.h:947
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
int used_path_info
Definition httpd.h:1036
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_off_t remaining
Definition httpd.h:959
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
apr_bucket_brigade * kept_body
Definition httpd.h:953
ap_method_list_t * allowed_methods
Definition httpd.h:926
apr_array_header_t * allowed_xmethods
Definition httpd.h:924
int no_cache
Definition httpd.h:1082
const char * log_id
Definition httpd.h:1059
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
const struct ap_logconf * log
Definition httpd.h:1054
ap_request_bnotes_t bnotes
Definition httpd.h:1120
int proto_num
Definition httpd.h:877
int chunked
Definition httpd.h:942
struct ap_filter_t * input_filters
Definition httpd.h:1072
struct ap_conf_vector_t * request_config
Definition httpd.h:1049
apr_table_t * headers_in
Definition httpd.h:976
char * protocol
Definition httpd.h:879
apr_int64_t allowed
Definition httpd.h:922
const char * range
Definition httpd.h:938
int read_chunked
Definition httpd.h:949
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
apr_off_t sent_bodyct
Definition httpd.h:929
server_rec * server
Definition httpd.h:851
struct ap_conf_vector_t * per_dir_config
Definition httpd.h:1047
apr_off_t clength
Definition httpd.h:940
char * vlist_validator
Definition httpd.h:1002
const char * status_line
Definition httpd.h:889
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
char * ap_auth_type
Definition httpd.h:1007
apr_table_t * headers_out
Definition httpd.h:978
A structure to be used for Per-vhost config.
Definition httpd.h:1301
apr_port_t host_port
Definition httpd.h:1309
server_addr_rec * next
Definition httpd.h:1303
char * virthost
Definition httpd.h:1305
apr_sockaddr_t * host_addr
Definition httpd.h:1307
A structure to store information for each virtual server.
Definition httpd.h:1322
const char * path
Definition httpd.h:1386
int pathlen
Definition httpd.h:1388
apr_interval_time_t timeout
Definition httpd.h:1372
process_rec * process
Definition httpd.h:1324
int limit_req_line
Definition httpd.h:1391
unsigned defn_line_number
Definition httpd.h:1348
apr_interval_time_t keep_alive_timeout
Definition httpd.h:1374
apr_array_header_t * names
Definition httpd.h:1381
apr_file_t * error_log
Definition httpd.h:1333
int keep_alive
Definition httpd.h:1378
const char * server_scheme
Definition httpd.h:1358
const char * defn_name
Definition httpd.h:1346
int limit_req_fieldsize
Definition httpd.h:1393
int limit_req_fields
Definition httpd.h:1395
int keep_alive_max
Definition httpd.h:1376
server_rec * next
Definition httpd.h:1326
server_addr_rec * addrs
Definition httpd.h:1370
char * server_hostname
Definition httpd.h:1365
void * context
Definition httpd.h:1398
apr_array_header_t * wild_names
Definition httpd.h:1383
struct ap_conf_vector_t * lookup_defaults
Definition httpd.h:1343
char * error_fname
Definition httpd.h:1331
char is_virtual
Definition httpd.h:1350
struct ap_conf_vector_t * module_config
Definition httpd.h:1341
unsigned int keep_alive_timeout_set
Definition httpd.h:1403
struct ap_logconf log
Definition httpd.h:1335
apr_port_t port
Definition httpd.h:1356
char * server_admin
Definition httpd.h:1363
#define str
IN ULONG IN INT timeout