mod_isapi.c revision d4f351074a8f7af5e41aa0a70410816436608e3d
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny/* ====================================================================
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * The Apache Software License, Version 1.1
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Redistribution and use in source and binary forms, with or without
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * modification, are permitted provided that the following conditions
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * 1. Redistributions of source code must retain the above copyright
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * notice, this list of conditions and the following disclaimer.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * 2. Redistributions in binary form must reproduce the above copyright
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * notice, this list of conditions and the following disclaimer in
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * the documentation and/or other materials provided with the
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * distribution.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * 3. The end-user documentation included with the redistribution,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * if any, must include the following acknowledgment:
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * "This product includes software developed by the
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Apache Software Foundation (http://www.apache.org/)."
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Alternately, this acknowledgment may appear in the software itself,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * if and wherever such third-party acknowledgments normally appear.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * 4. The names "Apache" and "Apache Software Foundation" must
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * not be used to endorse or promote products derived from this
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * software without prior written permission. For written
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * permission, please contact apache@apache.org.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * 5. Products derived from this software may not be called "Apache",
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * nor may "Apache" appear in their name, without prior written
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * permission of the Apache Software Foundation.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * SUCH DAMAGE.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * ====================================================================
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * This software consists of voluntary contributions made by many
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * individuals on behalf of the Apache Software Foundation. For more
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * information on the Apache Software Foundation, please see
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * Portions of this software are based upon public domain software
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * originally written at the National Center for Supercomputing Applications,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * University of Illinois, Urbana-Champaign.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * mod_isapi.c - Internet Server Application (ISA) module for Apache
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * by Alexei Kosut <akosut@apache.org>
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * This module implements Microsoft's ISAPI, allowing Apache (when running
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * under Windows) to load Internet Server Applications (ISAPI extensions).
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * It implements all of the ISAPI 2.0 specification, except for the
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * "Microsoft-only" extensions dealing with asynchronous I/O. All ISAPI
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * extensions that use only synchronous I/O and are compatible with the
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * ISAPI 2.0 specification should work (most ISAPI 1.0 extensions should
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * function as well).
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * To load, simply place the ISA in a location in the document tree.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * Then add an "AddHandler isapi-isa dll" into your config file.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * You should now be able to load ISAPI DLLs just be reffering to their
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * URLs. Make sure the ExecCGI option is active in the directory
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek * the ISA is in.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* We use the exact same header file as the original */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#pragma message("WARNING: This build of Apache is missing the recent changes")
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#pragma message("in the Microsoft Win32 Platform SDK; some mod_isapi features")
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#pragma message("will be disabled. To obtain the latest Platform SDK files,")
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek#pragma message("http://msdn.microsoft.com/downloads/sdks/platform/platform.asp")
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* TODO: Unknown errors that must be researched for correct codes */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* Seems IIS does not enforce the requirement for \r\n termination on HSE_REQ_SEND_RESPONSE_HEADER,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek define this to conform */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* Declare the ISAPI functions */
b5825c74b6bf7a99ae2172392dbecb51179013a6Jakub HrozekBOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekBOOL WINAPI WriteClient (HCONN ConnID, LPVOID Buffer, LPDWORD lpwdwBytes,
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekBOOL WINAPI ReadClient (HCONN ConnID, LPVOID lpvBuffer, LPDWORD lpdwSize);
50936fc7230a9b3f01e285e72c4182013542f53eJakub HrozekBOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest,
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek The optimiser blows it totally here. What happens is that autos are addressed relative to the
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek stack pointer, which, of course, moves around. The optimiser seems to lose track of it somewhere
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek between setting HttpExtensionProc's address and calling through it. We work around the problem by
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek forcing it to use frame pointers.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek The revisions below may eliminate this artifact.
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* Our isapi server config structure */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozektypedef struct {
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* Our loaded isapi module description structure */
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozektypedef struct {
50936fc7230a9b3f01e285e72c4182013542f53eJakub Hrozek/* Our "Connection ID" structure */
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozektypedef struct {
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozekstatic BOOL isapi_unload(isapi_loaded* isa, int force);
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozekstatic apr_status_t cleanup_isapi_server_config(void *sconfv)
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek while(n--) {
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozekstatic void *create_isapi_server_config(apr_pool_t *p, server_rec *s)
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek isapi_server_conf *sconf = apr_palloc(p, sizeof(isapi_server_conf));
f191a6f9f3313df88eaf3debf52eebfe5d3dee59Michal Židek sconf->loaded = apr_array_make(p, 20, sizeof(isapi_loaded*));
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek apr_pool_cleanup_register(p, sconf, cleanup_isapi_server_config,
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozekstatic int compare_loaded(const void *av, const void *bv)
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozekstatic void isapi_post_config(apr_pool_t *p, apr_pool_t *plog,
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek isapi_server_conf *sconf = ap_get_module_config(s->module_config,
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek isapi_loaded **elts = (isapi_loaded **)sconf->loaded->elts;
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek /* sort the elements of the main_server, by filename */
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek qsort(elts, nelts, sizeof(isapi_loaded*), compare_loaded);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* and make the virtualhosts share the same thing */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny ap_set_module_config(s->module_config, &isapi_module, sconf);
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorcestatic apr_status_t isapi_load(apr_pool_t *p, isapi_server_conf *sconf,
a6cca9c284724fafd670a3163812f248ba53ad97Jakub Hrozek isapi_loaded **found = (isapi_loaded **)sconf->loaded->elts;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny if (strcasecmp(fpath, (*found)->filename) == 0) {
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* Otherwise we fall through and have to reload the resource
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * into this existing mod_isapi cache bucket.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny (*isa)->pVer = apr_pcalloc(p, sizeof(HSE_VERSION_INFO));
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* TODO: These need to become overrideable, so that we
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * assure a given isapi can be fooled into behaving well.
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce (*isa)->reportversion = MAKELONG(0, 5); /* Revision 5.0 */
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce rv = apr_dso_sym((void**)&(*isa)->GetExtensionVersion, (*isa)->handle,
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce "GetExtensionVersion");
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov ap_log_rerror(APLOG_MARK, APLOG_ALERT, rv, r,
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov "ISAPI %s is missing GetExtensionVersion()",
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny rv = apr_dso_sym((void**)&(*isa)->HttpExtensionProc, (*isa)->handle,
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce "HttpExtensionProc");
aab938c5975f0e3b85c7c79a5d718e5fefed7217Simo Sorce "ISAPI %s is missing HttpExtensionProc()",
a6cca9c284724fafd670a3163812f248ba53ad97Jakub Hrozek /* TerminateExtension() is an optional interface */
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose rv = apr_dso_sym((void**)&(*isa)->TerminateExtension, (*isa)->handle,
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose "TerminateExtension");
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek /* Run GetExtensionVersion() */
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek if (!((*isa)->GetExtensionVersion)((*isa)->pVer)) {
2bbc9d6f8d5f2c1b07fd6968314b7f530b7f3a4dMichal Židek "ISAPI %s call GetExtensionVersion() failed",
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorcestatic int isapi_unload(isapi_loaded* isa, int force)
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce /* All done with the DLL... get rid of it...
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce * If optionally cached, pass HSE_TERM_ADVISORY_UNLOAD,
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce * and if it returns TRUE, unload, otherwise, cache it.
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce (*isa->TerminateExtension)(HSE_TERM_MUST_UNLOAD);
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce else if (!(*isa->TerminateExtension)(HSE_TERM_ADVISORY_UNLOAD))
9822d4d468ec74e4e173f5adf0db12d02974cd18Sumit Bose const char *val;
9822d4d468ec74e4e173f5adf0db12d02974cd18Sumit Bose sconf = ap_get_module_config(r->server->module_config, &isapi_module);
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek /* Use similar restrictions as CGIs
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov * If this fails, it's pointless to load the isapi dll.
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose /* Load the isapi extention without caching (sconf == NULL)
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose * but note that we will recover an existing cached module.
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose if (isapi_load(r->pool, sconf, r, r->filename, &isa) != APR_SUCCESS)
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose /* Set up variables */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose apr_table_setn(e, "UNMAPPED_REMOTE_USER", "REMOTE_USER");
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose if ((val = apr_table_get(e, "HTTPS")) && strcmp(val, "on"))
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* Set up connection structure and ecb */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose cid->sconf = ap_get_module_config(r->server->module_config, &isapi_module);
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose cid->ecb = apr_pcalloc(r->pool, sizeof(struct _EXTENSION_CONTROL_BLOCK));
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose cid->ecb->cbSize = sizeof(EXTENSION_CONTROL_BLOCK);
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose // TODO: are copies really needed here?
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose cid->ecb->lpszMethod = apr_pstrdup(r->pool, (char*) r->method);
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek cid->ecb->lpszPathTranslated = apr_pstrdup(r->pool,
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek cid->ecb->lpszContentType = apr_pstrdup(r->pool,
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek /* Set up the callbacks */
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce cid->ecb->ServerSupportFunction = ServerSupportFunction;
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek /* Set up client input */
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek res = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* Time to start reading the appropriate amount of data,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * and allow the administrator to tweak the number
b50baee36c9ba9e1dd3f6b9c1356482aecd08128Jakub Hrozek * TODO: add the httpd.conf option for ReadAheadBuffer.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny cid->ecb->cbTotalBytes = (apr_size_t)r->remaining;
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny if (cid->ecb->cbTotalBytes > cid->sconf->ReadAheadBuffer)
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny cid->ecb->cbAvailable = cid->sconf->ReadAheadBuffer;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny cid->ecb->cbAvailable = cid->sconf->ReadAheadBuffer;
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny cid->ecb->lpbData = apr_pcalloc(r->pool, cid->ecb->cbAvailable + 1);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny ((res = ap_get_client_block(r, cid->ecb->lpbData + read,
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce /* Although it's not to spec, IIS seems to null-terminate
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * its lpdData string. So we will too.
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny cid->ecb->cbAvailable = cid->ecb->cbTotalBytes = read;
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce /* All right... try and run the sucker */
cb388d52f49f54963379cc20a25e14d17fe6e9a3Simo Sorce /* Check for a log message - and log it */
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov if (cid->ecb->lpszLogData && *cid->ecb->lpszLogData)
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny "ISAPI %s: %s", r->filename, cid->ecb->lpszLogData);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny case 0: /* Strange, but MS isapi accepts this as success */
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce /* Ignore the keepalive stuff; Apache handles it just fine without
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * the ISA's "advice".
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * Per Microsoft: "In IIS versions 4.0 and later, the return
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * values HSE_STATUS_SUCCESS and HSE_STATUS_SUCCESS_AND_KEEP_CONN
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * are functionally identical: Keep-Alive connections are
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * maintained, if supported by the client."
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * ... so we were pat all this time
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny /* emulating async behavior...
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * Create a cid->completed event and wait on it for some timeout
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * so that the app thinks is it running async.
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * All async ServerSupportFunction calls will be handled through
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce * the registered IO_COMPLETION hook.
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny "ISAPI %s asynch I/O request refused",
65393a294e635822c1d7a15fe5853dc457ad8a2aSimo Sorce cid->complete = CreateEvent(NULL, FALSE, FALSE, NULL);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny if (WaitForSingleObject(cid->complete, isa->timeout)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny /* TODO: Now what... if this hung, then do we kill our own
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * thread to force its death? For now leave timeout = -1
17195241500e46272018d7897d6e87249870caf2Pavel Reichl /* end response if we have yet to do so.
17195241500e46272018d7897d6e87249870caf2Pavel Reichl /* TODO: log unrecognized retval for debugging
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* Set the status (for logging) */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* All done with the DLL... get rid of it... */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose return OK; /* NOT r->status, even if it has changed. */
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit BoseBOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose const char *result;
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* lf delimited, colon split, comma seperated and
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * null terminated list of HTTP_ vars
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose const char * const *env = (const char* const *) apr_table_elts(r->subprocess_env)->elts;
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose int nelts = 2 * apr_table_elts(r->subprocess_env)->nelts;
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose /* lf delimited, colon split, comma seperated and
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose * null terminated list of the raw request header
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose const char * const *raw = (const char* const *) apr_table_elts(r->headers_in)->elts;
9f734d4c122e37cc3080974342ed9586d05d5f83Sumit Bose int nelts = 2 * apr_table_elts(r->headers_in)->nelts;
3912262270a6449ebe1d3e92c27c217b4044f894Simo Sorce /* Not a special case */
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek result = apr_table_get(r->subprocess_env, lpszVariableName);
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny /* Not Found */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyBOOL WINAPI WriteClient (HCONN ConnID, LPVOID Buffer, LPDWORD lpwdwBytes,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny ; /* XXX: Fake it */
7fe69bb6ec70bce439c6b975a9a0044c98ff502bSimo Sorce b = apr_bucket_transient_create(Buffer, *lpwdwBytes);
c03b28a38b14fdb59f74864ae4dc56affe256508Simo SorceBOOL WINAPI ReadClient (HCONN ConnID, LPVOID lpvBuffer, LPDWORD lpdwSize)
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny ((res = ap_get_client_block(r, (char*)lpvBuffer + read,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zelenystatic apr_ssize_t SendResponseHeaderEx(isapi_cid *cid, const char *stat,
17195241500e46272018d7897d6e87249870caf2Pavel Reichl newstat = apr_palloc(cid->r->pool, statlen + 9);
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek /* Whoops... not NULL terminated */
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek head = apr_pstrndup(cid->r->pool, head, headlen);
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek /* Parse them out, or die trying */
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek cid->r->status= ap_scan_script_header_err_strs(cid->r, NULL, &termch,
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek if (cid->r->status == HTTP_INTERNAL_SERVER_ERROR)
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek /* Headers will actually go when they are good and ready */
9af86b9c936d07cff9d0c2054acde908749ea522Jakub Hrozek /* If all went well, tell the caller we consumed the headers complete */
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny /* Any data left is sent directly by the caller, all we
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * give back is the size of the headers we consumed
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny if (termch && (termarg == 1) && head + headlen > termch) {
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan ZelenyBOOL WINAPI ServerSupportFunction(HCONN hConn, DWORD dwHSERequest,
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny /* Set the status to be returned when the HttpExtensionProc()
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * WARNING: Microsoft now advertises HSE_REQ_SEND_URL_REDIRECT_RESP
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * and HSE_REQ_SEND_URL as equivalant per the Jan 2000 SDK.
84c611c1b7c04cc7735ab54d4e5f48284b79e6fbJan Zeleny * They most definately are not, even in their own samples.
3912262270a6449ebe1d3e92c27c217b4044f894Simo Sorce apr_table_set (r->headers_out, "Location", lpvBuffer);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* Soak up remaining input */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny if (r->remaining > 0) {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN));
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* Reset the method to GET */
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek /* Don't let anyone think there's still data */
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose apr_table_unset(r->headers_in, "Content-Length");
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* AV fault per PR3598 - redirected path is lost! */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce (char*)lpvBuffer = apr_pstrdup(r->pool, (char*)lpvBuffer);
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose /* Parse them out, or die trying */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny ate = SendResponseHeaderEx(cid, (char*) lpvBuffer,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce b = apr_bucket_transient_create((char*) lpdwDataType + ate,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* Signal to resume the thread completing this request
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* Map a URL to a filename */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce subreq = ap_sub_req_lookup_uri(apr_pstrndup(r->pool, file, *lpdwSize),
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce len = apr_cpystrn(file, subreq->filename, *lpdwSize) - file;
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce /* IIS puts a trailing slash on directories, Apache doesn't */
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce "ISAPI ServerSupportFunction HSE_REQ_GET_SSPI_INFO "
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose /* Log lpvBuffer, of lpdwSize bytes, in the URI Query (cs-uri-query) field
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek apr_table_set(r->notes, "isapi-parameter", (char*) lpvBuffer);
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek r->args = apr_pstrcat(r->pool, r->args, (char*) lpvBuffer, NULL);
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose r->args = apr_pstrdup(r->pool, (char*) lpvBuffer);
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, r,
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek /* Emulates a completion port... Record callback address and
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek * user defined arg, we will call this after any async request
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek * (e.g. transmitfile) as if the request executed async.
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek * Per MS docs... HSE_REQ_IO_COMPLETION replaces any prior call
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek * to HSE_REQ_IO_COMPLETION, and lpvBuffer may be set to NULL.
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek "ISAPI ServerSupportFunction HSE_REQ_IO_COMPLETION "
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny cid->completion = (PFN_HSE_IO_COMPLETION) lpvBuffer;
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce if (!cid->isa->fakeasync && (tf->dwFlags & HSE_IO_ASYNC)) {
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce "ISAPI ServerSupportFunction HSE_REQ_TRANSMIT_FILE "
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce "as HSE_IO_ASYNC is not supported: %s", r->filename);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny if ((rv = apr_os_file_put(&fd, tf->hFile, r->pool)) != APR_SUCCESS) {
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce /* apr_dupfile_oshandle (&fd, tf->hFile, r->pool); */
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce /* According to MS: if calling HSE_REQ_TRANSMIT_FILE with the
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * HSE_IO_SEND_HEADERS flag, then you can't otherwise call any
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * HSE_SEND_RESPONSE_HEADERS* fn, but if you don't use the flag,
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * you must have done so. They document that the pHead headers
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * option is valid only for HSE_IO_SEND_HEADERS - we are a bit
204cfc89a076fd32bf34f2abb3f809304aaa88abSimo Sorce * more flexible and assume with the flag, pHead are the
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * response headers, and without, pHead simply contains text
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce * (handled after this case).
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny apr_ssize_t ate = SendResponseHeaderEx(cid, tf->pszStatusCode,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce b = apr_bucket_transient_create((char*)tf->pHead + ate,
1187a07ed4207c1c326fdf83915dddfe472b8620Simo Sorce b = apr_bucket_transient_create((char*)tf->pHead,
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose b = apr_bucket_transient_create((char*)tf->pTail,
09d7c105839bfc7447ea0f766413ed86675ca075Sumit Bose /* we do nothing with (tf->dwFlags & HSE_DISCONNECT_AFTER_SEND)
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek /* XXX: Fake async response,
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek * use tf->pfnHseIO, or if NULL, then use cid->fnIOComplete
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek * pass pContect to the HseIO callback.
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek "ISAPI ServerSupportFunction "
b3458bbb5315b05d7ac1abc58f1c380761756603Jakub Hrozek "HSE_REQ_REFRESH_ISAPI_ACL "
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose *((LPBOOL) lpvBuffer) = (r->connection->keepalive == 1);
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose case 1010: /* XXX: Fake it : HSE_REQ_ASYNC_READ_CLIENT */
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
c5711b0279ea85d69fe3c77dfb194360c346e1d7Sumit Bose "ISAPI asynchronous I/O not supported: %s",
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek case 1011: /* HSE_REQ_GET_IMPERSONATION_TOKEN Added in ISAPI 4.0 */
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek "ISAPI ServerSupportFunction "
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek "HSE_REQ_GET_IMPERSONATION_TOKEN "
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek /* Map a URL to a filename */
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek LPHSE_URL_MAPEX_INFO info = (LPHSE_URL_MAPEX_INFO) lpdwDataType;
ea224c3813a537639778f91ac762732b3c289603Jakub Hrozek char* test_uri = apr_pstrndup(r->pool, (char *)lpvBuffer, *lpdwSize);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny subreq = ap_sub_req_lookup_uri(test_uri, r, NULL);
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov info->cchMatchingPath = apr_cpystrn(info->lpszPath, subreq->filename,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* Mapping started with assuming both strings matched.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * Now roll on the path_info as a mismatch and handle
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * terminating slashes for directory matches.
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny apr_cpystrn(info->lpszPath + info->cchMatchingPath,
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny subreq->path_info, MAX_PATH - info->cchMatchingPath);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny info->cchMatchingURL -= strlen(subreq->path_info);
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* roll forward over path_info's first slash */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* Add a trailing slash for directory */
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* If the matched isn't a file, roll match back to the prior slash */
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov while (info->cchMatchingPath && info->cchMatchingURL) {
bba1a5fd62cffcae076d1351df5a83fbc4a6ec17Simo Sorce if (info->lpszPath[info->cchMatchingPath - 1] == '/')
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* Paths returned with back slashes */
a3c8390d19593b1e5277d95bfb4ab206d4785150Nikolai Kondrashov for (test_uri = info->lpszPath; *test_uri; ++test_uri)
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny /* is a combination of:
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * HSE_URL_FLAGS_READ 0x001 Allow read
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * HSE_URL_FLAGS_WRITE 0x002 Allow write
e76d78338026fa47dca32eaf7f5c15eabb1b951aJan Zeleny * HSE_URL_FLAGS_EXECUTE 0x004 Allow execute
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * HSE_URL_FLAGS_SSL 0x008 Require SSL
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * HSE_URL_FLAGS_DONT_CACHE 0x010 Don't cache (VRoot only)
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * HSE_URL_FLAGS_NEGO_CERT 0x020 Allow client SSL cert
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * HSE_URL_FLAGS_REQUIRE_CERT 0x040 Require client SSL cert
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * HSE_URL_FLAGS_MAP_CERT 0x080 Map client SSL cert to account
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * HSE_URL_FLAGS_SSL128 0x100 Require 128-bit SSL cert
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * HSE_URL_FLAGS_SCRIPT 0x200 Allow script execution
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * XxX: As everywhere, EXEC flags could use some work...
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * and this could go further with more flags, as desired.
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose info->dwFlags = (subreq->finfo.protection & APR_UREAD ? 0x001 : 0)
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose | (subreq->finfo.protection & APR_UWRITE ? 0x002 : 0)
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose | (subreq->finfo.protection & APR_UEXECUTE ? 0x204 : 0);
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "ISAPI ServerSupportFunction HSE_REQ_ABORTIVE_CLOSE"
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose case 1015: /* HSE_REQ_GET_CERT_INFO_EX Added in ISAPI 4.0 */
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "ISAPI ServerSupportFunction "
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "HSE_REQ_GET_CERT_INFO_EX "
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose case 1016: /* HSE_REQ_SEND_RESPONSE_HEADER_EX Added in ISAPI 4.0 */
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose /* XXX: ignore shi->fKeepConn? We shouldn't need the advise */
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose /* r->connection->keepalive = shi->fKeepConn; */
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose apr_ssize_t ate = SendResponseHeaderEx(cid, shi->pszStatus,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose b = apr_bucket_transient_create(shi->pszHeader + ate,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose case 1017: /* HSE_REQ_CLOSE_CONNECTION Added after ISAPI 4.0 */
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "ISAPI ServerSupportFunction "
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "HSE_REQ_CLOSE_CONNECTION "
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose case 1018: /* HSE_REQ_IS_CONNECTED Added after ISAPI 4.0 */
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose /* Returns True if client is connected c.f. MSKB Q188346
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * assuming the identical return mechanism as HSE_REQ_IS_KEEP_CONN
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose *((LPBOOL) lpvBuffer) = (r->connection->aborted == 0);
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose case 1020: /* HSE_REQ_EXTENSION_TRIGGER Added after ISAPI 4.0 */
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose /* Undocumented - defined by the Microsoft Jan '00 Platform SDK
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "ISAPI ServerSupportFunction "
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "HSE_REQ_EXTENSION_TRIGGER "
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, 0, r,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose "ISAPI ServerSupportFunction (%d) not supported: "
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * Command handler for the ISAPIReadAheadBuffer directive, which is TAKE1
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bosestatic const char *isapi_cmd_readaheadbuffer(cmd_parms *cmd, void *config,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose isapi_server_conf *sconf = ap_get_module_config(cmd->server->module_config,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose if (((val = strtol(arg, (char **) &scan, 10)) <= 0) || *scan)
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose return "ISAPIReadAheadBuffer must be a legitimate value.";
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose * Command handler for the ISAPIReadAheadBuffer directive, which is TAKE1
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bosestatic const char *isapi_cmd_lognotsupported(cmd_parms *cmd, void *config,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose isapi_server_conf *sconf = ap_get_module_config(cmd->server->module_config,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose return "ISAPILogNotSupported must be on or off";
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bosestatic const char *isapi_cmd_appendlogtoerrors(cmd_parms *cmd, void *config,
5ff7a765434ed0b4d37564ade26d7761d06f81c3Sumit Bose isapi_server_conf *sconf = ap_get_module_config(cmd->server->module_config,
return NULL;
char *arg)
&isapi_module);
return NULL;
const char *filename)
&isapi_module);
char *fspec;
return NULL;
return NULL;
return NULL;
return NULL;
{ NULL }