home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1999 April / PCO0499.ISO / filesbbs / os2 / apach134.arj / APACH134.ZIP / src / os / win32 / mod_isapi.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-08  |  17.3 KB  |  570 lines

  1. /* ====================================================================
  2.  * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
  3.  *
  4.  * Redistribution and use in source and binary forms, with or without
  5.  * modification, are permitted provided that the following conditions
  6.  * are met:
  7.  *
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer. 
  10.  *
  11.  * 2. Redistributions in binary form must reproduce the above copyright
  12.  *    notice, this list of conditions and the following disclaimer in
  13.  *    the documentation and/or other materials provided with the
  14.  *    distribution.
  15.  *
  16.  * 3. All advertising materials mentioning features or use of this
  17.  *    software must display the following acknowledgment:
  18.  *    "This product includes software developed by the Apache Group
  19.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  20.  *
  21.  * 4. The names "Apache Server" and "Apache Group" must not be used to
  22.  *    endorse or promote products derived from this software without
  23.  *    prior written permission. For written permission, please contact
  24.  *    apache@apache.org.
  25.  *
  26.  * 5. Products derived from this software may not be called "Apache"
  27.  *    nor may "Apache" appear in their names without prior written
  28.  *    permission of the Apache Group.
  29.  *
  30.  * 6. Redistributions of any form whatsoever must retain the following
  31.  *    acknowledgment:
  32.  *    "This product includes software developed by the Apache Group
  33.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  36.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  37.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  38.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  41.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  42.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  43.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  44.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  45.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  46.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  47.  * ====================================================================
  48.  *
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Group and was originally based
  51.  * on public domain software written at the National Center for
  52.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  53.  * For more information on the Apache Group and the Apache HTTP server
  54.  * project, please see <http://www.apache.org/>.
  55.  *
  56.  */
  57.  
  58. /*
  59.  * mod_isapi.c - Internet Server Application (ISA) module for Apache
  60.  * by Alexei Kosut <akosut@apache.org>
  61.  *
  62.  * This module implements Microsoft's ISAPI, allowing Apache (when running
  63.  * under Windows) to load Internet Server Applications (ISAPI extensions).
  64.  * It implements all of the ISAPI 2.0 specification, except for the 
  65.  * "Microsoft-only" extensions dealing with asynchronous I/O. All ISAPI
  66.  * extensions that use only synchronous I/O and are compatible with the
  67.  * ISAPI 2.0 specification should work (most ISAPI 1.0 extensions should
  68.  * function as well).
  69.  *
  70.  * To load, simply place the ISA in a location in the document tree.
  71.  * Then add an "AddHandler isapi-isa dll" into your config file.
  72.  * You should now be able to load ISAPI DLLs just be reffering to their
  73.  * URLs. Make sure the ExecCGI option is active in the directory
  74.  * the ISA is in.
  75.  */
  76.  
  77. #include "httpd.h"
  78. #include "http_config.h"
  79. #include "http_core.h"
  80. #include "http_protocol.h"
  81. #include "http_request.h"
  82. #include "http_log.h"
  83. #include "util_script.h"
  84.  
  85. /* We use the exact same header file as the original */
  86. #include <HttpExt.h>
  87.  
  88. /* Seems IIS does not enforce the requirement for \r\n termination on HSE_REQ_SEND_RESPONSE_HEADER,
  89.    define this to conform */
  90. #define RELAX_HEADER_RULE
  91.  
  92. module isapi_module;
  93.  
  94. /* Our "Connection ID" structure */
  95.  
  96. typedef struct {
  97.     LPEXTENSION_CONTROL_BLOCK ecb;
  98.     request_rec *r;
  99.     int status;
  100. } isapi_cid;
  101.  
  102. /* Declare the ISAPI functions */
  103.  
  104. BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
  105.                    LPVOID lpvBuffer, LPDWORD lpdwSizeofBuffer);
  106. BOOL WINAPI WriteClient (HCONN ConnID, LPVOID Buffer, LPDWORD lpwdwBytes,
  107.              DWORD dwReserved);
  108. BOOL WINAPI ReadClient (HCONN ConnID, LPVOID lpvBuffer, LPDWORD lpdwSize);
  109. BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest,
  110.                    LPVOID lpvBuffer, LPDWORD lpdwSize,
  111.                    LPDWORD lpdwDataType);
  112.  
  113. /*
  114.     The optimiser blows it totally here. What happens is that autos are addressed relative to the
  115.     stack pointer, which, of course, moves around. The optimiser seems to lose track of it somewhere
  116.     between setting isapi_entry and calling through it. We work around the problem by forcing it to
  117.     use frame pointers.
  118. */
  119. #pragma optimize("y",off)
  120.  
  121. int isapi_handler (request_rec *r) {
  122.     LPEXTENSION_CONTROL_BLOCK ecb =
  123.     ap_pcalloc(r->pool, sizeof(struct _EXTENSION_CONTROL_BLOCK));
  124.     HSE_VERSION_INFO *pVer = ap_pcalloc(r->pool, sizeof(HSE_VERSION_INFO));
  125.  
  126.     HINSTANCE isapi_handle;
  127.     BOOL (*isapi_version)(HSE_VERSION_INFO *); /* entry point 1 */
  128.     DWORD (*isapi_entry)(LPEXTENSION_CONTROL_BLOCK); /* entry point 2 */
  129.     BOOL (*isapi_term)(DWORD); /* optional entry point 3 */
  130.  
  131.     isapi_cid *cid = ap_pcalloc(r->pool, sizeof(isapi_cid));
  132.     table *e = r->subprocess_env;
  133.     int retval;
  134.  
  135.     /* Use similar restrictions as CGIs */
  136.  
  137.     if (!(ap_allow_options(r) & OPT_EXECCGI))
  138.     return FORBIDDEN;
  139.  
  140.     if (r->finfo.st_mode == 0)
  141.     return NOT_FOUND;
  142.  
  143.     if (S_ISDIR(r->finfo.st_mode))
  144.     return FORBIDDEN;
  145.  
  146.     /* Load the module */
  147.  
  148.     if (!(isapi_handle = LoadLibraryEx(r->filename, NULL,
  149.                        LOAD_WITH_ALTERED_SEARCH_PATH))) {
  150.     ap_log_rerror(APLOG_MARK, APLOG_ALERT, r,
  151.             "Could not load DLL: %s", r->filename);
  152.     return SERVER_ERROR;
  153.     }
  154.  
  155.     if (!(isapi_version =
  156.       (void *)(GetProcAddress(isapi_handle, "GetExtensionVersion")))) {
  157.     ap_log_rerror(APLOG_MARK, APLOG_ALERT, r,
  158.             "DLL could not load GetExtensionVersion(): %s", r->filename);
  159.     FreeLibrary(isapi_handle);
  160.     return SERVER_ERROR;
  161.     }
  162.  
  163.     if (!(isapi_entry =
  164.       (void *)(GetProcAddress(isapi_handle, "HttpExtensionProc")))) {
  165.     ap_log_rerror(APLOG_MARK, APLOG_ALERT, r,
  166.             "DLL could not load HttpExtensionProc(): %s", r->filename);
  167.     FreeLibrary(isapi_handle);
  168.     return SERVER_ERROR;
  169.     }
  170.  
  171.     isapi_term = (void *)(GetProcAddress(isapi_handle, "TerminateExtension"));
  172.  
  173.     /* Run GetExtensionVersion() */
  174.  
  175.     if ((*isapi_version)(pVer) != TRUE) {
  176.     ap_log_rerror(APLOG_MARK, APLOG_ALERT, r,
  177.             "ISAPI GetExtensionVersion() failed: %s", r->filename);
  178.     FreeLibrary(isapi_handle);
  179.     return SERVER_ERROR;
  180.     }
  181.  
  182.     /* Set up variables */
  183.     ap_add_common_vars(r);
  184.     ap_add_cgi_vars(r);
  185.  
  186.     /* Set up connection ID */
  187.     ecb->ConnID = (HCONN)cid;
  188.     cid->ecb = ecb;
  189.     cid->r = r;
  190.     cid->status = 0;
  191.  
  192.     ecb->cbSize = sizeof(struct _EXTENSION_CONTROL_BLOCK);
  193.     ecb->dwVersion = MAKELONG(0, 2);
  194.     ecb->dwHttpStatusCode = 0;
  195.     strcpy(ecb->lpszLogData, "");
  196.     ecb->lpszMethod = r->method;
  197.     ecb->lpszQueryString = ap_table_get(e, "QUERY_STRING");
  198.     ecb->lpszPathInfo = ap_table_get(e, "PATH_INFO");
  199.     ecb->lpszPathTranslated = ap_table_get(e, "PATH_TRANSLATED");
  200.     ecb->lpszContentType = ap_table_get(e, "CONTENT_TYPE");
  201.  
  202.     /* Set up client input */
  203.     if ((retval = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) {
  204.     if (isapi_term) (*isapi_term)(HSE_TERM_MUST_UNLOAD);
  205.     FreeLibrary(isapi_handle);
  206.     return retval;
  207.     }
  208.  
  209.     if (ap_should_client_block(r)) {
  210.     /* Unlike IIS, which limits this to 48k, we read the whole
  211.      * sucker in. I suppose this could be bad for memory if someone
  212.      * uploaded the complete works of Shakespeare. Well, WebSite
  213.      * does the same thing.
  214.      */
  215.     long to_read = atol(ap_table_get(e, "CONTENT_LENGTH"));
  216.     long read;
  217.  
  218.     /* Actually, let's cap it at 48k, until we figure out what
  219.      * to do with this... we don't want a Content-Length: 1000000000
  220.      * taking out the machine.
  221.      */
  222.  
  223.     if (to_read > 49152) {
  224.         if (isapi_term) (*isapi_term)(HSE_TERM_MUST_UNLOAD);
  225.         FreeLibrary(isapi_handle);
  226.         return HTTP_REQUEST_ENTITY_TOO_LARGE;
  227.     }
  228.  
  229.     ecb->lpbData = ap_pcalloc(r->pool, 1 + to_read);
  230.  
  231.     if ((read = ap_get_client_block(r, ecb->lpbData, to_read)) < 0) {
  232.         if (isapi_term) (*isapi_term)(HSE_TERM_MUST_UNLOAD);
  233.         FreeLibrary(isapi_handle);
  234.         return SERVER_ERROR;
  235.     }
  236.  
  237.     /* Although its not to spec, IIS seems to null-terminate
  238.      * its lpdData string. So we will too. To make sure
  239.      * cbAvailable matches cbTotalBytes, we'll up the latter
  240.      * and equalize them.
  241.      */
  242.     ecb->cbAvailable = ecb->cbTotalBytes = read + 1;
  243.     ecb->lpbData[read] = '\0';
  244.     }
  245.     else {
  246.     ecb->cbTotalBytes = 0;
  247.     ecb->cbAvailable = 0;
  248.     ecb->lpbData = NULL;
  249.     }
  250.  
  251.     /* Set up the callbacks */
  252.  
  253.     ecb->GetServerVariable = &GetServerVariable;
  254.     ecb->WriteClient = &WriteClient;
  255.     ecb->ReadClient = &ReadClient;
  256.     ecb->ServerSupportFunction = &ServerSupportFunction;
  257.  
  258.     /* All right... try and load the sucker */
  259.     retval = (*isapi_entry)(ecb);
  260.  
  261.     /* Set the status (for logging) */
  262.     if (ecb->dwHttpStatusCode)
  263.     r->status = ecb->dwHttpStatusCode;
  264.  
  265.     /* Check for a log message - and log it */
  266.     if (ecb->lpszLogData && strcmp(ecb->lpszLogData, ""))
  267.     ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  268.             "%s: %s", ecb->lpszLogData, r->filename);
  269.  
  270.     /* All done with the DLL... get rid of it */
  271.     if (isapi_term) (*isapi_term)(HSE_TERM_MUST_UNLOAD);
  272.     FreeLibrary(isapi_handle);
  273.  
  274.     switch(retval) {
  275.     case HSE_STATUS_SUCCESS:
  276.     case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
  277.     /* Ignore the keepalive stuff; Apache handles it just fine without
  278.      * the ISA's "advice".
  279.      */
  280.  
  281.     if (cid->status) /* We have a special status to return */
  282.         return cid->status;
  283.  
  284.     return OK;
  285.     case HSE_STATUS_PENDING:    /* We don't support this */
  286.     ap_log_rerror(APLOG_MARK, APLOG_WARNING, r,
  287.             "ISAPI asynchronous I/O not supported: %s", r->filename);
  288.     case HSE_STATUS_ERROR:
  289.     default:
  290.     return SERVER_ERROR;
  291.     }
  292.  
  293. }
  294. #pragma optimize("",on)
  295.  
  296. BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
  297.                    LPVOID lpvBuffer, LPDWORD lpdwSizeofBuffer) {
  298.     request_rec *r = ((isapi_cid *)hConn)->r;
  299.     table *e = r->subprocess_env;
  300.     const char *result;
  301.     
  302.     /* Mostly, we just grab it from the environment, but there are
  303.      * a couple of special cases
  304.      */
  305.  
  306.     if (!strcasecmp(lpszVariableName, "UNMAPPED_REMOTE_USER")) {
  307.     /* We don't support NT users, so this is always the same as
  308.      * REMOTE_USER
  309.      */
  310.     result = ap_table_get(e, "REMOTE_USER");
  311.     }
  312.     else if (!strcasecmp(lpszVariableName, "SERVER_PORT_SECURE")) {
  313.     /* Apache doesn't support secure requests inherently, so
  314.      * we have no way of knowing. We'll be conservative, and say
  315.      * all requests are insecure.
  316.      */
  317.     result = "0";
  318.     }
  319.     else if (!strcasecmp(lpszVariableName, "URL")) {
  320.     result = r->uri;
  321.     }
  322.     else {
  323.     result = ap_table_get(e, lpszVariableName);
  324.     }
  325.  
  326.     if (result) {
  327.     if (strlen(result) > *lpdwSizeofBuffer) {
  328.         *lpdwSizeofBuffer = strlen(result);
  329.         SetLastError(ERROR_INSUFFICIENT_BUFFER);
  330.         return FALSE;
  331.     }
  332.     strncpy(lpvBuffer, result, *lpdwSizeofBuffer);
  333.     return TRUE;
  334.     }
  335.  
  336.     /* Didn't find it */
  337.     SetLastError(ERROR_INVALID_INDEX);
  338.     return FALSE;
  339. }
  340.  
  341. BOOL WINAPI WriteClient (HCONN ConnID, LPVOID Buffer, LPDWORD lpwdwBytes,
  342.              DWORD dwReserved) {
  343.     request_rec *r = ((isapi_cid *)ConnID)->r;
  344.     int writ;    /* written, actually, but why shouldn't I make up words? */
  345.  
  346.     /* We only support synchronous writing */
  347.     if (dwReserved && dwReserved != HSE_IO_SYNC) {
  348.     ap_log_rerror(APLOG_MARK, APLOG_WARNING, r,
  349.             "ISAPI asynchronous I/O not supported: %s", r->filename);
  350.     SetLastError(ERROR_INVALID_PARAMETER);
  351.     return FALSE;
  352.     }
  353.  
  354.     if ((writ = ap_rwrite(Buffer, *lpwdwBytes, r)) == EOF) {
  355.     SetLastError(ERROR); /* XXX: Find the right error code */
  356.     return FALSE;
  357.     }
  358.    
  359.     *lpwdwBytes = writ;
  360.     return TRUE;
  361. }
  362.  
  363. BOOL WINAPI ReadClient (HCONN ConnID, LPVOID lpvBuffer, LPDWORD lpdwSize) {
  364.     /* Doesn't need to do anything; we've read all the data already */
  365.     return TRUE;
  366. }
  367.  
  368. /* XXX: There is an O(n^2) attack possible here. */
  369. BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest,
  370.                    LPVOID lpvBuffer, LPDWORD lpdwSize,
  371.                    LPDWORD lpdwDataType) {
  372.     isapi_cid *cid = (isapi_cid *)hConn;
  373.     request_rec *subreq, *r = cid->r;
  374.     char *data;
  375.  
  376.     switch (dwHSERequest) {
  377.     case HSE_REQ_SEND_URL_REDIRECT_RESP:
  378.     /* Set the status to be returned when the HttpExtensionProc()
  379.      * is done.
  380.      */
  381.     ap_table_set (r->headers_out, "Location", lpvBuffer);
  382.     cid->status = cid->r->status = cid->ecb->dwHttpStatusCode = REDIRECT;
  383.     return TRUE;
  384.  
  385.     case HSE_REQ_SEND_URL:
  386.     /* Read any additional input */
  387.  
  388.     if (r->remaining > 0) {
  389.         char argsbuffer[HUGE_STRING_LEN];
  390.  
  391.         while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN));
  392.     }
  393.     
  394.     /* Reset the method to GET */
  395.     r->method = ap_pstrdup(r->pool, "GET");
  396.     r->method_number = M_GET;
  397.  
  398.     /* Don't let anyone think there's still data */
  399.     ap_table_unset(r->headers_in, "Content-Length");
  400.     
  401.     ap_internal_redirect((char *)lpvBuffer, r);    
  402.     return TRUE;
  403.  
  404.     case HSE_REQ_SEND_RESPONSE_HEADER:
  405.     r->status_line = lpvBuffer ? lpvBuffer : ap_pstrdup(r->pool, "200 OK");
  406.     sscanf(r->status_line, "%d", &r->status);
  407.     cid->ecb->dwHttpStatusCode = r->status;
  408.  
  409.     /* Now fill in the HTTP headers, and the rest of it. Ick.
  410.      * lpdwDataType contains a string that has headers (in MIME
  411.      * format), a blank like, then (possibly) data. We need
  412.      * to parse it.
  413.      *
  414.      * Easy case first:
  415.      */
  416.     if (!lpdwDataType) {
  417.         ap_send_http_header(r);
  418.         return TRUE;
  419.     }
  420.  
  421.     /* Make a copy - don't disturb the original */
  422.     data = ap_pstrdup(r->pool, (char *)lpdwDataType);
  423.  
  424.     /* We *should* break before this while loop ends */
  425.     while (*data) {
  426.         char *value, *lf = strchr(data, '\n');
  427.         int p;
  428.  
  429. #ifdef RELAX_HEADER_RULE
  430.         if (lf)
  431.         *lf = '\0';
  432. #else
  433.         if (!lf) { /* Huh? Invalid data, I think */
  434.         ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  435.                 "ISA sent invalid headers: %s", r->filename);
  436.         SetLastError(ERROR);    /* XXX: Find right error */
  437.         return FALSE;
  438.         }
  439.  
  440.         /* Get rid of \n and \r */
  441.         *lf = '\0';
  442. #endif
  443.         p = strlen(data);
  444.         if (p > 0 && data[p-1] == '\r') data[p-1] = '\0';
  445.         
  446.         /* End of headers */
  447.         if (*data == '\0') {
  448. #ifdef RELAX_HEADER_RULE
  449.         if (lf)
  450. #endif
  451.             data = lf + 1;    /* Reset data */
  452.         break;
  453.         }
  454.  
  455.         if (!(value = strchr(data, ':'))) {
  456.         SetLastError(ERROR);    /* XXX: Find right error */
  457.         ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
  458.                 "ISA sent invalid headers", r->filename);
  459.         return FALSE;
  460.         }
  461.  
  462.         *value++ = '\0';
  463.         while (*value && ap_isspace(*value)) ++value;
  464.  
  465.         /* Check all the special-case headers. Similar to what
  466.          * ap_scan_script_header_err() does (see that function for
  467.          * more detail)
  468.          */
  469.  
  470.         if (!strcasecmp(data, "Content-Type")) {
  471.         char *tmp;
  472.         /* Nuke trailing whitespace */
  473.         
  474.         char *endp = value + strlen(value) - 1;
  475.         while (endp > value && ap_isspace(*endp)) *endp-- = '\0';
  476.             
  477.         tmp = ap_pstrdup (r->pool, value);
  478.         ap_str_tolower(tmp);
  479.         r->content_type = tmp;
  480.         }
  481.         else if (!strcasecmp(data, "Content-Length")) {
  482.         ap_table_set(r->headers_out, data, value);
  483.         }
  484.         else if (!strcasecmp(data, "Transfer-Encoding")) {
  485.         ap_table_set(r->headers_out, data, value);
  486.         }
  487.         else if (!strcasecmp(data, "Set-Cookie")) {
  488.         ap_table_add(r->err_headers_out, data, value);
  489.         }
  490.         else {
  491.         ap_table_merge(r->err_headers_out, data, value);
  492.         }
  493.       
  494.         /* Reset data */
  495. #ifdef RELAX_HEADER_RULE
  496.         if (!lf) {
  497.         data += p;
  498.         break;
  499.         }
  500. #endif
  501.         data = lf + 1;
  502.     }
  503.     
  504.     /* All the headers should be set now */
  505.  
  506.     ap_send_http_header(r);
  507.  
  508.     /* Any data left should now be sent directly */
  509.     ap_rputs(data, r);
  510.  
  511.     return TRUE;
  512.  
  513.     case HSE_REQ_MAP_URL_TO_PATH:
  514.     /* Map a URL to a filename */
  515.     subreq = ap_sub_req_lookup_uri(ap_pstrndup(r->pool, (char *)lpvBuffer,
  516.                           *lpdwSize), r);
  517.  
  518.     GetFullPathName(subreq->filename, *lpdwSize - 1, (char *)lpvBuffer, NULL);
  519.  
  520.     /* IIS puts a trailing slash on directories, Apache doesn't */
  521.  
  522.     if (S_ISDIR (subreq->finfo.st_mode)) {
  523.         int l = strlen((char *)lpvBuffer);
  524.  
  525.         ((char *)lpvBuffer)[l] = '\\';
  526.         ((char *)lpvBuffer)[l + 1] = '\0';
  527.     }
  528.     
  529.     return TRUE;
  530.  
  531.     case HSE_REQ_DONE_WITH_SESSION:
  532.     /* Do nothing... since we don't support async I/O, they'll
  533.      * return from HttpExtensionProc soon
  534.      */
  535.     return TRUE;
  536.  
  537.     /* We don't support all this async I/O, Microsoft-specific stuff */
  538.     case HSE_REQ_IO_COMPLETION:
  539.     case HSE_REQ_TRANSMIT_FILE:
  540.     ap_log_rerror(APLOG_MARK, APLOG_WARNING, r,
  541.             "ISAPI asynchronous I/O not supported: %s", r->filename);
  542.     default:
  543.     SetLastError(ERROR_INVALID_PARAMETER);
  544.     return FALSE;
  545.     }
  546. }
  547.  
  548. handler_rec isapi_handlers[] = {
  549. { "isapi-isa", isapi_handler },
  550. { NULL}
  551. };
  552.  
  553. module isapi_module = {
  554.    STANDARD_MODULE_STUFF,
  555.    NULL,            /* initializer */
  556.    NULL,            /* create per-dir config */
  557.    NULL,            /* merge per-dir config */
  558.    NULL,            /* server config */
  559.    NULL,            /* merge server config */
  560.    NULL,            /* command table */
  561.    isapi_handlers,               /* handlers */
  562.    NULL,            /* filename translation */
  563.    NULL,            /* check_user_id */
  564.    NULL,            /* check auth */
  565.    NULL,            /* check access */
  566.    NULL,            /* type_checker */
  567.    NULL,            /* logger */
  568.    NULL                /* header parser */
  569. };
  570.