/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file mod_isapi.h
* @brief ISAPI module extension to Apache
*
* @defgroup MOD_ISAPI mod_isapi
* @ingroup APACHE_MODS
* @{
*/
#ifndef MOD_ISAPI_H
#define MOD_ISAPI_H
#ifdef __cplusplus
extern "C" {
#endif
/* The Version Information storage passed to a module on startup
* via the GetExtensionVersion() entry point.
*/
typedef struct HSE_VERSION_INFO {
/* The startup entry point that must be exported by every ISAPI handler
*/
/* Our internal 'HCONN' representation, always opaque to the user.
*/
/* Prototypes of the essential functions exposed by mod_isapi
* for the module to communicate with Apache.
*/
typedef int (APR_THREAD_FUNC
char *variable_name,
void *buf_data,
typedef int (APR_THREAD_FUNC
void *buf_data,
typedef int (APR_THREAD_FUNC
void *buf_data,
typedef int (APR_THREAD_FUNC
void *buf_data,
/* The ecb structure is passed on each invocation of the module
*/
typedef struct EXTENSION_CONTROL_BLOCK {
char *lpszMethod;
char *lpszQueryString;
char *lpszPathInfo;
char *lpszPathTranslated;
unsigned char *lpbData;
char *lpszContentType;
* an MS extension to ServerSupportFunction
*/
typedef struct HSE_SEND_HEADER_EX_INFO {
* "Content-Language: en\r\n"
* Note that (in spite of cchFoo lengths below)
* NULL characters will interfere in headers.
*/
* but Apache follows the client's negotiated
* HTTP contract to decide.
*/
/* Our only 'supported' MS extended flag bit for TransmitFile,
* HSE_IO_SEND_HEADERS indicates that Status+Headers are present
* in the pszStatusCode member of the HSE_TF_INFO structure.
*/
/* The remaining flags are MS extended flag bits that bear little
* relation to Apache; the rules that the Apache server obeys follow
* its own design and HTTP protocol filter rules.
*
* We do not support async, however, we fake it. If HSE_IO_SYNC is
* not passed, and a completion context was defined, we will invoke the
* completion function immediately following the transfer, and then
* return to the caller. If HSE_IO_SYNC is passed, there is no call
* necessary to the completion context.
*/
/* The Completion function prototype. This callback may be fixed with
* the HSE_REQ_IO_COMPLETION ServerSupportFunction call, or overriden
* for the HSE_REQ_TRANSMIT_FILE call.
*/
void *ctxt,
/* TransmitFile structure to pass to HSE_REQ_TRANSMIT_FILE, an MS extension
*/
typedef struct HSE_TF_INFO {
* HSE_REQ_IO_COMPLETION if not NULL
*/
void *pContext;
* not set. Includes HTTP status text
* plus header text lines, such as
* "200 OK\r\n"
*/
} HSE_TF_INFO;
typedef struct HSE_URL_MAPEX_INFO {
/* Original ISAPI ServerSupportFunction() HSE_code methods */
/* MS Extented methods to ISAPI ServerSupportFunction() HSE_code */
/* Added with ISAPI 4.0 */
/* Added after ISAPI 4.0 in IIS 5.0 */
/* The request entry point that must be exported by every ISAPI handler
*/
typedef apr_uint32_t (APR_THREAD_FUNC
/* Allowable return values from HttpExtensionProc (apparently 0 is also
* accepted by MS IIS, and we will respect it as Success.)
* If the HttpExtensionProc returns HSE_STATUS_PENDING, we will create
* a wait mutex and lock on it, until HSE_REQ_DONE_WITH_SESSION is called.
*/
/* Anticipated error code for common faults within mod_isapi itself
*/
#ifndef ERROR_INSUFFICIENT_BUFFER
#endif
#ifndef ERROR_INVALID_INDEX
#endif
#ifndef ERROR_INVALID_PARAMETER
#endif
#ifndef ERROR_READ_FAULT
#endif
#ifndef ERROR_WRITE_FAULT
#endif
#ifndef ERROR_SUCCESS
#define ERROR_SUCCESS 0
#endif
/* Valid flags passed with TerminateExtension()
*/
/* The shutdown entry point optionally exported by an ISAPI handler, passed
* HSE_TERM_MUST_UNLOAD or HSE_TERM_ADVISORY_UNLOAD. The module may return
* if passed HSE_TERM_ADVISORY_UNLOAD, and the module will remain loaded.
* If the module returns 1 to HSE_TERM_ADVISORY_UNLOAD it is immediately
* unloaded. If the module is passed HSE_TERM_MUST_UNLOAD, its return value
* is ignored.
*/
/* Module may return 0 if passed HSE_TERM_ADVISORY_UNLOAD, and the module
* will remain loaded, or 1 if it consents to being unloaded. If the module
* is passed HSE_TERM_MUST_UNLOAD, its return value is ignored.
*/
#ifdef __cplusplus
}
#endif
#endif /* !MOD_ISAPI_H */
/** @} */