57#define ISAPI_RETRY apr_time_from_sec(30)
65module AP_MODULE_DECLARE_DATA isapi_module;
103 ?
base->read_ahead_buflen
106 ?
base->log_unsupported
109 ?
base->log_to_errlog
140 "invalid module path, skipping %s",
filename);
146 "unable to stat, skipping %s",
fspec);
151 "not a regular file, skipping %s",
fspec);
159 "unable to cache, skipping %s",
fspec);
169 OR_FILEINFO,
"Maximum client request body to initially pass to the"
170 " ISAPI handler (default: 49152)"),
173 OR_FILEINFO,
"Log requests not supported by the ISAPI server"
174 " on or off (default: off)"),
177 OR_FILEINFO,
"Send all Append Log requests to the error log"
178 " on or off (default: off)"),
181 OR_FILEINFO,
"Append Log requests are concatenated to the query args"
182 " on or off (default: on)"),
185 OR_FILEINFO,
"Fake Asynchronous support for isapi callbacks"
186 " on or off [Experimental] (default: off)"),
188 RSRC_CONF,
"Cache the specified ISAPI extension in-process"),
275 "failed to load %s", isa->
filename);
281 "GetExtensionVersion");
285 "missing GetExtensionVersion() in %s",
293 "HttpExtensionProc");
297 "missing HttpExtensionProc() in %s",
306 "TerminateExtension");
313 "failed call to GetExtensionVersion() in %s",
353 rv = (*isa)->last_load_rv;
365 rv = (*isa)->last_load_rv;
397 (*isa)->last_load_rv = rv;
402 rv = (*isa)->last_load_rv;
412 rv = (*isa)->last_load_rv;
424 (*isa)->filename =
key;
448 (*isa)->last_load_rv = rv;
455 (*isa)->in_progress =
NULL;
466 return (*isa)->last_load_rv;
509 len += strlen(elts[
i].
key) + strlen(elts[
i].
val) + 3;
546 len += strlen(elts[
i].
key) + strlen(elts[
i].
val) + 4;
638 if (!head ||
headlen == 0 || !*head) {
653 stat =
"Status: 200 OK";
657 const char *
flip = head;
696 if (!head ||
headlen == 0 || !*head) {
731 cid->ecb->dwHttpStatusCode =
cid->r->status;
733 else if (
cid->r->status) {
740 cid->ecb->dwHttpStatusCode =
cid->r->status;
742 else if (
cid->ecb->dwHttpStatusCode
749 cid->r->status =
cid->ecb->dwHttpStatusCode;
763 cid->ecb->dwHttpStatusCode =
cid->r->status;
773 cid->ecb->dwHttpStatusCode =
cid->r->status;
775 "Could not determine HTTP response code; using %d",
788 cid->headers_set = 1;
820 if (!
cid->headers_set) {
843 cid->response_sent = 1;
846 "WriteClient ap_pass_brigade failed: %s",
852 cid->completion(
cid->ecb,
cid->completion_arg,
856 cid->completion(
cid->ecb,
cid->completion_arg,
886 cid->headers_set = 1;
934 cid->response_sent = 1;
937 "ServerSupportFunction "
938 "HSE_REQ_SEND_RESPONSE_HEADER "
939 "ap_pass_brigade failed: %s",
r->
filename);
953 if (
cid->completed) {
957 else if (
cid->dconf.log_unsupported) {
959 "ServerSupportFunction "
960 "HSE_REQ_DONE_WITH_SESSION is not supported: %s",
1002 if (
cid->dconf.log_unsupported)
1004 "ServerSupportFunction HSE_REQ_GET_SSPI_INFO "
1013 if (
cid->dconf.log_to_query) {
1019 if (
cid->dconf.log_to_errlog)
1032 if (
cid->dconf.fake_async) {
1037 if (
cid->dconf.log_unsupported)
1039 "ServerSupportFunction HSE_REQ_IO_COMPLETION "
1057 if (
cid->dconf.log_unsupported)
1059 "ServerSupportFunction HSE_REQ_TRANSMIT_FILE "
1060 "as HSE_IO_ASYNC is not supported: %s",
r->
filename);
1073 if (
tf->BytesToWrite) {
1100 strlen(
tf->pszStatusCode),
1103 else if (!
cid->headers_set &&
tf->pHead &&
tf->HeadLength
1104 && *(
char*)
tf->pHead) {
1117 tf->HeadLength -
ate,
1126 if (
tf->pTail &&
tf->TailLength) {
1129 tf->TailLength,
c->bucket_alloc);
1136 cid->response_sent = 1;
1139 "ServerSupportFunction "
1140 "HSE_REQ_TRANSMIT_FILE "
1141 "ap_pass_brigade failed: %s",
r->
filename);
1149 tf->pfnHseIO(
cid->ecb,
tf->pContext,
1153 tf->pfnHseIO(
cid->ecb,
tf->pContext,
1157 else if (
cid->completion) {
1159 cid->completion(
cid->ecb,
cid->completion_arg,
1163 cid->completion(
cid->ecb,
cid->completion_arg,
1172 if (
cid->dconf.log_unsupported)
1174 "ServerSupportFunction "
1175 "HSE_REQ_REFRESH_ISAPI_ACL "
1188 if (!
cid->dconf.fake_async) {
1189 if (
cid->dconf.log_unsupported)
1191 "asynchronous I/O not supported: %s",
1217 cid->completion(
cid->ecb,
cid->completion_arg,
1221 cid->completion(
cid->ecb,
cid->completion_arg,
1229 if (
cid->dconf.log_unsupported)
1231 "ServerSupportFunction "
1232 "HSE_REQ_GET_IMPERSONATION_TOKEN "
1246 sizeof(
info->lpszPath)) -
info->lpszPath;
1255 sizeof(
info->lpszPath) -
info->cchMatchingPath);
1258 &&
info->cchMatchingPath <
sizeof(
info->lpszPath) - 1) {
1260 ++
info->cchMatchingPath;
1261 ++
info->cchMatchingURL;
1265 &&
info->cchMatchingPath <
sizeof(
info->lpszPath) - 1) {
1267 info->lpszPath[
info->cchMatchingPath++] =
'/';
1268 info->lpszPath[
info->cchMatchingPath] =
'\0';
1273 while (
info->cchMatchingPath &&
info->cchMatchingURL) {
1274 if (
info->lpszPath[
info->cchMatchingPath - 1] ==
'/')
1276 --
info->cchMatchingPath;
1277 --
info->cchMatchingURL;
1308 if (
cid->dconf.log_unsupported)
1310 "ServerSupportFunction HSE_REQ_ABORTIVE_CLOSE"
1316 if (
cid->dconf.log_unsupported)
1318 "ServerSupportFunction "
1319 "HSE_REQ_GET_CERT_INFO_EX "
1349 cid->response_sent = 1;
1352 "ServerSupportFunction "
1353 "HSE_REQ_SEND_RESPONSE_HEADER_EX "
1354 "ap_pass_brigade failed: %s",
r->
filename);
1365 if (
cid->dconf.log_unsupported)
1367 "ServerSupportFunction "
1368 "HSE_REQ_CLOSE_CONNECTION "
1383 if (
cid->dconf.log_unsupported)
1385 "ServerSupportFunction "
1386 "HSE_REQ_EXTENSION_TRIGGER "
1392 if (
cid->dconf.log_unsupported)
1394 "ServerSupportFunction (%d) not supported: "
1487 cid->ecb->dwHttpStatusCode = 0;
1516 cid->ecb->cbAvailable =
cid->dconf.read_ahead_buflen;
1518 cid->ecb->cbAvailable =
cid->ecb->cbTotalBytes;
1522 cid->ecb->cbTotalBytes = 0xffffffff;
1523 cid->ecb->cbAvailable =
cid->dconf.read_ahead_buflen;
1531 cid->ecb->cbAvailable - read)) > 0)) {
1543 cid->ecb->cbAvailable =
cid->ecb->cbTotalBytes = read;
1545 cid->ecb->cbAvailable = read;
1546 cid->ecb->lpbData[read] =
'\0';
1549 cid->ecb->cbTotalBytes = 0;
1550 cid->ecb->cbAvailable = 0;
1566 if (
cid->dconf.fake_async) {
1576 "Failed to create completion mutex");
1585 if (*
cid->ecb->lpszLogData) {
1607 if (
cid->completed) {
1617 else if (
cid->dconf.log_unsupported) {
1619 "asynch I/O result HSE_STATUS_PENDING "
1620 "from HttpExtensionProc() is not supported: %s",
1630 "HSE_STATUS_ERROR result from "
1631 "HttpExtensionProc(): %s",
r->
filename);
1637 "unrecognized result code %d "
1638 "from HttpExtensionProc(): %s ",
1645 if (
cid->headers_set ||
cid->response_sent) {
1655 cid->response_sent = 1;
1659 "ap_pass_brigade failed to "
1660 "complete the response: %s ",
r->
filename);
1692 "could not create the isapi cache pool");
1700 "Failed to create module cache");
1708 "Failed to create module cache lock");
Symbol export macros and hook functions.
const char apr_size_t len
APR-UTIL Buckets/Bucket Brigades.
APR general purpose library routines.
APR Portability Routines.
APR Thread Mutex Routines.
APR Reader/Writer Lock Routines.
static apr_pool_t * pconf
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
#define AP_DECLARE_MODULE(foo)
#define AP_INIT_FLAG(directive, func, mconfig, where, help)
#define AP_INIT_ITERATE(directive, func, mconfig, where, help)
const char * ap_set_int_slot(cmd_parms *cmd, void *struct_ptr, const char *arg)
char * ap_server_root_relative(apr_pool_t *p, const char *fname)
void ap_hook_handler(ap_HOOK_handler_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
void ap_hook_pre_config(ap_HOOK_pre_config_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
const char * ap_set_flag_slot(cmd_parms *cmd, void *struct_ptr, int arg)
apr_status_t ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket)
int ap_allow_options(request_rec *r)
#define APLOG_MODULE_INDEX
int ap_should_client_block(request_rec *r)
long ap_get_client_block(request_rec *r, char *buffer, apr_size_t bufsiz)
const char * ap_get_status_line(int status)
int ap_setup_client_block(request_rec *r, int read_policy)
request_rec * ap_sub_req_lookup_uri(const char *new_uri, const request_rec *r, ap_filter_t *next_filter)
void ap_destroy_sub_req(request_rec *r)
void ap_internal_redirect(const char *new_uri, request_rec *r)
void ap_add_common_vars(request_rec *r)
void ap_add_cgi_vars(request_rec *r)
int ap_scan_script_header_err_strs_ex(request_rec *r, char *buffer, int module_index, const char **termch, int *termarg,...)
#define APR_BRIGADE_INSERT_TAIL(b, e)
apr_pool_t apr_dbd_t apr_dbd_results_t ** res
const char apr_ssize_t int flags
#define HTTP_INTERNAL_SERVER_ERROR
#define HTTP_MOVED_TEMPORARILY
#define ap_is_HTTP_SERVER_ERROR(x)
#define HSE_REQ_ABORTIVE_CLOSE
#define ERROR_INVALID_PARAMETER
#define HSE_APPEND_LOG_PARAMETER
#define HSE_REQ_ASYNC_READ_CLIENT
#define HSE_STATUS_PENDING
#define ERROR_WRITE_FAULT
#define HSE_REQ_MAP_URL_TO_PATH_EX
#define HSE_IO_SEND_HEADERS
#define ERROR_INVALID_INDEX
#define HSE_REQ_GET_IMPERSONATION_TOKEN
#define HSE_REQ_CLOSE_CONNECTION
#define HSE_TERM_MUST_UNLOAD
#define HSE_REQ_SEND_RESPONSE_HEADER_EX
void(APR_THREAD_FUNC * PFN_HSE_IO_COMPLETION)(EXTENSION_CONTROL_BLOCK *ecb, void *ctxt, apr_uint32_t cbIO, apr_uint32_t dwError)
#define HSE_TERM_ADVISORY_UNLOAD
#define HSE_REQ_SEND_URL_REDIRECT_RESP
#define HSE_STATUS_SUCCESS
int(APR_THREAD_FUNC * PFN_TERMINATEEXTENSION)(apr_uint32_t flags)
#define ERROR_INSUFFICIENT_BUFFER
#define HSE_REQ_GET_CERT_INFO_EX
#define HSE_REQ_SEND_RESPONSE_HEADER
#define HSE_REQ_TRANSMIT_FILE
#define HSE_REQ_DONE_WITH_SESSION
#define HSE_REQ_GET_SSPI_INFO
#define HSE_REQ_IS_CONNECTED
#define HSE_REQ_IS_KEEP_CONN
#define HSE_STATUS_SUCCESS_AND_KEEP_CONN
#define HSE_REQ_EXTENSION_TRIGGER
#define HSE_REQ_IO_COMPLETION
#define HSE_REQ_MAP_URL_TO_PATH
int(APR_THREAD_FUNC * PFN_GETEXTENSIONVERSION)(HSE_VERSION_INFO *ver_info)
apr_uint32_t(APR_THREAD_FUNC * PFN_HTTPEXTENSIONPROC)(EXTENSION_CONTROL_BLOCK *ecb)
#define HSE_REQ_REFRESH_ISAPI_ACL
#define STANDARD20_MODULE_STUFF
#define APR_FROM_OS_ERROR(e)
#define apr_set_os_error(e)
#define apr_get_os_error()
const char apr_file_t * file
#define APR_FILEPATH_NATIVE
apr_array_header_t ** result
void * memchr(const void *s, int c, size_t n)
#define APR_HASH_KEY_STRING
apr_vformatter_buff_t * c
#define apr_pcalloc(p, size)
apr_size_t const char * filename
const apr_array_header_t * arr
#define REQUEST_CHUNKED_ERROR
#define AP_REQ_REJECT_PATH_INFO
mod_core private header file
static const command_rec isapi_cmds[]
static void * create_isapi_dir_config(apr_pool_t *p, char *dummy)
static apr_status_t isapi_handler(request_rec *r)
static struct isapi_global_conf loaded
static int APR_THREAD_FUNC regfnServerSupportFunction(isapi_cid *cid, apr_uint32_t HSE_code, void *buf_ptr, apr_uint32_t *buf_size, apr_uint32_t *data_type)
apr_status_t isapi_lookup(apr_pool_t *p, server_rec *s, request_rec *r, const char *fpath, isapi_loaded **isa)
static int APR_THREAD_FUNC regfnGetServerVariable(isapi_cid *cid, char *variable_name, void *buf_ptr, apr_uint32_t *buf_size)
static int APR_THREAD_FUNC regfnWriteClient(isapi_cid *cid, void *buf_ptr, apr_uint32_t *size_arg, apr_uint32_t flags)
static void isapi_hooks(apr_pool_t *cont)
static apr_status_t isapi_load(apr_pool_t *p, server_rec *s, isapi_loaded *isa)
static apr_status_t cleanup_isapi(void *isa_)
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 int APR_THREAD_FUNC regfnReadClient(isapi_cid *cid, void *buf_data, apr_uint32_t *buf_size)
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 int isapi_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp)
static void * merge_isapi_dir_configs(apr_pool_t *p, void *base_, void *add_)
ISAPI module extension to Apache.
apr_fileperms_t protection
Structure to store things which are per connection.
ap_conn_keepalive_e keepalive
apr_thread_mutex_t * completed
PFN_HSE_IO_COMPLETION completion
EXTENSION_CONTROL_BLOCK * ecb
apr_thread_mutex_t * lock
apr_status_t last_load_rv
apr_dso_handle_t * handle
apr_uint32_t report_version
apr_time_t last_load_time
PFN_TERMINATEEXTENSION TerminateExtension
PFN_GETEXTENSIONVERSION GetExtensionVersion
apr_thread_rwlock_t * in_progress
HSE_VERSION_INFO * isapi_version
PFN_HTTPEXTENSIONPROC HttpExtensionProc
A structure that represents the current request.
struct ap_filter_t * output_filters
apr_table_t * subprocess_env
struct ap_conf_vector_t * per_dir_config
apr_table_t * headers_out
A structure to store information for each virtual server.