Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

mod_isapi.c File Reference

#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_request.h"
#include "http_log.h"
#include "util_script.h"
#include "mod_core.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_portable.h"
#include "apr_buckets.h"
#include "apr_thread_mutex.h"
#include "apr_thread_rwlock.h"
#include "apr_hash.h"
#include "mod_isapi.h"

Include dependency graph for mod_isapi.c:

Go to the source code of this file.

Defines

#define ISAPI_RETRY   apr_time_from_sec(30)
#define ISAPI_UNDEF   -1

Typedefs

typedef isapi_dir_conf isapi_dir_conf
typedef isapi_loaded isapi_loaded

Functions

apr_status_t isapi_lookup (apr_pool_t *p, server_rec *s, request_rec *r, const char *fpath, isapi_loaded **isa)
static void * create_isapi_dir_config (apr_pool_t *p, char *dummy)
static void * merge_isapi_dir_configs (apr_pool_t *p, void *base_, void *add_)
static const char * isapi_cmd_cachefile (cmd_parms *cmd, void *dummy, const char *filename)
static apr_status_t isapi_unload (isapi_loaded *isa, int force)
static apr_status_t cleanup_isapi (void *isa_)
static apr_status_t isapi_load (apr_pool_t *p, server_rec *s, isapi_loaded *isa)
int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, char *variable_name, void *buf_data, apr_uint32_t *buf_size)
int APR_THREAD_FUNC ReadClient (isapi_cid *cid, void *buf_data, apr_uint32_t *buf_size)
static apr_ssize_t send_response_header (isapi_cid *cid, const char *stat, const char *head, apr_size_t statlen, apr_size_t headlen)
int APR_THREAD_FUNC WriteClient (isapi_cid *cid, void *buf_data, apr_uint32_t *size_arg, apr_uint32_t flags)
int APR_THREAD_FUNC ServerSupportFunction (isapi_cid *cid, apr_uint32_t HSE_code, void *buf_data, apr_uint32_t *buf_size, apr_uint32_t *data_type)
apr_status_t isapi_handler (request_rec *r)
static int isapi_pre_config (apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
static void isapi_hooks (apr_pool_t *cont)

Variables

module AP_MODULE_DECLARE_DATA isapi_module
static const command_rec isapi_cmds []
static struct isapi_global_conf loaded


Define Documentation

#define ISAPI_RETRY   apr_time_from_sec(30)
 

Definition at line 57 of file mod_isapi.c.

Referenced by isapi_lookup().

#define ISAPI_UNDEF   -1
 

Definition at line 67 of file mod_isapi.c.

Referenced by create_isapi_dir_config(), isapi_handler(), and merge_isapi_dir_configs().


Typedef Documentation

typedef struct isapi_dir_conf isapi_dir_conf
 

typedef struct isapi_loaded isapi_loaded
 

Definition at line 78 of file mod_isapi.c.


Function Documentation

static apr_status_t cleanup_isapi void *  isa_  )  [static]
 

Definition at line 244 of file mod_isapi.c.

References isapi_unload().

Referenced by isapi_load().

Here is the call graph for this function:

static void* create_isapi_dir_config apr_pool_t p,
char *  dummy
[static]
 

Definition at line 83 of file mod_isapi.c.

References dir, isapi_dir_conf::fake_async, ISAPI_UNDEF, isapi_dir_conf::log_to_errlog, isapi_dir_conf::log_to_query, isapi_dir_conf::log_unsupported, and isapi_dir_conf::read_ahead_buflen.

int APR_THREAD_FUNC GetServerVariable isapi_cid cid,
char *  variable_name,
void *  buf_data,
apr_uint32_t *  buf_size
 

Definition at line 488 of file mod_isapi.c.

References arr, apr_array_header_t::elts, ERROR_INSUFFICIENT_BUFFER, ERROR_INVALID_INDEX, request_rec::headers_in, key, len, nelts, isapi_cid::r, r, result, request_rec::subprocess_env, and val.

Referenced by isapi_handler().

static const char* isapi_cmd_cachefile cmd_parms cmd,
void *  dummy,
const char *  filename
[static]
 

Definition at line 121 of file mod_isapi.c.

References APLOG_MARK, APLOG_WARNING, APR_EBADPATH, APR_FINFO_TYPE, APR_REG, APR_SUCCESS, apr_finfo_t::filetype, isapi_lookup(), NULL, cmd_parms_struct::pool, cmd_parms_struct::server, and cmd_parms_struct::temp_pool.

