/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
/* ----------------------------- config dir ------------------------------ */
/** Define this to be the default server home dir. Most things later in this *filewitharelativepathnamewillhavethisadded.
*/ #ifndef HTTPD_ROOT #ifdef OS2 /** Set default for OS/2 file system */ #define HTTPD_ROOT "/os2httpd" #elifdefined(WIN32) /** Set default for Windows file system */ #define HTTPD_ROOT "/apache" #elifdefined (NETWARE) /** Set the default for NetWare */ #define HTTPD_ROOT "/apache" #else /** Set for all other OSs */ #define HTTPD_ROOT "/usr/local/apache" #endif #endif/* HTTPD_ROOT */
/** The name of the log files */ #ifndef DEFAULT_ERRORLOG #ifdefined(OS2) || defined(WIN32) #define DEFAULT_ERRORLOG "logs/error.log" #else #define DEFAULT_ERRORLOG "logs/error_log" #endif #endif/* DEFAULT_ERRORLOG */
/** Define this to be what your per-directory security files are called */ #ifndef DEFAULT_ACCESS_FNAME #ifdef OS2 /* Set default for OS/2 file system */ #define DEFAULT_ACCESS_FNAME "htaccess" #else #define DEFAULT_ACCESS_FNAME ".htaccess" #endif #endif/* DEFAULT_ACCESS_FNAME */
/** The name of the server config file */ #ifndef SERVER_CONFIG_FILE #define SERVER_CONFIG_FILE "conf/httpd.conf" #endif
/** The default path for CGI scripts if none is currently set */ #ifndef DEFAULT_PATH #define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin" #endif
/** The path to the suExec wrapper, can be overridden in Configuration */ #ifndef SUEXEC_BIN #define SUEXEC_BIN HTTPD_ROOT "/bin/suexec" #endif
/** The timeout for waiting for messages */ #ifndef DEFAULT_TIMEOUT #define DEFAULT_TIMEOUT 60 #endif
/** The timeout for waiting for keepalive timeout until next request */ #ifndef DEFAULT_KEEPALIVE_TIMEOUT #define DEFAULT_KEEPALIVE_TIMEOUT 5 #endif
/** The number of requests to entertain per connection */ #ifndef DEFAULT_KEEPALIVE #define DEFAULT_KEEPALIVE 100 #endif
/** default limit on bytes in Request-Line (Method+URI+HTTP-version) */ #ifndef DEFAULT_LIMIT_REQUEST_LINE #define DEFAULT_LIMIT_REQUEST_LINE 8190 #endif /** default limit on bytes in any one header field */ #ifndef DEFAULT_LIMIT_REQUEST_FIELDSIZE #define DEFAULT_LIMIT_REQUEST_FIELDSIZE 8190 #endif /** default limit on number of request header fields */ #ifndef DEFAULT_LIMIT_REQUEST_FIELDS #define DEFAULT_LIMIT_REQUEST_FIELDS 100 #endif /** default/hard limit on number of leading/trailing empty lines */ #ifndef DEFAULT_LIMIT_BLANK_LINES #define DEFAULT_LIMIT_BLANK_LINES 10 #endif
/** default HTTP Server protocol */ #define AP_SERVER_PROTOCOL "HTTP/1.1"
/* ------------------ stuff that modules are allowed to look at ----------- */
/** Define this to be what your HTML directory content files are called */ #ifndef AP_DEFAULT_INDEX #define AP_DEFAULT_INDEX "index.html" #endif
/** The name of the MIME types file */ #ifndef AP_TYPES_CONFIG_FILE #define AP_TYPES_CONFIG_FILE "conf/mime.types" #endif
/* *DefinetheHTMLdoctypestringscentrally.
*/ /** HTML 2.0 Doctype */ #define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \ "DTD HTML 2.0//EN\">\n" /** HTML 3.2 Doctype */ #define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \ "DTD HTML 3.2 Final//EN\">\n" /** HTML 4.0 Strict Doctype */ #define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \ "DTD HTML 4.0//EN\"\n" \ "\"http://www.w3.org/TR/REC-html40/strict.dtd\">\n" /** HTML 4.0 Transitional Doctype */ #define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \ "DTD HTML 4.0 Transitional//EN\"\n" \ "\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n" /** HTML 4.0 Frameset Doctype */ #define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \ "DTD HTML 4.0 Frameset//EN\"\n" \ "\"http://www.w3.org/TR/REC-html40/frameset.dtd\">\n" /** XHTML 1.0 Strict Doctype */ #define DOCTYPE_XHTML_1_0S "<!DOCTYPE html PUBLIC \"-//W3C//" \ "DTD XHTML 1.0 Strict//EN\"\n" \ "\"http://www.w3.org/TR/xhtml1/DTD/" \ "xhtml1-strict.dtd\">\n" /** XHTML 1.0 Transitional Doctype */ #define DOCTYPE_XHTML_1_0T "<!DOCTYPE html PUBLIC \"-//W3C//" \ "DTD XHTML 1.0 Transitional//EN\"\n" \ "\"http://www.w3.org/TR/xhtml1/DTD/" \ "xhtml1-transitional.dtd\">\n" /** XHTML 1.0 Frameset Doctype */ #define DOCTYPE_XHTML_1_0F "<!DOCTYPE html PUBLIC \"-//W3C//" \ "DTD XHTML 1.0 Frameset//EN\"\n" \ "\"http://www.w3.org/TR/xhtml1/DTD/" \ "xhtml1-frameset.dtd\">"
/** Internal representation for a HTTP protocol number, e.g., HTTP/1.1 */ #define HTTP_VERSION(major,minor) (1000*(major)+(minor)) /** Major part of HTTP protocol */ #define HTTP_VERSION_MAJOR(number) ((number)/1000) /** Minor part of HTTP protocol */ #define HTTP_VERSION_MINOR(number) ((number)%1000)
/* -------------- Port number for server running standalone --------------- */
/** The function declines to handle the request */ #define AP_DECLINED (AP_START_USERERR + 0)
/** @} */
/** *@briefThenumericversioninformationisbrokenoutintofieldswithinthis *structure.
*/ typedefstruct { int major; /**< major number */ int minor; /**< minor number */ int patch; /**< patch number */ constchar *add_string; /**< additional string like "-dev" */
} ap_version_t;
#define OK 0/**< Module has handled this stage. */ #define DECLINED -1/**< Module declines to handle */ #define DONE -2/**< Module has served the response completely *-it'ssafetodie()withnomoreoutput
*/ #define SUSPENDED -3/**< Module will handle the remainder of the request.
* The core will never invoke the request again */
/** Returned by the bottom-most filter if no data was written.
* @see ap_pass_brigade(). */ #define AP_NOBODY_WROTE -100 /** Returned by the bottom-most filter if no data was read.
* @see ap_get_brigade(). */ #define AP_NOBODY_READ -101 /** Returned by any filter if the filter chain encounters an error *andhasalreadydealtwiththeerrorresponse.
*/ #define AP_FILTER_ERROR -102
/** is the status code informational */ #define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200)) /** is the status code OK ?*/ #define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300)) /** is the status code a redirect */ #define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400)) /** is the status code a error (client or server) */ #define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600)) /** is the status code a client error */ #define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500)) /** is the status code a server error */ #define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600)) /** is the status code a (potentially) valid response code? */ #define ap_is_HTTP_VALID_RESPONSE(x) (((x) >= 100)&&((x) < 600))
/** should the status code drop the connection */ #define ap_status_drops_connection(x) \
(((x) == HTTP_BAD_REQUEST) || \
((x) == HTTP_REQUEST_TIME_OUT) || \
((x) == HTTP_LENGTH_REQUIRED) || \
((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
((x) == HTTP_INTERNAL_SERVER_ERROR) || \
((x) == HTTP_SERVICE_UNAVAILABLE) || \
((x) == HTTP_NOT_IMPLEMENTED))
/** does the status imply header only response (i.e. never w/ a body)? */ #define AP_STATUS_IS_HEADER_ONLY(x) ((x) == HTTP_NO_CONTENT || \
(x) == HTTP_NOT_MODIFIED) /** @} */
/** *@structap_method_list_t *@briefStructureforhandlingHTTPmethods. * *Methodsknowntotheserverareaccessedviaabitmaskshortcut; *extensionmethodsarehandledbyanarray.
*/ struct ap_method_list_t { /** The bitmask used for known methods */
apr_int64_t method_mask; /** the array used for extension methods */
apr_array_header_t *method_list;
}; /** @} */
/** *@defgroupmodule_magicModuleMagicmimetypes *@{
*/ /** Magic for mod_cgi[d] */ #define CGI_MAGIC_TYPE "application/x-httpd-cgi" /** Magic for mod_include */ #define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html" /** Magic for mod_include */ #define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3" /** Magic for mod_dir */ #define DIR_MAGIC_TYPE "httpd/unix-directory" /** Default for r->handler if no content-type set by type_checker */ #define AP_DEFAULT_HANDLER_NAME "" #define AP_IS_DEFAULT_HANDLER_NAME(x) (*x == '\0')
/** @} */ /* Just in case your linefeed isn't the one the other end is expecting. */ #if !APR_CHARSET_EBCDIC /** linefeed */ #define LF 10 /** carriage return */ #define CR 13 /** carriage return /Line Feed Combo */ #define CRLF "\015\012" #else/* APR_CHARSET_EBCDIC */ /* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done *inthebuffpackage(bread/bputs/bwrite).Everywhereelse,weuse *"nativeEBCDIC"CRandNLcharacters.Thesearetherefore *definedas *'\r'and'\n'.
*/ #define CR '\r' #define LF '\n' #define CRLF "\r\n" #endif/* APR_CHARSET_EBCDIC */ /** Useful for common code with either platform charset. */ #define CRLF_ASCII "\015\012"
/** Send 413 error if message has any body */ #define REQUEST_NO_BODY 0 /** Send 411 error if body without Content-Length */ #define REQUEST_CHUNKED_ERROR 1 /** If chunked, remove the chunks for me. */ #define REQUEST_CHUNKED_DECHUNK 2 /** @} // values_request_rec_body */
/** Accept the path_info from the request */ #define AP_REQ_ACCEPT_PATH_INFO 0 /** Return a 404 error if path_info was given */ #define AP_REQ_REJECT_PATH_INFO 1 /** Module may chose to use the given path_info */ #define AP_REQ_DEFAULT_PATH_INFO 2
/** *@briefThisrepresentstheresultofcallinghtaccess;thesearecachedfor *eachrequest.
*/ struct htaccess_result { /** the directory to which this applies */ constchar *dir; /** the overrides allowed for the .htaccess file */ int override; /** the override options allowed for the .htaccess file */ int override_opts; /** Table of allowed directives for override */
apr_table_t *override_list; /** the configuration directives */ struct ap_conf_vector_t *htaccess; /** the next one, or NULL if no more; N.B. never change this */ conststruct htaccess_result *next;
};
/* The following four types define a hierarchy of activities, so that *givenarequest_recryoucanwriter->connection->server->process *togettotheprocess_rec.Whilethisreducessubstantiallythe *numberofargumentsthatvarioushooksrequirebewarethatin *threadedversionsoftheserveryoumustconsidermultiplexing
* issues. */
/** A structure that represents one process */ typedefstruct process_rec process_rec; /** A structure that represents a virtual server */ typedefstruct server_rec server_rec; /** A structure that represents one connection */ typedefstruct conn_rec conn_rec; /** A structure that represents the current request */ typedefstruct request_rec request_rec; /** A structure that represents the status of the current connection */ typedefstruct conn_state_t conn_state_t;
/* ### would be nice to not include this from httpd.h ... */ /* This comes after we have defined the request_rec type */ #include"apr_uri.h"
/** *@briefAstructurethatrepresentsoneprocess
*/ struct process_rec { /** Global pool. Cleared upon normal exit */
apr_pool_t *pool; /** Configuration pool. Cleared upon restart */
apr_pool_t *pconf; /** The program name used to execute the program */ constchar *short_name; /** The command line arguments */ constchar * const *argv; /** Number of command line arguments passed to the program */ int argc;
};
/** *@briefAstructurethatrepresentsthecurrentrequest
*/ struct request_rec { /** The pool associated with the request */
apr_pool_t *pool; /** The connection to the client */
conn_rec *connection; /** The virtual host for this request */
server_rec *server;
/** Pointer to the redirected request if this is an external redirect */
request_rec *next; /** Pointer to the previous request if this is an internal redirect */
request_rec *prev;
/** Pointer to the main request if this is a sub-request
* (see http_request.h) */
request_rec *main;
/* Info about the request itself... we begin with stuff that only *protocol.cshouldevertouch...
*/ /** First line of request */ char *the_request; /** HTTP/0.9, "simple" request (e.g. GET /foo\n w/no headers) */ int assbackwards; /** A proxy request (calculated during post_read_request/translate_name) *possiblevaluesPROXYREQ_NONE,PROXYREQ_PROXY,PROXYREQ_REVERSE, *PROXYREQ_RESPONSE
*/ int proxyreq; /** HEAD request, as opposed to GET */ int header_only; /** Protocol version number of protocol; 1.1 = 1001 */ int proto_num; /** Protocol string, as given to us, or HTTP/0.9 */ char *protocol; /** Host, as set by full URI or Host: header. *ForliteralIPv6addresses,thisdoesNOTincludethesurrounding[]
*/ constchar *hostname;
/** Time when the request started */
apr_time_t request_time;
/** Status line, if set by script */ constchar *status_line; /** Status line */ int status;
/* Request method, two ways; also, protocol, etc.. Outside of protocol.c, *look,butdon'ttouch.
*/
/** M_GET, M_POST, etc. */ int method_number; /** Request method (eg. GET, HEAD, POST, etc.) */ constchar *method;
/** byte count in stream is for body */
apr_off_t sent_bodyct; /** body byte count, for easy access */
apr_off_t bytes_sent; /** Last modified time of the requested resource */
apr_time_t mtime;
/* HTTP/1.1 connection-level features */
/** The Range: header */ constchar *range; /** The "real" content length */
apr_off_t clength; /** sending chunked transfer-coding */ int chunked;
/** Method for reading the request body *(eg.REQUEST_CHUNKED_ERROR,REQUEST_NO_BODY,
* REQUEST_CHUNKED_DECHUNK, etc...) */ int read_body; /** reading chunked transfer-coding */ int read_chunked; /** is client waiting for a 100 response? */ unsigned expecting_100; /** The optional kept body of the request. */
apr_bucket_brigade *kept_body; /** For ap_body_to_table(): parsed body */ /* XXX: ap_body_to_table has been removed. Remove body_table too or
* XXX: keep it to reintroduce ap_body_to_table without major bump? */
apr_table_t *body_table; /** Remaining bytes left to read from the request body */
apr_off_t remaining; /** Number of bytes that have been read from the request body */
apr_off_t read_length;
/* MIME header environments, in and out. Also, an array containing *environmentvariablestobepassedtosubprocesses,sopeoplecan *writemodulestoaddtothatenvironment. * *Thedifferencebetweenheaders_outanderr_headers_outisthatthe *latterareprintedevenonerror,andpersistacrossinternalredirects *(sotheheadersprintedforErrorDocumenthandlerswillhavethem). * *The'notes'apr_table_tisfornotesfromonemoduletoanother,withno *othersetpurposeinmind...
*/
/** MIME header environment from the request */
apr_table_t *headers_in; /** MIME header environment for the response */
apr_table_t *headers_out; /** MIME header environment for the response, printed even on errors and
* persist across internal redirects */
apr_table_t *err_headers_out; /** Array of environment variables to be used for sub processes */
apr_table_t *subprocess_env; /** Notes from one module to another */
apr_table_t *notes;
/* content_type, handler, content_encoding, and all content_languages *MUSTbelowercasedstrings.Theymaybepointerstostaticstrings; *theyshouldnotbemodifiedinplace.
*/ /** The content-type for the current request */ constchar *content_type; /* Break these out --- we dispatch on 'em */ /** The handler string that we use to call a handler function */ constchar *handler; /* What we *really* dispatch on */
/** How to encode the data */ constchar *content_encoding; /** Array of strings representing the content languages */
apr_array_header_t *content_languages;
/** variant list validator (if negotiated) */ char *vlist_validator;
/** If an authentication check was made, this gets set to the user name. */ char *user; /** If an authentication check was made, this gets set to the auth type. */ char *ap_auth_type;
/* What object is being requested (either directly, or via include *orcontent-negotiationmapping).
*/
/** The URI without any parsing performed */ char *unparsed_uri; /** The path portion of the URI, or "/" if no path provided */ char *uri; /** The filename on disk corresponding to this response */ char *filename; /** The true filename stored in the filesystem, as in the true alpha case *andaliascorrection,e.g."Image.jpeg"not"IMAGE$1.JPE"onWindows.
* The core map_to_storage canonicalizes r->filename when they mismatch */ char *canonical_filename; /** The PATH_INFO extracted from this request */ char *path_info; /** The QUERY_ARGS extracted from this request */ char *args;
/** *Flagforthehandlertoacceptorrejectpath_infoon *thecurrentrequest.Allmodulesshouldrespectthe *AP_REQ_ACCEPT_PATH_INFOandAP_REQ_REJECT_PATH_INFO *values,whileAP_REQ_DEFAULT_PATH_INFOindicatesthey *mayfollowexistingconventions.Thisissettothe *user'spreferenceuponHOOK_VERY_FIRSTofthefixups.
*/ int used_path_info;
/** A flag to determine if the eos bucket has been sent yet */ int eos_sent;
/* Various other config info which may change with .htaccess files *Theseareconfigvectors,withonevoid*pointerforeachmodule *(thethingpointedtobeingthemodule'sbusiness).
*/
/** Options set in config files, etc. */ struct ap_conf_vector_t *per_dir_config; /** Notes on *this* request */ struct ap_conf_vector_t *request_config;
/** Optional request log level configuration. Will usually point *toaserverorper_dirconfig,i.e.mustbecopiedbefore
* modifying */ conststruct ap_logconf *log;
/** Id to identify request in access and error log. Set when the first *errorlogentryforthisrequestisgenerated.
*/ constchar *log_id;
/** A list of output filters to be used for this request */ struct ap_filter_t *output_filters; /** A list of input filters to be used for this request */ struct ap_filter_t *input_filters;
/** A list of protocol level output filters to be used for this
* request */ struct ap_filter_t *proto_output_filters; /** A list of protocol level input filters to be used for this
* request */ struct ap_filter_t *proto_input_filters;
/** This response can not be cached */ int no_cache; /** There is no local copy of this response */ int no_local_copy;
/** A struct containing the components of URI */
apr_uri_t parsed_uri; /** finfo.protection (st_mode) set to zero if no such file */
apr_finfo_t finfo;
/** remote address information from conn_rec, can be overridden if *necessarybyamodule. *Thisistheaddressthatoriginatedtherequest.
*/
apr_sockaddr_t *useragent_addr; char *useragent_ip;
/** MIME trailer environment from the request */
apr_table_t *trailers_in; /** MIME trailer environment from the response */
apr_table_t *trailers_out;
/** Originator's DNS name, if known. NULL if DNS hasn't been checked, *""ifithasandnoaddresswasfound.N.B.Onlyaccessthisthough
* ap_get_useragent_host() */ char *useragent_host; /** have we done double-reverse DNS? -1 yes/failure, 0 not yet, *1yes/success
*/ int double_reverse; /** Request flags associated with this request. Use *AP_REQUEST_GET_BNOTE()andAP_REQUEST_SET_BNOTE()toaccess *theelementsofthisfield.
*/
ap_request_bnotes_t bnotes;
};
/** *@briefStructuretostorethingswhichareperconnection
*/ struct conn_rec { /** Pool associated with this connection */
apr_pool_t *pool; /** Physical vhost this conn came in on */
server_rec *base_server; /** used by http_vhost.c */ void *vhost_lookup_data;
/* Information about the connection itself */ /** local address */
apr_sockaddr_t *local_addr; /** remote address; this is the end-point of the next hop, for the address *oftherequestcreator,seeuseragent_addrinrequest_rec
*/
apr_sockaddr_t *client_addr;
/** Client's IP address; this is the end-point of the next hop, for the *IPoftherequestcreator,seeuseragent_ipinrequest_rec
*/ char *client_ip; /** Client's DNS name, if known. NULL if DNS hasn't been checked, *""ifithasandnoaddresswasfound.N.B.Onlyaccessthisthough
* get_remote_host() */ char *remote_host; /** Only ever set if doing rfc1413 lookups. N.B. Only access this through
* get_remote_logname() */ char *remote_logname;
/** server IP address */ char *local_ip; /** used for ap_get_server_name when UseCanonicalName is set to DNS
* (ignores setting of HostnameLookups) */ char *local_host;
/** ID of this connection; unique at any point in time */ long id; /** Config vector containing pointers to connections per-server
* config structures. */ struct ap_conf_vector_t *conn_config; /** Notes on *this* connection: send note from one module to
* another. must remain valid for all requests on this conn */
apr_table_t *notes; /** A list of input filters to be used for this connection */ struct ap_filter_t *input_filters; /** A list of output filters to be used for this connection */ struct ap_filter_t *output_filters; /** handle to scoreboard information for this connection */ void *sbh; /** The bucket allocator to use for all bucket/brigade creations */ struct apr_bucket_alloc_t *bucket_alloc; /** The current state of this connection; may be NULL if not used by MPM */
conn_state_t *cs; /** Is there data pending in the input filters? */ int data_in_input_filters; /** Is there data pending in the output filters? */ int data_in_output_filters;
/** Are there any filters that clogg/buffer the input stream, breaking *theeventmpm.
*/ unsignedint clogging_input_filters:1;
/** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
* 1 yes/success */ signedint double_reverse:2;
/** Are we still talking? */ unsigned aborted;
/** Are we going to keep the connection alive for another request?
* @see ap_conn_keepalive_e */
ap_conn_keepalive_e keepalive;
/** How many times have we used it? */ int keepalives;
/** Optional connection log level configuration. May point to a server or
* per_dir config, i.e. must be copied before modifying */ conststruct ap_logconf *log;
/** Id to identify this connection in error log. Set when the first *errorlogentryforthisconnectionisgenerated.
*/ constchar *log_id;
/** This points to the current thread being used to process this request, *overthelifetimeofarequest,thevaluemaychange.Usersoftheconnection *recordshouldnotrelyuponitstayingthesamebetweencallsthatinvolve *theMPM.
*/ #if APR_HAS_THREADS
apr_thread_t *current_thread; #endif
/** The "real" master connection. NULL if I am the master. */
conn_rec *master;
int outgoing;
};
/** *Enumerationofconnectionstates *ThetwostatesCONN_STATE_LINGER_NORMALandCONN_STATE_LINGER_SHORTmay *onlybesetbytheMPM.UseCONN_STATE_LINGERoutsideoftheMPM.
*/ typedefenum {
CONN_STATE_KEEPALIVE, /* Kept alive in the MPM (using KeepAliveTimeout) */
CONN_STATE_PROCESSING, /* Processed by process_connection hooks */
CONN_STATE_HANDLER, /* Processed by the modules handlers */
CONN_STATE_WRITE_COMPLETION, /* Flushed by the MPM before entering CONN_STATE_KEEPALIVE */
CONN_STATE_SUSPENDED, /* Suspended in the MPM until ap_run_resume_suspended() */
CONN_STATE_LINGER, /* MPM flushes then closes the connection with lingering */
CONN_STATE_LINGER_NORMAL, /* MPM has started lingering close with normal timeout */
CONN_STATE_LINGER_SHORT, /* MPM has started lingering close with short timeout */
CONN_STATE_ASYNC_WAITIO, /* Returning this state to the MPM will make it wait for *theconnectiontobereadableorwritableaccordingto *c->cs->sense(resp.CONN_SENSE_WANT_READor_WRITE),
* using the configured Timeout */
CONN_STATE_NUM, /* Number of states (keep here before aliases) */
typedefenum {
CONN_SENSE_DEFAULT,
CONN_SENSE_WANT_READ, /* next event must be read */
CONN_SENSE_WANT_WRITE /* next event must be write */
} conn_sense_e;
/** *@briefAstructuretocontainconnectionstateinformation
*/ struct conn_state_t { /** Current state of the connection */
conn_state_e state; /** Whether to read instead of write, or write instead of read */
conn_sense_e sense;
};
/** *@structserver_addr_rec *@briefAstructuretobeusedforPer-vhostconfig
*/ typedefstruct server_addr_rec server_addr_rec; struct server_addr_rec { /** The next server in the list */
server_addr_rec *next; /** The name given in "<VirtualHost>" */ char *virthost; /** The bound address, for this server */
apr_sockaddr_t *host_addr; /** The bound port, for this server */
apr_port_t host_port;
};
/** The log level for this server */ int level;
}; /** *@briefAstructuretostoreinformationforeachvirtualserver
*/ struct server_rec { /** The process this server is running in */
process_rec *process; /** The next server in the list */
server_rec *next;
/* Log files --- note that transfer log is now in the modules... */
/** The name of the error log */ char *error_fname; /** A file descriptor that references the error log */
apr_file_t *error_log; /** The log level configuration */ struct ap_logconf log;
/* Module-specific configuration for server, and defaults... */
/** Config vector containing pointers to modules' per-server config
* structures. */ struct ap_conf_vector_t *module_config; /** MIME type info, etc., before we start checking per-directory info */ struct ap_conf_vector_t *lookup_defaults;
/** The path to the config file that the server was defined in */ constchar *defn_name; /** The line of the config file that the server was defined on */ unsigned defn_line_number; /** true if this is the virtual server */ char is_virtual;
/* Information for redirects */
/** for redirects, etc. */
apr_port_t port; /** The server request scheme for redirect responses */ constchar *server_scheme;
/* Contact information */
/** The admin's contact information */ char *server_admin; /** The server hostname */ char *server_hostname;
/* Transaction handling */
/** I haven't got a clue */
server_addr_rec *addrs; /** Timeout, as an apr interval, before we give up */
apr_interval_time_t timeout; /** The apr interval we will wait for another request */
apr_interval_time_t keep_alive_timeout; /** Maximum requests per connection */ int keep_alive_max; /** Use persistent connections? */ int keep_alive;
/** Normal names for ServerAlias servers */
apr_array_header_t *names; /** Wildcarded names for ServerAlias servers */
apr_array_header_t *wild_names;
/** Pathname for ServerPath */ constchar *path; /** Length of path */ int pathlen;
/** limit on size of the HTTP request line */ int limit_req_line; /** limit on size of any request header field */ int limit_req_fieldsize; /** limit on number of request header fields */ int limit_req_fields;
/** Opaque storage location */ void *context;
/** Whether the keepalive timeout is explicit (1) or *inherited(0)fromthebaseserver(eitherfirst
* server on the same IP:port or main server) */ unsignedint keep_alive_timeout_set:1;
};
/** *@structap_sload_t *@briefAstructuretoholdserverloadparams
*/ typedefstruct ap_sload_t ap_sload_t; struct ap_sload_t { /* percentage of process/threads ready/idle (0->100)*/ int idle; /* percentage of process/threads busy (0->100) */ int busy; /* total bytes served */
apr_off_t bytes_served; /* total access count */ unsignedlong access_count;
};
/** *@structap_loadavg_t *@briefAstructuretoholdvariousserverloadavg
*/ typedefstruct ap_loadavg_t ap_loadavg_t; struct ap_loadavg_t { /* current loadavg, ala getloadavg() */ float loadavg; /* 5 min loadavg */ float loadavg5; /* 15 min loadavg */ float loadavg15;
};
/** Set context_prefix and context_document_root for a request. *@paramrTherequest *@paramprefixtheURIprefix,withouttrailingslash *@paramdocument_rootthecorrespondingdirectoryondisk,withouttrailing *slash *@noteIfoneofprefixofdocument_rootisNULL,thecorrsponding *propertywillnotbechanged.
*/
AP_DECLARE(void) ap_set_context_info(request_rec *r, constchar *prefix, constchar *document_root);
/** Set per-request document root. This is for mass virtual hosting modules *thatwanttoprovidethecorrectDOCUMENT_ROOTvaluetoscripts. *@paramrTherequest *@paramdocument_rootthedocumentrootfortherequest.
*/
AP_DECLARE(void) ap_set_document_root(request_rec *r, constchar *document_root);
/* String handling. The *_nc variants allow you to use non-const char **s as arguments(unfortunatelyCwon'tautomaticallyconvertachar**toaconst
char **) */
/* Scan a string for field content chars, as defined by RFC7230 section 3.2 *includingVCHAR/obs-text,aswellasHTandSP *@paramptrThestringtoscan *@returnApointertothefirst(non-HT)ASCIIctrlcharacter. *@notelwsandtrailingwhitespacearescanned,thecallerisresponsible *fortrimmingleadingandtrailingwhitespace
*/
AP_DECLARE(constchar *) ap_scan_http_field_content(constchar *ptr);
/* Scan a string for token characters, as defined by RFC7230 section 3.2.6 *@paramptrThestringtoscan *@returnApointertothefirstnon-tokencharacter.
*/
AP_DECLARE(constchar *) ap_scan_http_token(constchar *ptr);
/* Scan a string for visible ASCII (0x21-0x7E) or obstext (0x80+) *andreturnapointertothefirstSP/CTL/NULcharacterencountered. *@paramptrThestringtoscan *@returnApointertothefirstSP/CTLcharacter.
*/
AP_DECLARE(constchar *) ap_scan_vchar_obstext(constchar *ptr);
/** *Removeall////, /./ and /xx/../ substrings from a path, and more *dependingonpassedinflags. *@parampathThepathtonormalize *@paramflagsbitmaskofAP_NORMALIZE_*flags *@returnnon-zeroonsuccess
*/
AP_DECLARE(int) ap_normalize_path(char *path, unsignedint flags);
/** *@defgroupstopsignalFlagswhichindicateplaceswheretheservershouldstopfordebugging. *@{ *Asetofflagswhichindicateplaceswheretheservershouldraise(SIGSTOP). *Thisisusefulfordebugging,becauseyoucanthenattachtothatprocess *withgdbandcontinue.Thisisimportantincaseswhereone_process *debuggingisn'tpossible.
*/ /** stop on a Detach */ #define SIGSTOP_DETACH 1 /** stop making a child process */ #define SIGSTOP_MAKE_CHILD 2 /** stop spawning a child process */ #define SIGSTOP_SPAWN_CHILD 4 /** stop spawning a child process with a piped log */ #define SIGSTOP_PIPED_LOG_SPAWN 8 /** stop spawning a CGI child process */ #define SIGSTOP_CGI_CHILD 16
/** Macro to get GDB started */ #ifdef DEBUG_SIGSTOP externint raise_sigstop_flags; #define RAISE_SIGSTOP(x) do { \ if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
} while (0) #else #define RAISE_SIGSTOP(x) #endif /** @} */ /** *GetHTMLdescribingtheaddressand(optionally)adminoftheserver. *@paramprefixTextwhichisprependedtothereturnvalue *@paramrTherequest_rec *@returnHTMLdescribingtheserver,allocatedin@ar'spool.
*/
AP_DECLARE(constchar *) ap_psignature(constchar *prefix, request_rec *r);
/* The C library has functions that allow const to be silently dropped ... thesemacrosdetectthedropinmaintainermode,butusethenative methodsfornormalbuilds
AP_DECLARE(char *) ap_strchr(char *s, int c);
AP_DECLARE(constchar *) ap_strchr_c(constchar *s, int c);
AP_DECLARE(char *) ap_strrchr(char *s, int c);
AP_DECLARE(constchar *) ap_strrchr_c(constchar *s, int c);
AP_DECLARE(char *) ap_strstr(char *s, constchar *c);
AP_DECLARE(constchar *) ap_strstr_c(constchar *s, constchar *c);
#ifdef AP_DEBUG
#undef strchr # define strchr(s, c) ap_strchr(s,c) #undef strrchr # define strrchr(s, c) ap_strrchr(s,c) #undef strstr # define strstr(s, c) ap_strstr(s,c)
#else
/** use this instead of strchr */ # define ap_strchr(s, c) strchr(s, c) /** use this instead of strchr */ # define ap_strchr_c(s, c) strchr(s, c) /** use this instead of strrchr */ # define ap_strrchr(s, c) strrchr(s, c) /** use this instead of strrchr */ # define ap_strrchr_c(s, c) strrchr(s, c) /** use this instead of strrstr*/ # define ap_strstr(s, c) strstr(s, c) /** use this instead of strrstr*/ # define ap_strstr_c(s, c) strstr(s, c)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.