00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00035 #ifndef APACHE_HTTPD_H
00036 #define APACHE_HTTPD_H
00037
00038
00039
00040
00041
00042
00043 #include "ap_config.h"
00044 #include "ap_mmn.h"
00045
00046 #include "ap_release.h"
00047
00048 #include "apr.h"
00049 #include "apr_general.h"
00050 #include "apr_tables.h"
00051 #include "apr_pools.h"
00052 #include "apr_time.h"
00053 #include "apr_network_io.h"
00054 #include "apr_buckets.h"
00055 #include "apr_poll.h"
00056
00057 #include "os.h"
00058
00059 #include "ap_regex.h"
00060
00061 #if APR_HAVE_STDLIB_H
00062 #include <stdlib.h>
00063 #endif
00064
00065
00066
00067 #ifdef __cplusplus
00068 extern "C" {
00069 #endif
00070
00071 #ifdef CORE_PRIVATE
00072
00073
00074
00078 #ifndef HTTPD_ROOT
00079 #ifdef OS2
00080
00081 #define HTTPD_ROOT "/os2httpd"
00082 #elif defined(WIN32)
00083
00084 #define HTTPD_ROOT "/apache"
00085 #elif defined (BEOS)
00086
00087 #define HTTPD_ROOT "/boot/home/apache"
00088 #elif defined (NETWARE)
00089
00090 #define HTTPD_ROOT "/apache"
00091 #else
00092
00093 #define HTTPD_ROOT "/usr/local/apache"
00094 #endif
00095 #endif
00096
00097
00098
00099
00100
00101
00102
00103
00104
00109 #ifndef DOCUMENT_LOCATION
00110 #ifdef OS2
00111
00112 #define DOCUMENT_LOCATION HTTPD_ROOT "/docs"
00113 #else
00114
00115 #define DOCUMENT_LOCATION HTTPD_ROOT "/htdocs"
00116 #endif
00117 #endif
00118
00120 #ifndef DYNAMIC_MODULE_LIMIT
00121 #define DYNAMIC_MODULE_LIMIT 128
00122 #endif
00123
00125 #define DEFAULT_ADMIN "[no address given]"
00126
00128 #ifndef DEFAULT_ERRORLOG
00129 #if defined(OS2) || defined(WIN32)
00130 #define DEFAULT_ERRORLOG "logs/error.log"
00131 #else
00132 #define DEFAULT_ERRORLOG "logs/error_log"
00133 #endif
00134 #endif
00135
00137 #ifndef DEFAULT_ACCESS_FNAME
00138 #ifdef OS2
00139
00140 #define DEFAULT_ACCESS_FNAME "htaccess"
00141 #else
00142 #define DEFAULT_ACCESS_FNAME ".htaccess"
00143 #endif
00144 #endif
00145
00147 #ifndef SERVER_CONFIG_FILE
00148 #define SERVER_CONFIG_FILE "conf/httpd.conf"
00149 #endif
00150
00152 #ifndef DEFAULT_PATH
00153 #define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
00154 #endif
00155
00157 #ifndef SUEXEC_BIN
00158 #define SUEXEC_BIN HTTPD_ROOT "/bin/suexec"
00159 #endif
00160
00162 #ifndef DEFAULT_TIMEOUT
00163 #define DEFAULT_TIMEOUT 300
00164 #endif
00165
00167 #ifndef DEFAULT_KEEPALIVE_TIMEOUT
00168 #define DEFAULT_KEEPALIVE_TIMEOUT 5
00169 #endif
00170
00172 #ifndef DEFAULT_KEEPALIVE
00173 #define DEFAULT_KEEPALIVE 100
00174 #endif
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00195 #ifndef DEFAULT_LIMIT_REQUEST_LINE
00196 #define DEFAULT_LIMIT_REQUEST_LINE 8190
00197 #endif
00198
00199 #ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE
00200 #define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190
00201 #endif
00202
00203 #ifndef DEFAULT_LIMIT_REQUEST_FIELDS
00204 #define DEFAULT_LIMIT_REQUEST_FIELDS 100
00205 #endif
00206
00211 #define DEFAULT_ADD_DEFAULT_CHARSET_NAME "iso-8859-1"
00212
00213 #endif
00214
00216 #define AP_SERVER_PROTOCOL "HTTP/1.1"
00217
00218
00219
00220
00222 #ifndef AP_DEFAULT_INDEX
00223 #define AP_DEFAULT_INDEX "index.html"
00224 #endif
00225
00226
00232 #ifndef DEFAULT_CONTENT_TYPE
00233 #define DEFAULT_CONTENT_TYPE "text/plain"
00234 #endif
00235
00240 #ifndef NO_CONTENT_TYPE
00241 #define NO_CONTENT_TYPE "none"
00242 #endif
00243
00245 #ifndef AP_TYPES_CONFIG_FILE
00246 #define AP_TYPES_CONFIG_FILE "conf/mime.types"
00247 #endif
00248
00249
00250
00251
00253 #define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
00254 "DTD HTML 2.0//EN\">\n"
00255
00256 #define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00257 "DTD HTML 3.2 Final//EN\">\n"
00258
00259 #define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00260 "DTD HTML 4.0//EN\"\n" \
00261 "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
00262
00263 #define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00264 "DTD HTML 4.0 Transitional//EN\"\n" \
00265 "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
00266
00267 #define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00268 "DTD HTML 4.0 Frameset//EN\"\n" \
00269 "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
00270
00271 #define DOCTYPE_XHTML_1_0S "<!DOCTYPE html PUBLIC \"-//W3C//" \
00272 "DTD XHTML 1.0 Strict//EN\"\n" \
00273 "\"http://www.w3.org/TR/xhtml1/DTD/" \
00274 "xhtml1-strict.dtd\">\n"
00275
00276 #define DOCTYPE_XHTML_1_0T "<!DOCTYPE html PUBLIC \"-//W3C//" \
00277 "DTD XHTML 1.0 Transitional//EN\"\n" \
00278 "\"http://www.w3.org/TR/xhtml1/DTD/" \
00279 "xhtml1-transitional.dtd\">\n"
00280
00281 #define DOCTYPE_XHTML_1_0F "<!DOCTYPE html PUBLIC \"-//W3C//" \
00282 "DTD XHTML 1.0 Frameset//EN\"\n" \
00283 "\"http://www.w3.org/TR/xhtml1/DTD/" \
00284 "xhtml1-frameset.dtd\">"
00285
00287 #define HTTP_VERSION(major,minor) (1000*(major)+(minor))
00288
00289 #define HTTP_VERSION_MAJOR(number) ((number)/1000)
00290
00291 #define HTTP_VERSION_MINOR(number) ((number)%1000)
00292
00293
00294
00296 #define DEFAULT_HTTP_PORT 80
00297
00298 #define DEFAULT_HTTPS_PORT 443
00299
00305 #define ap_is_default_port(port,r) ((port) == ap_default_port(r))
00306
00310 #define ap_default_port(r) ap_run_default_port(r)
00311
00315 #define ap_http_scheme(r) ap_run_http_scheme(r)
00316
00318 #define MAX_STRING_LEN HUGE_STRING_LEN
00319
00321 #define HUGE_STRING_LEN 8192
00322
00324 #define AP_IOBUFSIZE 8192
00325
00327 #define AP_MAX_REG_MATCH 10
00328
00335 #define AP_MAX_SENDFILE 16777216
00336
00343 #define APEXIT_OK 0x0
00344
00345 #define APEXIT_INIT 0x2
00346
00347 #define APEXIT_CHILDINIT 0x3
00348
00353 #define APEXIT_CHILDSICK 0x7
00354
00359 #define APEXIT_CHILDFATAL 0xf
00360
00361 #ifndef AP_DECLARE
00362
00367 # define AP_DECLARE(type) type
00368 #endif
00369
00370 #ifndef AP_DECLARE_NONSTD
00371
00378 # define AP_DECLARE_NONSTD(type) type
00379 #endif
00380 #ifndef AP_DECLARE_DATA
00381 # define AP_DECLARE_DATA
00382 #endif
00383
00384 #ifndef AP_MODULE_DECLARE
00385 # define AP_MODULE_DECLARE(type) type
00386 #endif
00387 #ifndef AP_MODULE_DECLARE_NONSTD
00388 # define AP_MODULE_DECLARE_NONSTD(type) type
00389 #endif
00390 #ifndef AP_MODULE_DECLARE_DATA
00391 # define AP_MODULE_DECLARE_DATA
00392 #endif
00393
00398 #ifndef AP_CORE_DECLARE
00399 # define AP_CORE_DECLARE AP_DECLARE
00400 #endif
00401
00407 #ifndef AP_CORE_DECLARE_NONSTD
00408 # define AP_CORE_DECLARE_NONSTD AP_DECLARE_NONSTD
00409 #endif
00410
00415 typedef struct {
00416 int major;
00417 int minor;
00418 int patch;
00419 const char *add_string;
00420 } ap_version_t;
00421
00428 AP_DECLARE(void) ap_get_server_revision(ap_version_t *version);
00429
00435 AP_DECLARE(const char *) ap_get_server_version(void);
00436
00443 AP_DECLARE(const char *) ap_get_server_banner(void);
00444
00452 AP_DECLARE(const char *) ap_get_server_description(void);
00453
00461 AP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
00462
00467 AP_DECLARE(const char *) ap_get_server_built(void);
00468
00469 #define DECLINED -1
00470 #define DONE -2
00473 #define OK 0
00485 #define RESPONSE_CODES 57
00486
00487 #define HTTP_CONTINUE 100
00488 #define HTTP_SWITCHING_PROTOCOLS 101
00489 #define HTTP_PROCESSING 102
00490 #define HTTP_OK 200
00491 #define HTTP_CREATED 201
00492 #define HTTP_ACCEPTED 202
00493 #define HTTP_NON_AUTHORITATIVE 203
00494 #define HTTP_NO_CONTENT 204
00495 #define HTTP_RESET_CONTENT 205
00496 #define HTTP_PARTIAL_CONTENT 206
00497 #define HTTP_MULTI_STATUS 207
00498 #define HTTP_MULTIPLE_CHOICES 300
00499 #define HTTP_MOVED_PERMANENTLY 301
00500 #define HTTP_MOVED_TEMPORARILY 302
00501 #define HTTP_SEE_OTHER 303
00502 #define HTTP_NOT_MODIFIED 304
00503 #define HTTP_USE_PROXY 305
00504 #define HTTP_TEMPORARY_REDIRECT 307
00505 #define HTTP_BAD_REQUEST 400
00506 #define HTTP_UNAUTHORIZED 401
00507 #define HTTP_PAYMENT_REQUIRED 402
00508 #define HTTP_FORBIDDEN 403
00509 #define HTTP_NOT_FOUND 404
00510 #define HTTP_METHOD_NOT_ALLOWED 405
00511 #define HTTP_NOT_ACCEPTABLE 406
00512 #define HTTP_PROXY_AUTHENTICATION_REQUIRED 407
00513 #define HTTP_REQUEST_TIME_OUT 408
00514 #define HTTP_CONFLICT 409
00515 #define HTTP_GONE 410
00516 #define HTTP_LENGTH_REQUIRED 411
00517 #define HTTP_PRECONDITION_FAILED 412
00518 #define HTTP_REQUEST_ENTITY_TOO_LARGE 413
00519 #define HTTP_REQUEST_URI_TOO_LARGE 414
00520 #define HTTP_UNSUPPORTED_MEDIA_TYPE 415
00521 #define HTTP_RANGE_NOT_SATISFIABLE 416
00522 #define HTTP_EXPECTATION_FAILED 417
00523 #define HTTP_UNPROCESSABLE_ENTITY 422
00524 #define HTTP_LOCKED 423
00525 #define HTTP_FAILED_DEPENDENCY 424
00526 #define HTTP_UPGRADE_REQUIRED 426
00527 #define HTTP_INTERNAL_SERVER_ERROR 500
00528 #define HTTP_NOT_IMPLEMENTED 501
00529 #define HTTP_BAD_GATEWAY 502
00530 #define HTTP_SERVICE_UNAVAILABLE 503
00531 #define HTTP_GATEWAY_TIME_OUT 504
00532 #define HTTP_VERSION_NOT_SUPPORTED 505
00533 #define HTTP_VARIANT_ALSO_VARIES 506
00534 #define HTTP_INSUFFICIENT_STORAGE 507
00535 #define HTTP_NOT_EXTENDED 510
00536
00538 #define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
00540 #define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
00542 #define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
00544 #define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
00546 #define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
00548 #define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
00550 #define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
00551
00553 #define ap_status_drops_connection(x) \
00554 (((x) == HTTP_BAD_REQUEST) || \
00555 ((x) == HTTP_REQUEST_TIME_OUT) || \
00556 ((x) == HTTP_LENGTH_REQUIRED) || \
00557 ((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
00558 ((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
00559 ((x) == HTTP_INTERNAL_SERVER_ERROR) || \
00560 ((x) == HTTP_SERVICE_UNAVAILABLE) || \
00561 ((x) == HTTP_NOT_IMPLEMENTED))
00578 #define M_GET 0
00579 #define M_PUT 1
00580 #define M_POST 2
00581 #define M_DELETE 3
00582 #define M_CONNECT 4
00583 #define M_OPTIONS 5
00584 #define M_TRACE 6
00585 #define M_PATCH 7
00586 #define M_PROPFIND 8
00587 #define M_PROPPATCH 9
00588 #define M_MKCOL 10
00589 #define M_COPY 11
00590 #define M_MOVE 12
00591 #define M_LOCK 13
00592 #define M_UNLOCK 14
00593 #define M_VERSION_CONTROL 15
00594 #define M_CHECKOUT 16
00595 #define M_UNCHECKOUT 17
00596 #define M_CHECKIN 18
00597 #define M_UPDATE 19
00598 #define M_LABEL 20
00599 #define M_REPORT 21
00600 #define M_MKWORKSPACE 22
00601 #define M_MKACTIVITY 23
00602 #define M_BASELINE_CONTROL 24
00603 #define M_MERGE 25
00604 #define M_INVALID 26
00610 #define METHODS 64
00611
00615 #define AP_METHOD_BIT ((apr_int64_t)1)
00620 typedef struct ap_method_list_t ap_method_list_t;
00621
00629 struct ap_method_list_t {
00631 apr_int64_t method_mask;
00633 apr_array_header_t *method_list;
00634 };
00635
00641 #define CGI_MAGIC_TYPE "application/x-httpd-cgi"
00642
00643 #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
00644
00645 #define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
00646
00647 #define DIR_MAGIC_TYPE "httpd/unix-directory"
00648
00650
00651 #if !APR_CHARSET_EBCDIC
00652
00653 #define LF 10
00654
00655 #define CR 13
00656
00657 #define CRLF "\015\012"
00658 #else
00659
00660
00661
00662
00663
00664
00665 #define CR '\r'
00666 #define LF '\n'
00667 #define CRLF "\r\n"
00668 #endif
00669
00677 #define REQUEST_NO_BODY 0
00678
00679 #define REQUEST_CHUNKED_ERROR 1
00680
00681 #define REQUEST_CHUNKED_DECHUNK 2
00682
00692 #define AP_REQ_ACCEPT_PATH_INFO 0
00693
00694 #define AP_REQ_REJECT_PATH_INFO 1
00695
00696 #define AP_REQ_DEFAULT_PATH_INFO 2
00697
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00719 struct htaccess_result {
00721 const char *dir;
00723 int override;
00725 int override_opts;
00727 struct ap_conf_vector_t *htaccess;
00729 const struct htaccess_result *next;
00730 };
00731
00732
00733
00734
00735
00736
00737
00738
00739
00741 typedef struct process_rec process_rec;
00743 typedef struct server_rec server_rec;
00745 typedef struct conn_rec conn_rec;
00747 typedef struct request_rec request_rec;
00749 typedef struct conn_state_t conn_state_t;
00750
00751
00752
00753 #include "apr_uri.h"
00754
00758 struct process_rec {
00760 apr_pool_t *pool;
00762 apr_pool_t *pconf;
00764 int argc;
00766 const char * const *argv;
00768 const char *short_name;
00769 };
00770
00774 struct request_rec {
00776 apr_pool_t *pool;
00778 conn_rec *connection;
00780 server_rec *server;
00781
00783 request_rec *next;
00785 request_rec *prev;
00786
00789 request_rec *main;
00790
00791
00792
00793
00795 char *the_request;
00797 int assbackwards;
00802 int proxyreq;
00804 int header_only;
00806 char *protocol;
00808 int proto_num;
00810 const char *hostname;
00811
00813 apr_time_t request_time;
00814
00816 const char *status_line;
00818 int status;
00819
00820
00821
00822
00823
00825 const char *method;
00827 int method_number;
00828
00849 apr_int64_t allowed;
00851 apr_array_header_t *allowed_xmethods;
00853 ap_method_list_t *allowed_methods;
00854
00856 apr_off_t sent_bodyct;
00858 apr_off_t bytes_sent;
00860 apr_time_t mtime;
00861
00862
00863
00865 int chunked;
00867 const char *range;
00869 apr_off_t clength;
00870
00872 apr_off_t remaining;
00874 apr_off_t read_length;
00878 int read_body;
00880 int read_chunked;
00882 unsigned expecting_100;
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00897 apr_table_t *headers_in;
00899 apr_table_t *headers_out;
00902 apr_table_t *err_headers_out;
00904 apr_table_t *subprocess_env;
00906 apr_table_t *notes;
00907
00908
00909
00910
00911
00913 const char *content_type;
00915 const char *handler;
00916
00918 const char *content_encoding;
00920 apr_array_header_t *content_languages;
00921
00923 char *vlist_validator;
00924
00926 char *user;
00928 char *ap_auth_type;
00929
00931 int no_cache;
00933 int no_local_copy;
00934
00935
00936
00937
00938
00940 char *unparsed_uri;
00942 char *uri;
00944 char *filename;
00945
00947 char *canonical_filename;
00949 char *path_info;
00951 char *args;
00953 apr_finfo_t finfo;
00955 apr_uri_t parsed_uri;
00956
00965 int used_path_info;
00966
00967
00968
00969
00970
00971
00973 struct ap_conf_vector_t *per_dir_config;
00975 struct ap_conf_vector_t *request_config;
00976
00983 const struct htaccess_result *htaccess;
00984
00986 struct ap_filter_t *output_filters;
00988 struct ap_filter_t *input_filters;
00989
00992 struct ap_filter_t *proto_output_filters;
00995 struct ap_filter_t *proto_input_filters;
00996
00998 int eos_sent;
00999
01000
01001
01002
01003
01004
01005 };
01006
01017 #define PROXYREQ_NONE 0
01018 #define PROXYREQ_PROXY 1
01019 #define PROXYREQ_REVERSE 2
01020 #define PROXYREQ_RESPONSE 3
01022
01023
01027 typedef enum {
01028 AP_CONN_UNKNOWN,
01029 AP_CONN_CLOSE,
01030 AP_CONN_KEEPALIVE
01031 } ap_conn_keepalive_e;
01032
01036 struct conn_rec {
01038 apr_pool_t *pool;
01040 server_rec *base_server;
01042 void *vhost_lookup_data;
01043
01044
01046 apr_sockaddr_t *local_addr;
01048 apr_sockaddr_t *remote_addr;
01049
01051 char *remote_ip;
01055 char *remote_host;
01058 char *remote_logname;
01059
01061 unsigned aborted:1;
01062
01065 ap_conn_keepalive_e keepalive;
01066
01069 signed int double_reverse:2;
01070
01072 int keepalives;
01074 char *local_ip;
01077 char *local_host;
01078
01080 long id;
01083 struct ap_conf_vector_t *conn_config;
01086 apr_table_t *notes;
01088 struct ap_filter_t *input_filters;
01090 struct ap_filter_t *output_filters;
01092 void *sbh;
01094 struct apr_bucket_alloc_t *bucket_alloc;
01096 conn_state_t *cs;
01098 int data_in_input_filters;
01099
01103 int clogging_input_filters;
01104 };
01105
01109 typedef enum {
01110 CONN_STATE_CHECK_REQUEST_LINE_READABLE,
01111 CONN_STATE_READ_REQUEST_LINE,
01112 CONN_STATE_LINGER
01113 } conn_state_e;
01114
01118 struct conn_state_t {
01120 APR_RING_ENTRY(conn_state_t) timeout_list;
01122 apr_time_t expiration_time;
01124 conn_state_e state;
01126 conn_rec *c;
01128 apr_pool_t *p;
01130 apr_bucket_alloc_t *bucket_alloc;
01132 apr_pollfd_t pfd;
01133 };
01134
01135
01136
01141 #define DEFAULT_VHOST_ADDR 0xfffffffful
01142
01143
01148 typedef struct server_addr_rec server_addr_rec;
01149 struct server_addr_rec {
01151 server_addr_rec *next;
01153 apr_sockaddr_t *host_addr;
01155 apr_port_t host_port;
01157 char *virthost;
01158 };
01159
01163 struct server_rec {
01165 process_rec *process;
01167 server_rec *next;
01168
01170 const char *defn_name;
01172 unsigned defn_line_number;
01173
01174
01175
01177 char *server_admin;
01179 char *server_hostname;
01181 apr_port_t port;
01182
01183
01184
01186 char *error_fname;
01188 apr_file_t *error_log;
01190 int loglevel;
01191
01192
01193
01195 int is_virtual;
01198 struct ap_conf_vector_t *module_config;
01200 struct ap_conf_vector_t *lookup_defaults;
01201
01202
01203
01205 server_addr_rec *addrs;
01207 apr_interval_time_t timeout;
01209 apr_interval_time_t keep_alive_timeout;
01211 int keep_alive_max;
01213 int keep_alive;
01214
01216 const char *path;
01218 int pathlen;
01219
01221 apr_array_header_t *names;
01223 apr_array_header_t *wild_names;
01224
01226 int limit_req_line;
01228 int limit_req_fieldsize;
01230 int limit_req_fields;
01231
01233 const char *server_scheme;
01234 };
01235
01236 typedef struct core_output_filter_ctx {
01237 apr_bucket_brigade *b;
01241 apr_pool_t *deferred_write_pool;
01242 } core_output_filter_ctx_t;
01243
01244 typedef struct core_filter_ctx {
01245 apr_bucket_brigade *b;
01246 apr_bucket_brigade *tmpbb;
01247 } core_ctx_t;
01248
01249 typedef struct core_net_rec {
01251 apr_socket_t *client_socket;
01252
01254 conn_rec *c;
01255
01256 core_output_filter_ctx_t *out_ctx;
01257 core_ctx_t *in_ctx;
01258 } core_net_rec;
01259
01267 AP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
01268
01277 AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
01278
01279
01280
01281
01282
01290 AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
01291
01300 AP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
01301
01309 AP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);
01310
01319 AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
01320
01329 AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line,
01330 char stop);
01331
01341 AP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
01342
01349 AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);
01350
01358 AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
01359
01369 AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word);
01370
01380 AP_DECLARE(const char *) ap_size_list_item(const char **field, int *len);
01381
01392 AP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field);
01393
01402 AP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
01403
01414 AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
01415
01423 AP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
01424
01432 AP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
01433
01439 AP_DECLARE(int) ap_is_url(const char *u);
01440
01446 AP_DECLARE(int) ap_unescape_url(char *url);
01447
01453 AP_DECLARE(int) ap_unescape_url_keep2f(char *url);
01454
01459 AP_DECLARE(void) ap_no2slash(char *name);
01460
01466 AP_DECLARE(void) ap_getparents(char *name);
01467
01474 AP_DECLARE(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
01475
01484 AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
01485
01487 #define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
01488
01495 AP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s);
01496
01503 AP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str);
01504
01512 AP_DECLARE(apr_size_t) ap_escape_errorlog_item(char *dest, const char *source,
01513 apr_size_t buflen);
01514
01523 AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
01524 apr_port_t port, const request_rec *r);
01525
01532 AP_DECLARE(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s);
01533
01539 AP_DECLARE(int) ap_count_dirs(const char *path);
01540
01552 AP_DECLARE(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
01553
01561 AP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
01562
01575 AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f);
01576
01585 AP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir);
01586
01594 AP_DECLARE(int) ap_is_matchexp(const char *str);
01595
01602 AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected);
01603
01611 AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected);
01612
01620 AP_DECLARE(char *) ap_strcasestr(const char *s1, const char *s2);
01621
01628 AP_DECLARE(const char *) ap_stripprefix(const char *bigstring,
01629 const char *prefix);
01630
01637 AP_DECLARE(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
01638
01645 AP_DECLARE(char *) ap_pbase64encode(apr_pool_t *p, char *string);
01646
01659 AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
01660 int cflags);
01661
01667 AP_DECLARE(void) ap_pregfree(apr_pool_t *p, ap_regex_t *reg);
01668
01680 AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
01681 size_t nmatch, ap_regmatch_t pmatch[]);
01682
01688 AP_DECLARE(void) ap_content_type_tolower(char *s);
01689
01694 AP_DECLARE(void) ap_str_tolower(char *s);
01695
01703 AP_DECLARE(int) ap_ind(const char *str, char c);
01704
01712 AP_DECLARE(int) ap_rind(const char *str, char c);
01713
01720 AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring);
01721
01732 AP_DECLARE(char *) ap_append_pid(apr_pool_t *p, const char *string,
01733 const char *delim);
01734
01735
01742 AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *name);
01743
01750 AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *name);
01751
01752 #ifdef _OSD_POSIX
01753 extern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
01754 #endif
01755
01761 char *ap_get_local_host(apr_pool_t *p);
01762
01769 AP_DECLARE(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
01770 __attribute__((noreturn));
01771
01775 #define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
01776
01784 #ifdef AP_DEBUG
01785 #define AP_DEBUG_ASSERT(exp) ap_assert(exp)
01786 #else
01787 #define AP_DEBUG_ASSERT(exp) ((void)0)
01788 #endif
01789
01799 #define SIGSTOP_DETACH 1
01801 #define SIGSTOP_MAKE_CHILD 2
01803 #define SIGSTOP_SPAWN_CHILD 4
01805 #define SIGSTOP_PIPED_LOG_SPAWN 8
01807 #define SIGSTOP_CGI_CHILD 16
01808
01810 #ifdef DEBUG_SIGSTOP
01811 extern int raise_sigstop_flags;
01812 #define RAISE_SIGSTOP(x) do { \
01813 if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
01814 } while (0)
01815 #else
01816 #define RAISE_SIGSTOP(x)
01817 #endif
01818
01825 AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r);
01826
01828 #ifdef strtoul
01829 #undef strtoul
01830 #endif
01831 #define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
01832
01833
01834
01835
01836
01837
01838
01839
01840 #include <string.h>
01841
01842 AP_DECLARE(char *) ap_strchr(char *s, int c);
01843 AP_DECLARE(const char *) ap_strchr_c(const char *s, int c);
01844 AP_DECLARE(char *) ap_strrchr(char *s, int c);
01845 AP_DECLARE(const char *) ap_strrchr_c(const char *s, int c);
01846 AP_DECLARE(char *) ap_strstr(char *s, const char *c);
01847 AP_DECLARE(const char *) ap_strstr_c(const char *s, const char *c);
01848
01849 #ifdef AP_DEBUG
01850
01851 #undef strchr
01852 # define strchr(s, c) ap_strchr(s,c)
01853 #undef strrchr
01854 # define strrchr(s, c) ap_strrchr(s,c)
01855 #undef strstr
01856 # define strstr(s, c) ap_strstr(s,c)
01857
01858 #else
01859
01861 # define ap_strchr(s, c) strchr(s, c)
01863 # define ap_strchr_c(s, c) strchr(s, c)
01865 # define ap_strrchr(s, c) strrchr(s, c)
01867 # define ap_strrchr_c(s, c) strrchr(s, c)
01869 # define ap_strstr(s, c) strstr(s, c)
01871 # define ap_strstr_c(s, c) strstr(s, c)
01872
01873