Here is the call graph for this function:

apr_status_t isapi_handler request_rec r  ) 
 

Definition at line 1332 of file mod_isapi.c.

References ap_get_module_config, ap_is_HTTP_SERVER_ERROR, AP_REQ_REJECT_PATH_INFO, APLOG_INFO, APLOG_MARK, APLOG_WARNING, APR_BRIGADE_INSERT_TAIL, APR_NOFILE, apr_pcalloc, APR_REG, APR_SUCCESS, b, bb, conn_rec::bucket_alloc, c, EXTENSION_CONTROL_BLOCK::cbAvailable, EXTENSION_CONTROL_BLOCK::cbSize, EXTENSION_CONTROL_BLOCK::cbTotalBytes, isapi_cid::completed, EXTENSION_CONTROL_BLOCK::ConnID, isapi_cid::dconf, DECLINED, EXTENSION_CONTROL_BLOCK::dwHttpStatusCode, EXTENSION_CONTROL_BLOCK::dwVersion, e, isapi_cid::ecb, isapi_dir_conf::fake_async, request_rec::filename, apr_finfo_t::filetype, request_rec::finfo, GetServerVariable(), EXTENSION_CONTROL_BLOCK::GetServerVariable, request_rec::handler, isapi_cid::headers_set, HSE_STATUS_ERROR, HSE_STATUS_PENDING, HSE_STATUS_SUCCESS, HSE_STATUS_SUCCESS_AND_KEEP_CONN, HTTP_FORBIDDEN, HTTP_INTERNAL_SERVER_ERROR, HTTP_NOT_FOUND, isapi_loaded::HttpExtensionProc, isapi_cid::isa, isapi_lookup(), isapi_module, ISAPI_UNDEF, isapi_unload(), isapi_dir_conf::log_to_errlog, isapi_dir_conf::log_to_query, isapi_dir_conf::log_unsupported, EXTENSION_CONTROL_BLOCK::lpbData, EXTENSION_CONTROL_BLOCK::lpszContentType, EXTENSION_CONTROL_BLOCK::lpszLogData, EXTENSION_CONTROL_BLOCK::lpszMethod, EXTENSION_CONTROL_BLOCK::lpszPathInfo, EXTENSION_CONTROL_BLOCK::lpszPathTranslated, EXTENSION_CONTROL_BLOCK::lpszQueryString, NULL, OK, OPT_EXECCGI, request_rec::path_info, request_rec::per_dir_config, apr_thread_mutex_t::pool, request_rec::pool, isapi_cid::r, read, isapi_dir_conf::read_ahead_buflen, ReadClient(), EXTENSION_CONTROL_BLOCK::ReadClient, isapi_loaded::report_version, REQUEST_CHUNKED_ERROR, isapi_cid::response_sent, request_rec::server, ServerSupportFunction(), EXTENSION_CONTROL_BLOCK::ServerSupportFunction, request_rec::status, request_rec::subprocess_env, request_rec::used_path_info, val, void(), WriteClient(), and EXTENSION_CONTROL_BLOCK::WriteClient.

Referenced by isapi_hooks().

Here is the call graph for this function:

static void isapi_hooks apr_pool_t cont  )  [static]
 

Definition at line 1633 of file mod_isapi.c.

References APR_HOOK_MIDDLE, isapi_handler(), isapi_pre_config(), and NULL.

Here is the call graph for this function:

static apr_status_t isapi_load apr_pool_t p,
server_rec s,
isapi_loaded isa
[static]
 

Definition at line 254 of file mod_isapi.c.

References APLOG_ERR, APLOG_MARK, apr_get_os_error, apr_pcalloc, APR_SUCCESS, cleanup_isapi(), isapi_loaded::filename, isapi_loaded::GetExtensionVersion, isapi_loaded::handle, isapi_loaded::HttpExtensionProc, isapi_loaded::isapi_version, NULL, isapi_loaded::report_version, isapi_loaded::TerminateExtension, and isapi_loaded::timeout.

Referenced by isapi_lookup().

Here is the call graph for this function:

apr_status_t isapi_lookup apr_pool_t p,
server_rec s,
request_rec r,
const char *  fpath,
isapi_loaded **  isa
 

Definition at line 326 of file mod_isapi.c.

References APR_HASH_KEY_STRING, apr_pcalloc, APR_SUCCESS, isapi_global_conf::hash, isapi_load(), ISAPI_RETRY, key, loaded, isapi_global_conf::lock, NULL, isapi_global_conf::pool, and unlock.

