/usr/src/redhat/BUILD/httpd-2.2.3/include/httpd.h

説明を見る。
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00035 #ifndef APACHE_HTTPD_H
00036 #define APACHE_HTTPD_H
00037 
00038 /* XXX - We need to push more stuff to other .h files, or even .c files, to
00039  * make this file smaller
00040  */
00041 
00042 /* Headers in which EVERYONE has an interest... */
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 /* Note: apr_uri.h is also included, see below */
00066 
00067 #ifdef __cplusplus
00068 extern "C" {
00069 #endif
00070 
00071 #ifdef CORE_PRIVATE
00072 
00073 /* ----------------------------- config dir ------------------------------ */
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 /* HTTPD_ROOT */
00096 
00097 /* 
00098  * --------- You shouldn't have to edit anything below this line ----------
00099  *
00100  * Any modifications to any defaults not defined above should be done in the 
00101  * respective configuration file. 
00102  *
00103  */
00104 
00109 #ifndef DOCUMENT_LOCATION
00110 #ifdef OS2
00111 /* Set default for OS/2 file system */
00112 #define DOCUMENT_LOCATION  HTTPD_ROOT "/docs"
00113 #else
00114 /* Set default for non OS/2 file system */
00115 #define DOCUMENT_LOCATION  HTTPD_ROOT "/htdocs"
00116 #endif
00117 #endif /* DOCUMENT_LOCATION */
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 /* DEFAULT_ERRORLOG */
00135 
00137 #ifndef DEFAULT_ACCESS_FNAME
00138 #ifdef OS2
00139 /* Set default for OS/2 file system */
00140 #define DEFAULT_ACCESS_FNAME "htaccess"
00141 #else
00142 #define DEFAULT_ACCESS_FNAME ".htaccess"
00143 #endif
00144 #endif /* DEFAULT_ACCESS_FNAME */
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  * Limits on the size of various request items.  These limits primarily
00178  * exist to prevent simple denial-of-service attacks on a server based
00179  * on misuse of the protocol.  The recommended values will depend on the
00180  * nature of the server resources -- CGI scripts and database backends
00181  * might require large values, but most servers could get by with much
00182  * smaller limits than we use below.  The request message body size can
00183  * be limited by the per-dir config directive LimitRequestBody.
00184  *
00185  * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
00186  * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
00187  * These two limits can be lowered (but not raised) by the server config
00188  * directives LimitRequestLine and LimitRequestFieldsize, respectively.
00189  *
00190  * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
00191  * the server config directive LimitRequestFields.
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 /* CORE_PRIVATE */
00214 
00216 #define AP_SERVER_PROTOCOL "HTTP/1.1"
00217 
00218 
00219 /* ------------------ stuff that modules are allowed to look at ----------- */
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 
00237 #ifndef AP_TYPES_CONFIG_FILE
00238 #define AP_TYPES_CONFIG_FILE "conf/mime.types"
00239 #endif
00240 
00241 /*
00242  * Define the HTML doctype strings centrally.
00243  */
00245 #define DOCTYPE_HTML_2_0  "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
00246                           "DTD HTML 2.0//EN\">\n"
00247 
00248 #define DOCTYPE_HTML_3_2  "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00249                           "DTD HTML 3.2 Final//EN\">\n"
00250 
00251 #define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00252                           "DTD HTML 4.0//EN\"\n" \
00253                           "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
00254 
00255 #define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00256                           "DTD HTML 4.0 Transitional//EN\"\n" \
00257                           "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n"
00258 
00259 #define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
00260                           "DTD HTML 4.0 Frameset//EN\"\n" \
00261                           "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n"
00262 
00263 #define DOCTYPE_XHTML_1_0S "<!DOCTYPE html PUBLIC \"-//W3C//" \
00264                            "DTD XHTML 1.0 Strict//EN\"\n" \
00265                            "\"http://www.w3.org/TR/xhtml1/DTD/" \
00266                            "xhtml1-strict.dtd\">\n"
00267 
00268 #define DOCTYPE_XHTML_1_0T "<!DOCTYPE html PUBLIC \"-//W3C//" \
00269                            "DTD XHTML 1.0 Transitional//EN\"\n" \
00270                            "\"http://www.w3.org/TR/xhtml1/DTD/" \
00271                            "xhtml1-transitional.dtd\">\n"
00272 
00273 #define DOCTYPE_XHTML_1_0F "<!DOCTYPE html PUBLIC \"-//W3C//" \
00274                            "DTD XHTML 1.0 Frameset//EN\"\n" \
00275                            "\"http://www.w3.org/TR/xhtml1/DTD/" \
00276                            "xhtml1-frameset.dtd\">"
00277 
00279 #define HTTP_VERSION(major,minor) (1000*(major)+(minor))
00280 
00281 #define HTTP_VERSION_MAJOR(number) ((number)/1000)
00282 
00283 #define HTTP_VERSION_MINOR(number) ((number)%1000)
00284 
00285 /* -------------- Port number for server running standalone --------------- */
00286 
00288 #define DEFAULT_HTTP_PORT       80
00289 
00290 #define DEFAULT_HTTPS_PORT      443
00291 
00297 #define ap_is_default_port(port,r)      ((port) == ap_default_port(r))
00298 
00302 #define ap_default_port(r)      ap_run_default_port(r)
00303 
00307 #define ap_http_scheme(r)       ap_run_http_scheme(r)
00308 
00310 #define MAX_STRING_LEN HUGE_STRING_LEN
00311 
00313 #define HUGE_STRING_LEN 8192
00314 
00316 #define AP_IOBUFSIZE 8192
00317 
00319 #define AP_MAX_REG_MATCH 10
00320 
00327 #define AP_MAX_SENDFILE 16777216  /* 2^24 */
00328 
00335 #define APEXIT_OK               0x0
00336 
00337 #define APEXIT_INIT             0x2
00338 
00339 #define APEXIT_CHILDINIT        0x3
00340 
00345 #define APEXIT_CHILDSICK        0x7
00346 
00351 #define APEXIT_CHILDFATAL       0xf
00352 
00353 #ifndef AP_DECLARE
00354 
00359 # define AP_DECLARE(type)    type
00360 #endif
00361 
00362 #ifndef AP_DECLARE_NONSTD
00363 
00370 # define AP_DECLARE_NONSTD(type)    type
00371 #endif
00372 #ifndef AP_DECLARE_DATA
00373 # define AP_DECLARE_DATA
00374 #endif
00375 
00376 #ifndef AP_MODULE_DECLARE
00377 # define AP_MODULE_DECLARE(type)    type
00378 #endif
00379 #ifndef AP_MODULE_DECLARE_NONSTD
00380 # define AP_MODULE_DECLARE_NONSTD(type)  type
00381 #endif
00382 #ifndef AP_MODULE_DECLARE_DATA
00383 # define AP_MODULE_DECLARE_DATA
00384 #endif
00385 
00390 #ifndef AP_CORE_DECLARE
00391 # define AP_CORE_DECLARE        AP_DECLARE
00392 #endif
00393 
00399 #ifndef AP_CORE_DECLARE_NONSTD
00400 # define AP_CORE_DECLARE_NONSTD AP_DECLARE_NONSTD
00401 #endif
00402 
00407 typedef struct {
00408     int major;              
00409     int minor;              
00410     int patch;              
00411     const char *add_string; 
00412 } ap_version_t;
00413 
00420 AP_DECLARE(void) ap_get_server_revision(ap_version_t *version);
00421 
00426 AP_DECLARE(const char *) ap_get_server_version(void);
00427 
00433 AP_DECLARE(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
00434 
00439 AP_DECLARE(const char *) ap_get_server_built(void);
00440 
00441 #define DECLINED -1             
00442 #define DONE -2                 
00445 #define OK 0                    
00457 #define RESPONSE_CODES 57
00458 
00459 #define HTTP_CONTINUE                      100
00460 #define HTTP_SWITCHING_PROTOCOLS           101
00461 #define HTTP_PROCESSING                    102
00462 #define HTTP_OK                            200
00463 #define HTTP_CREATED                       201
00464 #define HTTP_ACCEPTED                      202
00465 #define HTTP_NON_AUTHORITATIVE             203
00466 #define HTTP_NO_CONTENT                    204
00467 #define HTTP_RESET_CONTENT                 205
00468 #define HTTP_PARTIAL_CONTENT               206
00469 #define HTTP_MULTI_STATUS                  207
00470 #define HTTP_MULTIPLE_CHOICES              300
00471 #define HTTP_MOVED_PERMANENTLY             301
00472 #define HTTP_MOVED_TEMPORARILY             302
00473 #define HTTP_SEE_OTHER                     303
00474 #define HTTP_NOT_MODIFIED                  304
00475 #define HTTP_USE_PROXY                     305
00476 #define HTTP_TEMPORARY_REDIRECT            307
00477 #define HTTP_BAD_REQUEST                   400
00478 #define HTTP_UNAUTHORIZED                  401
00479 #define HTTP_PAYMENT_REQUIRED              402
00480 #define HTTP_FORBIDDEN                     403
00481 #define HTTP_NOT_FOUND                     404
00482 #define HTTP_METHOD_NOT_ALLOWED            405
00483 #define HTTP_NOT_ACCEPTABLE                406
00484 #define HTTP_PROXY_AUTHENTICATION_REQUIRED 407
00485 #define HTTP_REQUEST_TIME_OUT              408
00486 #define HTTP_CONFLICT                      409
00487 #define HTTP_GONE                          410
00488 #define HTTP_LENGTH_REQUIRED               411
00489 #define HTTP_PRECONDITION_FAILED           412
00490 #define HTTP_REQUEST_ENTITY_TOO_LARGE      413
00491 #define HTTP_REQUEST_URI_TOO_LARGE         414
00492 #define HTTP_UNSUPPORTED_MEDIA_TYPE        415
00493 #define HTTP_RANGE_NOT_SATISFIABLE         416
00494 #define HTTP_EXPECTATION_FAILED            417
00495 #define HTTP_UNPROCESSABLE_ENTITY          422
00496 #define HTTP_LOCKED                        423
00497 #define HTTP_FAILED_DEPENDENCY             424
00498 #define HTTP_UPGRADE_REQUIRED              426
00499 #define HTTP_INTERNAL_SERVER_ERROR         500
00500 #define HTTP_NOT_IMPLEMENTED               501
00501 #define HTTP_BAD_GATEWAY                   502
00502 #define HTTP_SERVICE_UNAVAILABLE           503
00503 #define HTTP_GATEWAY_TIME_OUT              504
00504 #define HTTP_VERSION_NOT_SUPPORTED         505
00505 #define HTTP_VARIANT_ALSO_VARIES           506
00506 #define HTTP_INSUFFICIENT_STORAGE          507
00507 #define HTTP_NOT_EXTENDED                  510
00508 
00510 #define ap_is_HTTP_INFO(x)         (((x) >= 100)&&((x) < 200))
00511 
00512 #define ap_is_HTTP_SUCCESS(x)      (((x) >= 200)&&((x) < 300))
00513 
00514 #define ap_is_HTTP_REDIRECT(x)     (((x) >= 300)&&((x) < 400))
00515 
00516 #define ap_is_HTTP_ERROR(x)        (((x) >= 400)&&((x) < 600))
00517 
00518 #define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
00519 
00520 #define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
00521 
00523 #define ap_status_drops_connection(x) \
00524                                    (((x) == HTTP_BAD_REQUEST)           || \
00525                                     ((x) == HTTP_REQUEST_TIME_OUT)      || \
00526                                     ((x) == HTTP_LENGTH_REQUIRED)       || \
00527                                     ((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
00528                                     ((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
00529                                     ((x) == HTTP_INTERNAL_SERVER_ERROR) || \
00530                                     ((x) == HTTP_SERVICE_UNAVAILABLE) || \
00531                                     ((x) == HTTP_NOT_IMPLEMENTED))
00532 
00548 #define M_GET                   0       
00549 #define M_PUT                   1       /*  :             */
00550 #define M_POST                  2
00551 #define M_DELETE                3
00552 #define M_CONNECT               4
00553 #define M_OPTIONS               5
00554 #define M_TRACE                 6       
00555 #define M_PATCH                 7       
00556 #define M_PROPFIND              8       
00557 #define M_PROPPATCH             9       /*  :               */
00558 #define M_MKCOL                 10
00559 #define M_COPY                  11
00560 #define M_MOVE                  12
00561 #define M_LOCK                  13
00562 #define M_UNLOCK                14      
00563 #define M_VERSION_CONTROL       15      
00564 #define M_CHECKOUT              16      /*  :                          */
00565 #define M_UNCHECKOUT            17
00566 #define M_CHECKIN               18
00567 #define M_UPDATE                19
00568 #define M_LABEL                 20
00569 #define M_REPORT                21
00570 #define M_MKWORKSPACE           22
00571 #define M_MKACTIVITY            23
00572 #define M_BASELINE_CONTROL      24
00573 #define M_MERGE                 25
00574 #define M_INVALID               26      
00580 #define METHODS     64
00581 
00585 #define AP_METHOD_BIT ((apr_int64_t)1)
00586 
00590 typedef struct ap_method_list_t ap_method_list_t;
00591 
00599 struct ap_method_list_t {
00601     apr_int64_t method_mask;
00603     apr_array_header_t *method_list;
00604 };
00605 
00611 #define CGI_MAGIC_TYPE "application/x-httpd-cgi"
00612 
00613 #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
00614 
00615 #define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
00616 
00617 #define DIR_MAGIC_TYPE "httpd/unix-directory"
00618 
00620 /* Just in case your linefeed isn't the one the other end is expecting. */
00621 #if !APR_CHARSET_EBCDIC
00622 
00623 #define LF 10
00624 
00625 #define CR 13
00626 
00627 #define CRLF "\015\012"
00628 #else /* APR_CHARSET_EBCDIC */
00629 /* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
00630  * in the buff package (bread/bputs/bwrite).  Everywhere else, we use
00631  * "native EBCDIC" CR and NL characters. These are therefore
00632  * defined as
00633  * '\r' and '\n'.
00634  */
00635 #define CR '\r'
00636 #define LF '\n'
00637 #define CRLF "\r\n"
00638 #endif /* APR_CHARSET_EBCDIC */                                   
00639 
00647 #define REQUEST_NO_BODY          0
00648 
00649 #define REQUEST_CHUNKED_ERROR    1
00650 
00651 #define REQUEST_CHUNKED_DECHUNK  2
00652 
00662 #define AP_REQ_ACCEPT_PATH_INFO    0
00663 
00664 #define AP_REQ_REJECT_PATH_INFO    1
00665 
00666 #define AP_REQ_DEFAULT_PATH_INFO   2
00667 
00671 /*
00672  * Things which may vary per file-lookup WITHIN a request ---
00673  * e.g., state of MIME config.  Basically, the name of an object, info
00674  * about the object, and any other info we may ahve which may need to
00675  * change as we go poking around looking for it (e.g., overridden by
00676  * .htaccess files).
00677  *
00678  * Note how the default state of almost all these things is properly
00679  * zero, so that allocating it with pcalloc does the right thing without
00680  * a whole lot of hairy initialization... so long as we are willing to
00681  * make the (fairly) portable assumption that the bit pattern of a NULL
00682  * pointer is, in fact, zero.
00683  */
00684 
00689 struct htaccess_result {
00691     const char *dir;
00693     int override;
00695     int override_opts;
00697     struct ap_conf_vector_t *htaccess;
00699     const struct htaccess_result *next;
00700 };
00701 
00702 /* The following four types define a hierarchy of activities, so that
00703  * given a request_rec r you can write r->connection->server->process
00704  * to get to the process_rec.  While this reduces substantially the
00705  * number of arguments that various hooks require beware that in
00706  * threaded versions of the server you must consider multiplexing
00707  * issues.  */
00708 
00709 
00711 typedef struct process_rec process_rec;
00713 typedef struct server_rec server_rec;
00715 typedef struct conn_rec conn_rec;
00717 typedef struct request_rec request_rec;
00719 typedef struct conn_state_t conn_state_t;
00720 
00721 /* ### would be nice to not include this from httpd.h ... */
00722 /* This comes after we have defined the request_rec type */
00723 #include "apr_uri.h"
00724 
00728 struct process_rec {
00730     apr_pool_t *pool;
00732     apr_pool_t *pconf;
00734     int argc;
00736     const char * const *argv;
00738     const char *short_name;
00739 };
00740 
00744 struct request_rec {
00746     apr_pool_t *pool;
00748     conn_rec *connection;
00750     server_rec *server;
00751 
00753     request_rec *next;
00755     request_rec *prev;
00756 
00759     request_rec *main;
00760 
00761     /* Info about the request itself... we begin with stuff that only
00762      * protocol.c should ever touch...
00763      */
00765     char *the_request;
00767     int assbackwards;
00772     int proxyreq;
00774     int header_only;
00776     char *protocol;
00778     int proto_num;
00780     const char *hostname;
00781 
00783     apr_time_t request_time;
00784 
00786     const char *status_line;
00788     int status;
00789 
00790     /* Request method, two ways; also, protocol, etc..  Outside of protocol.c,
00791      * look, but don't touch.
00792      */
00793 
00795     const char *method;
00797     int method_number;
00798 
00819     apr_int64_t allowed;
00821     apr_array_header_t *allowed_xmethods; 
00823     ap_method_list_t *allowed_methods; 
00824 
00826     apr_off_t sent_bodyct;
00828     apr_off_t bytes_sent;
00830     apr_time_t mtime;
00831 
00832     /* HTTP/1.1 connection-level features */
00833 
00835     int chunked;
00837     const char *range;
00839     apr_off_t clength;
00840 
00842     apr_off_t remaining;
00844     apr_off_t read_length;
00848     int read_body;
00850     int read_chunked;
00852     unsigned expecting_100;
00853 
00854     /* MIME header environments, in and out.  Also, an array containing
00855      * environment variables to be passed to subprocesses, so people can
00856      * write modules to add to that environment.
00857      *
00858      * The difference between headers_out and err_headers_out is that the
00859      * latter are printed even on error, and persist across internal redirects
00860      * (so the headers printed for ErrorDocument handlers will have them).
00861      *
00862      * The 'notes' apr_table_t is for notes from one module to another, with no
00863      * other set purpose in mind...
00864      */
00865 
00867     apr_table_t *headers_in;
00869     apr_table_t *headers_out;
00872     apr_table_t *err_headers_out;
00874     apr_table_t *subprocess_env;
00876     apr_table_t *notes;
00877 
00878     /* content_type, handler, content_encoding, and all content_languages 
00879      * MUST be lowercased strings.  They may be pointers to static strings;
00880      * they should not be modified in place.
00881      */
00883     const char *content_type;   /* Break these out --- we dispatch on 'em */
00885     const char *handler;        /* What we *really* dispatch on */
00886 
00888     const char *content_encoding;
00890     apr_array_header_t *content_languages;
00891 
00893     char *vlist_validator;
00894     
00896     char *user; 
00898     char *ap_auth_type;
00899 
00901     int no_cache;
00903     int no_local_copy;
00904 
00905     /* What object is being requested (either directly, or via include
00906      * or content-negotiation mapping).
00907      */
00908 
00910     char *unparsed_uri; 
00912     char *uri;
00914     char *filename;
00915     /* XXX: What does this mean? Please define "canonicalize" -aaron */
00917     char *canonical_filename;
00919     char *path_info;
00921     char *args; 
00923     apr_finfo_t finfo;
00925     apr_uri_t parsed_uri;
00926 
00935     int used_path_info;
00936 
00937     /* Various other config info which may change with .htaccess files
00938      * These are config vectors, with one void* pointer for each module
00939      * (the thing pointed to being the module's business).
00940      */
00941 
00943     struct ap_conf_vector_t *per_dir_config;
00945     struct ap_conf_vector_t *request_config;
00946 
00953     const struct htaccess_result *htaccess;
00954 
00956     struct ap_filter_t *output_filters;
00958     struct ap_filter_t *input_filters;
00959 
00962     struct ap_filter_t *proto_output_filters;
00965     struct ap_filter_t *proto_input_filters;
00966 
00968     int eos_sent;
00969 
00970 /* Things placed at the end of the record to avoid breaking binary
00971  * compatibility.  It would be nice to remember to reorder the entire
00972  * record to improve 64bit alignment the next time we need to break
00973  * binary compatibility for some other reason.
00974  */
00975 };
00976 
00987 #define PROXYREQ_NONE 0         
00988 #define PROXYREQ_PROXY 1        
00989 #define PROXYREQ_REVERSE 2      
00990 #define PROXYREQ_RESPONSE 3 
00992 /* @} */
00993 
00997 typedef enum {
00998     AP_CONN_UNKNOWN,
00999     AP_CONN_CLOSE,
01000     AP_CONN_KEEPALIVE
01001 } ap_conn_keepalive_e;
01002 
01006 struct conn_rec {
01008     apr_pool_t *pool;
01010     server_rec *base_server;
01012     void *vhost_lookup_data;
01013 
01014     /* Information about the connection itself */
01016     apr_sockaddr_t *local_addr;
01018     apr_sockaddr_t *remote_addr;
01019 
01021     char *remote_ip;
01025     char *remote_host;
01028     char *remote_logname;
01029 
01031     unsigned aborted:1;
01032 
01035     ap_conn_keepalive_e keepalive;
01036 
01039     signed int double_reverse:2;
01040 
01042     int keepalives;
01044     char *local_ip;
01047     char *local_host;
01048 
01050     long id; 
01053     struct ap_conf_vector_t *conn_config;
01056     apr_table_t *notes;
01058     struct ap_filter_t *input_filters;
01060     struct ap_filter_t *output_filters;
01062     void *sbh;
01064     struct apr_bucket_alloc_t *bucket_alloc;
01066     conn_state_t *cs;
01068     int data_in_input_filters;
01069 };
01070 
01074 typedef enum  {
01075     CONN_STATE_CHECK_REQUEST_LINE_READABLE,
01076     CONN_STATE_READ_REQUEST_LINE,
01077     CONN_STATE_LINGER
01078 } conn_state_e;
01079 
01083 struct conn_state_t {
01085     APR_RING_ENTRY(conn_state_t) timeout_list;
01087     apr_time_t expiration_time;
01089     conn_state_e state;
01091     conn_rec *c;
01093     apr_pool_t *p;
01095     apr_bucket_alloc_t *bucket_alloc;
01097     apr_pollfd_t pfd;
01098 };
01099 
01100 /* Per-vhost config... */
01101 
01106 #define DEFAULT_VHOST_ADDR 0xfffffffful
01107 
01108 
01113 typedef struct server_addr_rec server_addr_rec;
01114 struct server_addr_rec {
01116     server_addr_rec *next;
01118     apr_sockaddr_t *host_addr;
01120     apr_port_t host_port;
01122     char *virthost;
01123 };
01124 
01128 struct server_rec {
01130     process_rec *process;
01132     server_rec *next;
01133 
01135     const char *defn_name;
01137     unsigned defn_line_number;
01138 
01139     /* Contact information */
01140 
01142     char *server_admin;
01144     char *server_hostname;
01146     apr_port_t port;
01147 
01148     /* Log files --- note that transfer log is now in the modules... */
01149 
01151     char *error_fname;
01153     apr_file_t *error_log;
01155     int loglevel;
01156 
01157     /* Module-specific configuration for server, and defaults... */
01158 
01160     int is_virtual;
01163     struct ap_conf_vector_t *module_config; 
01165     struct ap_conf_vector_t *lookup_defaults;
01166 
01167     /* Transaction handling */
01168 
01170     server_addr_rec *addrs;
01172     apr_interval_time_t timeout;
01174     apr_interval_time_t keep_alive_timeout;
01176     int keep_alive_max;
01178     int keep_alive;
01179 
01181     const char *path;
01183     int pathlen;
01184 
01186     apr_array_header_t *names;
01188     apr_array_header_t *wild_names;
01189 
01191     int limit_req_line;
01193     int limit_req_fieldsize;
01195     int limit_req_fields; 
01196 
01198     const char *server_scheme;
01199 };
01200 
01201 typedef struct core_output_filter_ctx {
01202     apr_bucket_brigade *b;
01206     apr_pool_t *deferred_write_pool;
01207 } core_output_filter_ctx_t;
01208  
01209 typedef struct core_filter_ctx {
01210     apr_bucket_brigade *b;
01211     apr_bucket_brigade *tmpbb;
01212 } core_ctx_t;
01213  
01214 typedef struct core_net_rec {
01216     apr_socket_t *client_socket;
01217 
01219     conn_rec *c;
01220  
01221     core_output_filter_ctx_t *out_ctx;
01222     core_ctx_t *in_ctx;
01223 } core_net_rec;
01224 
01232 AP_DECLARE(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
01233 
01242 AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
01243 
01244 /* String handling. The *_nc variants allow you to use non-const char **s as
01245    arguments (unfortunately C won't automatically convert a char ** to a const
01246    char **) */
01247 
01255 AP_DECLARE(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
01256 
01265 AP_DECLARE(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
01266 
01274 AP_DECLARE(char *) ap_getword_white(apr_pool_t *p, const char **line);
01275 
01284 AP_DECLARE(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
01285 
01294 AP_DECLARE(char *) ap_getword_nulls(apr_pool_t *p, const char **line,
01295                                     char stop);
01296 
01306 AP_DECLARE(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
01307 
01314 AP_DECLARE(char *) ap_getword_conf(apr_pool_t *p, const char **line);
01315 
01323 AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
01324 
01334 AP_DECLARE(const char *) ap_resolve_env(apr_pool_t *p, const char * word); 
01335 
01345 AP_DECLARE(const char *) ap_size_list_item(const char **field, int *len);
01346 
01357 AP_DECLARE(char *) ap_get_list_item(apr_pool_t *p, const char **field);
01358 
01367 AP_DECLARE(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
01368 
01379 AP_DECLARE(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
01380 
01388 AP_DECLARE(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
01389 
01397 AP_DECLARE(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
01398 
01404 AP_DECLARE(int) ap_is_url(const char *u);
01405 
01411 AP_DECLARE(int) ap_unescape_url(char *url);
01412 
01418 AP_DECLARE(int) ap_unescape_url_keep2f(char *url);
01419 
01424 AP_DECLARE(void) ap_no2slash(char *name);
01425 
01431 AP_DECLARE(void) ap_getparents(char *name);
01432 
01439 AP_DECLARE(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
01440 
01449 AP_DECLARE(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
01450 
01452 #define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
01453 
01460 AP_DECLARE(char *) ap_escape_html(apr_pool_t *p, const char *s);
01461 
01468 AP_DECLARE(char *) ap_escape_logitem(apr_pool_t *p, const char *str);
01469 
01477 AP_DECLARE(apr_size_t) ap_escape_errorlog_item(char *dest, const char *source,
01478                                                apr_size_t buflen);
01479 
01488 AP_DECLARE(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
01489                                     apr_port_t port, const request_rec *r);
01490 
01497 AP_DECLARE(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s);
01498 
01504 AP_DECLARE(int) ap_count_dirs(const char *path);
01505 
01517 AP_DECLARE(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
01518 
01526 AP_DECLARE(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
01527 
01540 AP_DECLARE(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f);
01541 
01550 AP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir);
01551 
01559 AP_DECLARE(int) ap_is_matchexp(const char *str);
01560 
01567 AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected);
01568 
01576 AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected);
01577 
01585 AP_DECLARE(char *) ap_strcasestr(const char *s1, const char *s2);
01586 
01593 AP_DECLARE(const char *) ap_stripprefix(const char *bigstring,
01594                                         const char *prefix);
01595 
01602 AP_DECLARE(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
01603 
01610 AP_DECLARE(char *) ap_pbase64encode(apr_pool_t *p, char *string); 
01611 
01624 AP_DECLARE(ap_regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
01625                                      int cflags);
01626 
01632 AP_DECLARE(void) ap_pregfree(apr_pool_t *p, ap_regex_t *reg);
01633 
01645 AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
01646                               size_t nmatch, ap_regmatch_t pmatch[]);
01647 
01653 AP_DECLARE(void) ap_content_type_tolower(char *s);
01654 
01659 AP_DECLARE(void) ap_str_tolower(char *s);
01660 
01668 AP_DECLARE(int) ap_ind(const char *str, char c);        /* Sigh... */
01669 
01677 AP_DECLARE(int) ap_rind(const char *str, char c);
01678 
01685 AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring);
01686 
01697 AP_DECLARE(char *) ap_append_pid(apr_pool_t *p, const char *string,
01698                                  const char *delim);
01699 
01700 /* Misc system hackery */
01707 AP_DECLARE(int) ap_is_rdirectory(apr_pool_t *p, const char *name);
01708 
01715 AP_DECLARE(int) ap_is_directory(apr_pool_t *p, const char *name);
01716 
01717 #ifdef _OSD_POSIX
01718 extern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
01719 #endif /* _OSD_POSIX */
01720 
01726 char *ap_get_local_host(apr_pool_t *p);
01727 
01734 AP_DECLARE(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
01735                             __attribute__((noreturn));
01736 
01740 #define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
01741 
01749 #ifdef AP_DEBUG
01750 #define AP_DEBUG_ASSERT(exp) ap_assert(exp)
01751 #else
01752 #define AP_DEBUG_ASSERT(exp) ((void)0)
01753 #endif
01754 
01764 #define SIGSTOP_DETACH                  1
01765 
01766 #define SIGSTOP_MAKE_CHILD              2
01767 
01768 #define SIGSTOP_SPAWN_CHILD             4
01769 
01770 #define SIGSTOP_PIPED_LOG_SPAWN         8
01771 
01772 #define SIGSTOP_CGI_CHILD               16
01773 
01775 #ifdef DEBUG_SIGSTOP
01776 extern int raise_sigstop_flags;
01777 #define RAISE_SIGSTOP(x)        do { \
01778         if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
01779     } while (0)
01780 #else
01781 #define RAISE_SIGSTOP(x)
01782 #endif
01783 
01790 AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r);
01791 
01793 #ifdef strtoul
01794 #undef strtoul
01795 #endif
01796 #define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
01797 
01798   /* The C library has functions that allow const to be silently dropped ...
01799      these macros detect the drop in maintainer mode, but use the native
01800      methods for normal builds
01801 
01802      Note that on some platforms (e.g., AIX with gcc, Solaris with gcc), string.h needs 
01803      to be included before the macros are defined or compilation will fail.
01804   */
01805 #include <string.h>
01806 
01807 AP_DECLARE(char *) ap_strchr(char *s, int c);
01808 AP_DECLARE(const char *) ap_strchr_c(const char *s, int c);
01809 AP_DECLARE(char *) ap_strrchr(char *s, int c);
01810 AP_DECLARE(const char *) ap_strrchr_c(const char *s, int c);
01811 AP_DECLARE(char *) ap_strstr(char *s, const char *c);
01812 AP_DECLARE(const char *) ap_strstr_c(const char *s, const char *c);
01813 
01814 #ifdef AP_DEBUG
01815 
01816 #undef strchr
01817 # define strchr(s, c)   ap_strchr(s,c)
01818 #undef strrchr
01819 # define strrchr(s, c)  ap_strrchr(s,c)
01820 #undef strstr
01821 # define strstr(s, c)  ap_strstr(s,c)
01822 
01823 #else
01824 
01826 # define ap_strchr(s, c)        strchr(s, c)
01827 
01828 # define ap_strchr_c(s, c)      strchr(s, c)
01829 
01830 # define ap_strrchr(s, c)       strrchr(s, c)
01831 
01832 # define ap_strrchr_c(s, c)     strrchr(s, c)
01833 
01834 # define ap_strstr(s, c)        strstr(s, c)
01835 
01836 # define ap_strstr_c(s, c)      strstr(s, c)
01837 
01838 #endif
01839 
01840 #define AP_NORESTART            APR_OS_START_USEERR + 1
01841 
01842 #ifdef __cplusplus
01843 }
01844 #endif
01845 
01846 #endif  /* !APACHE_HTTPD_H */
01847 

Apacheに対してSun Jul 19 22:05:23 2009に生成されました。  doxygen 1.4.7