Referenced by isapi_cmd_cachefile(), and isapi_handler().

Here is the call graph for this function:

static int isapi_pre_config apr_pool_t pconf,
apr_pool_t plog,
apr_pool_t ptemp
[static]
 

Definition at line 1605 of file mod_isapi.c.

References APLOG_ERR, APLOG_MARK, APR_EGENERAL, apr_pool_sub_make, APR_SUCCESS, isapi_global_conf::hash, loaded, isapi_global_conf::lock, NULL, OK, and isapi_global_conf::pool.

Referenced by isapi_hooks().

static apr_status_t isapi_unload isapi_loaded isa,
int  force
[static]
 

Definition at line 220 of file mod_isapi.c.

References APR_EGENERAL, APR_SUCCESS, isapi_loaded::handle, HSE_TERM_ADVISORY_UNLOAD, HSE_TERM_MUST_UNLOAD, NULL, and isapi_loaded::TerminateExtension.

Referenced by cleanup_isapi(), and isapi_handler().

static void* merge_isapi_dir_configs apr_pool_t p,
void *  base_,
void *  add_
[static]
 

Definition at line 96 of file mod_isapi.c.

References base, dir, isapi_dir_conf::fake_async, ISAPI_UNDEF, isapi_dir_conf::log_to_errlog, isapi_dir_conf::log_to_query, isapi_dir_conf::log_unsupported, and isapi_dir_conf::read_ahead_buflen.

int APR_THREAD_FUNC ReadClient isapi_cid cid,
void *  buf_data,
apr_uint32_t *  buf_size
 

Definition at line 589 of file mod_isapi.c.

References ERROR_READ_FAULT, isapi_cid::r, r, read, and request_rec::remaining.

Referenced by isapi_handler().

static apr_ssize_t send_response_header isapi_cid cid,
const char *  stat,
const char *  head,
apr_size_t  statlen,
apr_size_t  headlen
[static]
 

Definition at line 624 of file mod_isapi.c.

References apr_isdigit, apr_isspace, EXTENSION_CONTROL_BLOCK::dwHttpStatusCode, isapi_cid::ecb, isapi_cid::headers_set, HTTP_INTERNAL_SERVER_ERROR, HTTP_OK, memchr(), NULL, request_rec::pool, isapi_cid::r, request_rec::status, request_rec::status_line, termarg, and termch.

Referenced by ServerSupportFunction(), and WriteClient().

Here is the call graph for this function:

int APR_THREAD_FUNC ServerSupportFunction isapi_cid cid,
apr_uint32_t  HSE_code,
void *  buf_data,
apr_uint32_t *  buf_size,
apr_uint32_t *  data_type
 

Definition at line 814 of file mod_isapi.c.

References conn_rec::aborted, AP_CONN_KEEPALIVE, AP_MAX_SENDFILE, APLOG_INFO, APLOG_MARK, APLOG_WARNING, APR_BRIGADE_INSERT_TAIL, apr_bucket_copy, APR_DIR, APR_FINFO_SIZE, APR_NOFILE, APR_READ, APR_SUCCESS, APR_UEXECUTE, APR_UREAD, APR_UWRITE, APR_XTHREAD, request_rec::args, b, bb, conn_rec::bucket_alloc, HSE_TF_INFO::BytesToWrite, c, HSE_SEND_HEADER_EX_INFO::cchHeader, HSE_URL_MAPEX_INFO::cchMatchingPath, HSE_URL_MAPEX_INFO::cchMatchingURL, HSE_SEND_HEADER_EX_INFO::cchStatus, request_rec::connection, HSE_URL_MAPEX_INFO::dwFlags, HSE_TF_INFO::dwFlags, ERROR_INVALID_PARAMETER, ERROR_READ_FAULT, ERROR_SUCCESS, ERROR_WRITE_FAULT, fd, file, request_rec::filename, apr_finfo_t::filetype, request_rec::finfo, request_rec::headers_in, request_rec::headers_out, HSE_TF_INFO::HeadLength, HSE_TF_INFO::hFile, HSE_APPEND_LOG_PARAMETER, HSE_IO_ASYNC, HSE_IO_SEND_HEADERS, HSE_REQ_ABORTIVE_CLOSE, HSE_REQ_ASYNC_READ_CLIENT, HSE_REQ_CLOSE_CONNECTION, HSE_REQ_DONE_WITH_SESSION, HSE_REQ_EXTENSION_TRIGGER, HSE_REQ_GET_CERT_INFO_EX, HSE_REQ_GET_IMPERSONATION_TOKEN, HSE_REQ_GET_SSPI_INFO, HSE_REQ_IO_COMPLETION, HSE_REQ_IS_CONNECTED, HSE_REQ_IS_KEEP_CONN, HSE_REQ_MAP_URL_TO_PATH, HSE_REQ_MAP_URL_TO_PATH_EX, HSE_REQ_REFRESH_ISAPI_ACL, HSE_REQ_SEND_RESPONSE_HEADER, HSE_REQ_SEND_RESPONSE_HEADER_EX, HSE_REQ_SEND_URL, HSE_REQ_SEND_URL_REDIRECT_RESP, HSE_REQ_TRANSMIT_FILE, HTTP_MOVED_TEMPORARILY, HUGE_STRING_LEN, info, conn_rec::keepalive, len, apr_bucket::length, HSE_URL_MAPEX_INFO::lpszPath, M_GET, request_rec::method, request_rec::method_number, request_rec::notes, NULL, HSE_TF_INFO::Offset, OK, request_rec::output_filters, request_rec::path_info, HSE_TF_INFO::pContext, HSE_TF_INFO::pfnHseIO, HSE_TF_INFO::pHead, request_rec::pool, apr_finfo_t::protection, HSE_SEND_HEADER_EX_INFO::pszHeader, HSE_SEND_HEADER_EX_INFO::pszStatus, HSE_TF_INFO::pszStatusCode, HSE_TF_INFO::pTail, r, read, request_rec::remaining, send_response_header(), apr_finfo_t::size, HSE_TF_INFO::TailLength, and void().

Referenced by isapi_handler().

Here is the call graph for this function:

int APR_THREAD_FUNC WriteClient isapi_cid cid,
void *  buf_data,
apr_uint32_t *  size_arg,
apr_uint32_t  flags
 

Definition at line 762 of file mod_isapi.c.

References APR_BRIGADE_INSERT_TAIL, b, bb, conn_rec::bucket_alloc, c, request_rec::connection, ERROR_INVALID_PARAMETER, ERROR_SUCCESS, ERROR_WRITE_FAULT, HSE_IO_ASYNC, NULL, OK, request_rec::output_filters, request_rec::pool, r, and send_response_header().

Referenced by isapi_handler().

Here is the call graph for this function:


Variable Documentation

const command_rec isapi_cmds[] [static]
 

Initial value:

 {
    AP_INIT_TAKE1("ISAPIReadAheadBuffer", ap_set_int_slot,
        (void *)APR_OFFSETOF(isapi_dir_conf, read_ahead_buflen), 
        OR_FILEINFO, "Maximum client request body to initially pass to the"
                     " ISAPI handler (default: 49152)"),
    AP_INIT_FLAG("ISAPILogNotSupported", ap_set_flag_slot,
        (void *)APR_OFFSETOF(isapi_dir_conf, log_unsupported), 
        OR_FILEINFO, "Log requests not supported by the ISAPI server"
                     " on or off (default: off)"),
    AP_INIT_FLAG("ISAPIAppendLogToErrors", ap_set_flag_slot,
        (void *)APR_OFFSETOF(isapi_dir_conf, log_to_errlog), 
        OR_FILEINFO, "Send all Append Log requests to the error log"
                     " on or off (default: off)"),
    AP_INIT_FLAG("ISAPIAppendLogToQuery", ap_set_flag_slot,
        (void *)APR_OFFSETOF(isapi_dir_conf, log_to_query), 
        OR_FILEINFO, "Append Log requests are concatinated to the query args"
                     " on or off (default: on)"),
    AP_INIT_FLAG("ISAPIFakeAsync", ap_set_flag_slot,
        (void *)APR_OFFSETOF(isapi_dir_conf, fake_async), 
        OR_FILEINFO, "Fake Asynchronous support for isapi callbacks"
                     " on or off [Experimental] (default: off)"),
    AP_INIT_ITERATE("ISAPICacheFile", isapi_cmd_cachefile, NULL, 
        RSRC_CONF, "Cache the specified ISAPI extension in-process"),
    {NULL}
}

Definition at line 166 of file mod_isapi.c.

module AP_MODULE_DECLARE_DATA isapi_module
 

Initial value:

Definition at line 1639 of file mod_isapi.c.

Referenced by isapi_handler().

struct isapi_global_conf loaded [static]
 

Referenced by isapi_lookup(), and isapi_pre_config().