#include "apr_time.h"
#include "apr_errno.h"
#include "apr_lock.h"
+#include "apr_strings.h"
#if APR_HAS_SHARED_MEMORY
static const char *set_qop(cmd_parms *cmd, void *config, const char *op)
{
digest_config_rec *conf = (digest_config_rec *) config;
- const char **tmp;
+ char **tmp;
int cnt;
if (!strcasecmp(op, "none")) {
#include "http_log.h"
#include "util_script.h"
#include "apr_portable.h"
+#include "apr_strings.h"
+
/* We use the exact same header file as the original */
#include <HttpExt.h>
ecb->dwVersion = MAKELONG(0, 2);
ecb->dwHttpStatusCode = 0;
strcpy(ecb->lpszLogData, "");
- ecb->lpszMethod = r->method;
- ecb->lpszQueryString = ap_table_get(e, "QUERY_STRING");
- ecb->lpszPathInfo = ap_table_get(e, "PATH_INFO");
- ecb->lpszPathTranslated = ap_table_get(e, "PATH_TRANSLATED");
- ecb->lpszContentType = ap_table_get(e, "CONTENT_TYPE");
+ // TODO: is a copy needed here?
+ ecb->lpszMethod = (char*) r->method;
+ // TODO: is a copy needed here?
+ ecb->lpszQueryString = (char*) ap_table_get(e, "QUERY_STRING");
+ // TODO: is a copy needed here?
+ ecb->lpszPathInfo = (char*) ap_table_get(e, "PATH_INFO");
+ // TODO: is a copy needed here?
+ ecb->lpszPathTranslated = (char*) ap_table_get(e, "PATH_TRANSLATED");
+ // TODO: is a copy needed here?
+ ecb->lpszContentType = (char*) ap_table_get(e, "CONTENT_TYPE");
/* Set up client input */
if ((retval = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) {
FreeLibrary(isapi_handle);
switch(retval) {
- case HSE_STATUS_SUCCESS:
- case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
+ case HSE_STATUS_SUCCESS:
+ /* TODO: If content length was missing or incorrect, and the response
+ * was not chunked, we need to close the connection here.
+ * If the response was chunked, and no closing chunk was sent, we aught
+ * to transmit one here
+ */
+
+ /* fall through... */
+ case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
/* Ignore the keepalive stuff; Apache handles it just fine without
* the ISA's "advice".
*/
return OK;
- case HSE_STATUS_PENDING: /* We don't support this */
- ap_log_rerror(APLOG_MARK, APLOG_WARNING, APR_ENOTIMPL, r,
- "ISAPI asynchronous I/O not supported: %s", r->filename);
- /* fallthrough */
- case HSE_STATUS_ERROR:
- default:
+ case HSE_STATUS_PENDING:
+ /* We don't support this, but we need to... we should simply create a
+ * wait event and die on timeout or resume with the callback to our
+ * ServerSupportFunction with HSE_REQ_DONE_WITH_SESSION to emulate
+ * async behavior.
+ */
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, APR_ENOTIMPL, r,
+ "ISAPI asynchronous I/O not supported: %s", r->filename);
- return HTTP_INTERNAL_SERVER_ERROR;
+ case HSE_STATUS_ERROR:
+ /* end response if we have yet to do so.
+ */
+ return HTTP_INTERNAL_SERVER_ERROR;
+
+ default:
+ /* TODO: log unrecognized retval for debugging
+ */
+ return HTTP_INTERNAL_SERVER_ERROR;
}
}
BOOL WINAPI ReadClient (HCONN ConnID, LPVOID lpvBuffer, LPDWORD lpdwSize)
{
- /* Doesn't need to do anything; we've read all the data already */
+ /* If the request was a huge transmit or chunked, continue piping the
+ * request here, but if it's of a sane size, continue to ...
+ */
return TRUE;
}
char *data;
switch (dwHSERequest) {
- case HSE_REQ_SEND_URL_REDIRECT_RESP:
- /* Set the status to be returned when the HttpExtensionProc()
- * is done.
- */
- ap_table_set (r->headers_out, "Location", lpvBuffer);
- cid->status = cid->r->status = cid->ecb->dwHttpStatusCode =
- HTTP_MOVED_TEMPORARILY;
- return TRUE;
+ case HSE_REQ_SEND_URL_REDIRECT_RESP:
+ /* Set the status to be returned when the HttpExtensionProc()
+ * is done.
+ */
+ ap_table_set (r->headers_out, "Location", lpvBuffer);
+ cid->status = cid->r->status = cid->ecb->dwHttpStatusCode =
+ HTTP_MOVED_TEMPORARILY;
+ return TRUE;
- case HSE_REQ_SEND_URL:
- /* Read any additional input */
+ case HSE_REQ_SEND_URL:
+ /* Read any additional input */
- if (r->remaining > 0) {
- char argsbuffer[HUGE_STRING_LEN];
+ if (r->remaining > 0) {
+ char argsbuffer[HUGE_STRING_LEN];
- while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN));
- }
+ while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN));
+ }
- /* Reset the method to GET */
- r->method = ap_pstrdup(r->pool, "GET");
- r->method_number = M_GET;
+ /* Reset the method to GET */
+ r->method = ap_pstrdup(r->pool, "GET");
+ r->method_number = M_GET;
- /* Don't let anyone think there's still data */
- ap_table_unset(r->headers_in, "Content-Length");
+ /* Don't let anyone think there's still data */
+ ap_table_unset(r->headers_in, "Content-Length");
- ap_internal_redirect((char *)lpvBuffer, r);
- return TRUE;
+ ap_internal_redirect((char *)lpvBuffer, r);
+ return TRUE;
- case HSE_REQ_SEND_RESPONSE_HEADER:
+ case HSE_REQ_SEND_RESPONSE_HEADER_EX:
+ if (((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszStatus
+ && ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchStatus)
+ r->status_line = ap_pstrndup(r->pool,
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszStatus,
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchStatus);
+ else
+ r->status_line = ap_pstrdup(r->pool, "200 OK");
+ sscanf(r->status_line, "%d", &r->status);
+ cid->ecb->dwHttpStatusCode = r->status;
+
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszHeader; // HTTP header
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchHeader; // HTTP header len
+
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->fKeepConn; // Keep alive? (bool)
+
+ case HSE_REQ_SEND_RESPONSE_HEADER:
r->status_line = lpvBuffer ? lpvBuffer : ap_pstrdup(r->pool, "200 OK");
sscanf(r->status_line, "%d", &r->status);
cid->ecb->dwHttpStatusCode = r->status;
/* End of headers */
if (*data == '\0') {
#ifdef RELAX_HEADER_RULE
- if (lf)
+ if (lf)
#endif
- data = lf + 1; /* Reset data */
- break;
+ data = lf + 1; /* Reset data */
+ break;
}
if (!(value = strchr(data, ':'))) {
- SetLastError(TODO_ERROR);
- /* ### euh... we're passing the wrong type of error
- ### code here */
- ap_log_rerror(APLOG_MARK, APLOG_ERR,
- HTTP_INTERNAL_SERVER_ERROR, r,
- "ISA sent invalid headers", r->filename);
- return FALSE;
+ SetLastError(TODO_ERROR);
+ /* ### euh... we're passing the wrong type of error
+ ### code here */
+ ap_log_rerror(APLOG_MARK, APLOG_ERR,
+ HTTP_INTERNAL_SERVER_ERROR, r,
+ "ISA sent invalid headers", r->filename);
+ return FALSE;
}
*value++ = '\0';
*/
if (!strcasecmp(data, "Content-Type")) {
- char *tmp;
- /* Nuke trailing whitespace */
-
- char *endp = value + strlen(value) - 1;
- while (endp > value && ap_isspace(*endp)) *endp-- = '\0';
-
- tmp = ap_pstrdup (r->pool, value);
- ap_str_tolower(tmp);
- r->content_type = tmp;
+ char *tmp;
+ /* Nuke trailing whitespace */
+
+ char *endp = value + strlen(value) - 1;
+ while (endp > value && ap_isspace(*endp)) *endp-- = '\0';
+
+ tmp = ap_pstrdup (r->pool, value);
+ ap_str_tolower(tmp);
+ r->content_type = tmp;
}
else if (!strcasecmp(data, "Content-Length")) {
ap_table_set(r->headers_out, data, value);
ap_table_set(r->headers_out, data, value);
}
else if (!strcasecmp(data, "Set-Cookie")) {
- ap_table_add(r->err_headers_out, data, value);
+ ap_table_add(r->err_headers_out, data, value);
}
else {
- ap_table_merge(r->err_headers_out, data, value);
+ ap_table_merge(r->err_headers_out, data, value);
}
/* Reset data */
#ifdef RELAX_HEADER_RULE
if (!lf) {
- data += p;
+ data += p;
break;
}
#endif
return TRUE;
- case HSE_REQ_MAP_URL_TO_PATH:
+ case HSE_REQ_MAP_URL_TO_PATH:
/* Map a URL to a filename */
subreq = ap_sub_req_lookup_uri(ap_pstrndup(r->pool, (char *)lpvBuffer,
- *lpdwSize), r);
+ *lpdwSize), r);
GetFullPathName(subreq->filename, *lpdwSize - 1, (char *)lpvBuffer, NULL);
/* IIS puts a trailing slash on directories, Apache doesn't */
if (subreq->finfo.filetype == APR_DIR) {
- int l = strlen((char *)lpvBuffer);
+ int l = strlen((char *)lpvBuffer);
- ((char *)lpvBuffer)[l] = '\\';
- ((char *)lpvBuffer)[l + 1] = '\0';
+ ((char *)lpvBuffer)[l] = '\\';
+ ((char *)lpvBuffer)[l + 1] = '\0';
}
return TRUE;
- case HSE_REQ_DONE_WITH_SESSION:
- /* Do nothing... since we don't support async I/O, they'll
- * return from HttpExtensionProc soon
+ case HSE_REQ_DONE_WITH_SESSION:
+ /* TODO: Signal the main request with the event to complete the session
*/
return TRUE;
- /* We don't support all this async I/O, Microsoft-specific stuff */
- case HSE_REQ_IO_COMPLETION:
- case HSE_REQ_TRANSMIT_FILE:
- /* ### euh... we're passing the wrong type of error code here */
- ap_log_rerror(APLOG_MARK, APLOG_WARNING,
- HTTP_INTERNAL_SERVER_ERROR, r,
- "ISAPI asynchronous I/O not supported: %s",
- r->filename);
- default:
+ /* We don't support all this async I/O, Microsoft-specific stuff */
+ case HSE_REQ_IO_COMPLETION:
+ /* TODO: Emulate a completion port, if we can...
+ * Record the callback address and user defined argument...
+ * we will call this after any async request (including transmitfile)
+ * as if the request had been async.
+ */
+
+ case HSE_REQ_TRANSMIT_FILE:
+ /* Use TransmitFile (in leiu of WriteClient)... nothing wrong with that
+ */
+
+ /* ### euh... we're passing the wrong type of error code here */
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING,
+ HTTP_INTERNAL_SERVER_ERROR, r,
+ "ISAPI asynchronous I/O not supported: %s",
+ r->filename);
+
+ case HSE_APPEND_LOG_PARAMETER:
+ /* Log lpvBuffer, of lpdwSize bytes */
+ return TRUE;
+
+ case HSE_REQ_ABORTIVE_CLOSE:
+ case HSE_REQ_ASYNC_READ_CLIENT:
+ case HSE_REQ_CLOSE_CONNECTION:
+ case HSE_REQ_GET_CERT_INFO_EX:
+ case HSE_REQ_GET_IMPERSONATION_TOKEN:
+ case HSE_REQ_GET_SSPI_INFO:
+ case HSE_REQ_IS_KEEP_CONN:
+ case HSE_REQ_MAP_URL_TO_PATH_EX:
+ case HSE_REQ_REFRESH_ISAPI_ACL:
+
+ default:
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
NULL, /* server config */
NULL, /* merge server config */
NULL, /* command ap_table_t */
- isapi_handlers, /* handlers */
+ isapi_handlers, /* handlers */
NULL /* register hooks */
};
#include "http_request.h"
#include "http_core.h"
#include "apr_mmap.h"
+#include "apr_strings.h"
module MODULE_VAR_EXPORT file_cache_module;
static int once_through = 0;
#include "http_log.h"
#include "http_protocol.h"
#include "mod_rewrite.h"
+#include "apr_strings.h"
#if !defined(OS2) && !defined(WIN32)
#include "unixd.h"
}
else {
return ap_pstrcat(p, "RewriteOptions: unknown option '",
- name, "'\n", NULL);
+ name, "'", NULL);
}
return NULL;
}
/* parse the argument line ourself */
if (parseargline(str, &a1, &a2, &a3)) {
return ap_pstrcat(cmd->pool, "RewriteCond: bad argument line '", str,
- "'\n", NULL);
+ "'", NULL);
}
/* arg1: the input string */
if (rc) {
return ap_pstrcat(cmd->pool,
"RewriteCond: cannot compile regular expression '",
- a2, "'\n", NULL);
+ a2, "'", NULL);
}
newcond->pattern = ap_pstrdup(cmd->pool, cp);
cfg->flags |= CONDFLAG_ORNEXT;
}
else {
- return ap_pstrcat(p, "RewriteCond: unknown flag '", key, "'\n", NULL);
+ return ap_pstrcat(p, "RewriteCond: unknown flag '", key, "'", NULL);
}
return NULL;
}
/* parse the argument line ourself */
if (parseargline(str, &a1, &a2, &a3)) {
return ap_pstrcat(cmd->pool, "RewriteRule: bad argument line '", str,
- "'\n", NULL);
+ "'", NULL);
}
/* arg3: optional flags field */
if ((regexp = ap_pregcomp(cmd->pool, cp, mode)) == NULL) {
return ap_pstrcat(cmd->pool,
"RewriteRule: cannot compile regular expression '",
- a1, "'\n", NULL);
+ a1, "'", NULL);
}
newrule->pattern = ap_pstrdup(cmd->pool, cp);
newrule->regexp = regexp;
cfg->flags |= RULEFLAG_NOCASE;
}
else {
- return ap_pstrcat(p, "RewriteRule: unknown flag '", key, "'\n", NULL);
+ return ap_pstrcat(p, "RewriteRule: unknown flag '", key, "'", NULL);
}
return NULL;
}
#include "http_log.h"
#include "ap_config.h"
#include "apr_dso.h"
+#include "apr_strings.h"
module MODULE_VAR_EXPORT so_module;
return ap_pstrcat(cmd->pool, "Cannot load ", szModuleFile,
" into server: ",
- ap_dso_error(modhandle, my_error, sizeof(my_error)),
+ ap_strerror(status, my_error, sizeof(my_error)),
NULL);
}
ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
#include "http_request.h"
#include "http_log.h"
#include "apr_file_io.h"
+#include "apr_strings.h"
/* mod_speling.c - by Alexei Kosut <akosut@organic.com> June, 1996
*
#include "util_script.h"
#include "http_log.h"
#include "http_request.h"
+#include "apr_strings.h"
+
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#include "http_config.h"
#include "http_log.h"
#include "http_request.h"
+#include "apr_strings.h"
typedef struct {
int active;
#include "http_config.h"
#include "http_core.h"
#include "http_request.h"
+#include "apr_strings.h"
module MODULE_VAR_EXPORT usertrack_module;
#include "http_log.h"
#include "util_script.h"
#include "apr_portable.h"
+#include "apr_strings.h"
+
/* We use the exact same header file as the original */
#include <HttpExt.h>
ecb->dwVersion = MAKELONG(0, 2);
ecb->dwHttpStatusCode = 0;
strcpy(ecb->lpszLogData, "");
- ecb->lpszMethod = r->method;
- ecb->lpszQueryString = ap_table_get(e, "QUERY_STRING");
- ecb->lpszPathInfo = ap_table_get(e, "PATH_INFO");
- ecb->lpszPathTranslated = ap_table_get(e, "PATH_TRANSLATED");
- ecb->lpszContentType = ap_table_get(e, "CONTENT_TYPE");
+ // TODO: is a copy needed here?
+ ecb->lpszMethod = (char*) r->method;
+ // TODO: is a copy needed here?
+ ecb->lpszQueryString = (char*) ap_table_get(e, "QUERY_STRING");
+ // TODO: is a copy needed here?
+ ecb->lpszPathInfo = (char*) ap_table_get(e, "PATH_INFO");
+ // TODO: is a copy needed here?
+ ecb->lpszPathTranslated = (char*) ap_table_get(e, "PATH_TRANSLATED");
+ // TODO: is a copy needed here?
+ ecb->lpszContentType = (char*) ap_table_get(e, "CONTENT_TYPE");
/* Set up client input */
if ((retval = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) {
FreeLibrary(isapi_handle);
switch(retval) {
- case HSE_STATUS_SUCCESS:
- case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
+ case HSE_STATUS_SUCCESS:
+ /* TODO: If content length was missing or incorrect, and the response
+ * was not chunked, we need to close the connection here.
+ * If the response was chunked, and no closing chunk was sent, we aught
+ * to transmit one here
+ */
+
+ /* fall through... */
+ case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
/* Ignore the keepalive stuff; Apache handles it just fine without
* the ISA's "advice".
*/
return OK;
- case HSE_STATUS_PENDING: /* We don't support this */
- ap_log_rerror(APLOG_MARK, APLOG_WARNING, APR_ENOTIMPL, r,
- "ISAPI asynchronous I/O not supported: %s", r->filename);
- /* fallthrough */
- case HSE_STATUS_ERROR:
- default:
+ case HSE_STATUS_PENDING:
+ /* We don't support this, but we need to... we should simply create a
+ * wait event and die on timeout or resume with the callback to our
+ * ServerSupportFunction with HSE_REQ_DONE_WITH_SESSION to emulate
+ * async behavior.
+ */
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, APR_ENOTIMPL, r,
+ "ISAPI asynchronous I/O not supported: %s", r->filename);
- return HTTP_INTERNAL_SERVER_ERROR;
+ case HSE_STATUS_ERROR:
+ /* end response if we have yet to do so.
+ */
+ return HTTP_INTERNAL_SERVER_ERROR;
+
+ default:
+ /* TODO: log unrecognized retval for debugging
+ */
+ return HTTP_INTERNAL_SERVER_ERROR;
}
}
BOOL WINAPI ReadClient (HCONN ConnID, LPVOID lpvBuffer, LPDWORD lpdwSize)
{
- /* Doesn't need to do anything; we've read all the data already */
+ /* If the request was a huge transmit or chunked, continue piping the
+ * request here, but if it's of a sane size, continue to ...
+ */
return TRUE;
}
char *data;
switch (dwHSERequest) {
- case HSE_REQ_SEND_URL_REDIRECT_RESP:
- /* Set the status to be returned when the HttpExtensionProc()
- * is done.
- */
- ap_table_set (r->headers_out, "Location", lpvBuffer);
- cid->status = cid->r->status = cid->ecb->dwHttpStatusCode =
- HTTP_MOVED_TEMPORARILY;
- return TRUE;
+ case HSE_REQ_SEND_URL_REDIRECT_RESP:
+ /* Set the status to be returned when the HttpExtensionProc()
+ * is done.
+ */
+ ap_table_set (r->headers_out, "Location", lpvBuffer);
+ cid->status = cid->r->status = cid->ecb->dwHttpStatusCode =
+ HTTP_MOVED_TEMPORARILY;
+ return TRUE;
- case HSE_REQ_SEND_URL:
- /* Read any additional input */
+ case HSE_REQ_SEND_URL:
+ /* Read any additional input */
- if (r->remaining > 0) {
- char argsbuffer[HUGE_STRING_LEN];
+ if (r->remaining > 0) {
+ char argsbuffer[HUGE_STRING_LEN];
- while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN));
- }
+ while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN));
+ }
- /* Reset the method to GET */
- r->method = ap_pstrdup(r->pool, "GET");
- r->method_number = M_GET;
+ /* Reset the method to GET */
+ r->method = ap_pstrdup(r->pool, "GET");
+ r->method_number = M_GET;
- /* Don't let anyone think there's still data */
- ap_table_unset(r->headers_in, "Content-Length");
+ /* Don't let anyone think there's still data */
+ ap_table_unset(r->headers_in, "Content-Length");
- ap_internal_redirect((char *)lpvBuffer, r);
- return TRUE;
+ ap_internal_redirect((char *)lpvBuffer, r);
+ return TRUE;
- case HSE_REQ_SEND_RESPONSE_HEADER:
+ case HSE_REQ_SEND_RESPONSE_HEADER_EX:
+ if (((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszStatus
+ && ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchStatus)
+ r->status_line = ap_pstrndup(r->pool,
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszStatus,
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchStatus);
+ else
+ r->status_line = ap_pstrdup(r->pool, "200 OK");
+ sscanf(r->status_line, "%d", &r->status);
+ cid->ecb->dwHttpStatusCode = r->status;
+
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszHeader; // HTTP header
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchHeader; // HTTP header len
+
+ ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->fKeepConn; // Keep alive? (bool)
+
+ case HSE_REQ_SEND_RESPONSE_HEADER:
r->status_line = lpvBuffer ? lpvBuffer : ap_pstrdup(r->pool, "200 OK");
sscanf(r->status_line, "%d", &r->status);
cid->ecb->dwHttpStatusCode = r->status;
/* End of headers */
if (*data == '\0') {
#ifdef RELAX_HEADER_RULE
- if (lf)
+ if (lf)
#endif
- data = lf + 1; /* Reset data */
- break;
+ data = lf + 1; /* Reset data */
+ break;
}
if (!(value = strchr(data, ':'))) {
- SetLastError(TODO_ERROR);
- /* ### euh... we're passing the wrong type of error
- ### code here */
- ap_log_rerror(APLOG_MARK, APLOG_ERR,
- HTTP_INTERNAL_SERVER_ERROR, r,
- "ISA sent invalid headers", r->filename);
- return FALSE;
+ SetLastError(TODO_ERROR);
+ /* ### euh... we're passing the wrong type of error
+ ### code here */
+ ap_log_rerror(APLOG_MARK, APLOG_ERR,
+ HTTP_INTERNAL_SERVER_ERROR, r,
+ "ISA sent invalid headers", r->filename);
+ return FALSE;
}
*value++ = '\0';
*/
if (!strcasecmp(data, "Content-Type")) {
- char *tmp;
- /* Nuke trailing whitespace */
-
- char *endp = value + strlen(value) - 1;
- while (endp > value && ap_isspace(*endp)) *endp-- = '\0';
-
- tmp = ap_pstrdup (r->pool, value);
- ap_str_tolower(tmp);
- r->content_type = tmp;
+ char *tmp;
+ /* Nuke trailing whitespace */
+
+ char *endp = value + strlen(value) - 1;
+ while (endp > value && ap_isspace(*endp)) *endp-- = '\0';
+
+ tmp = ap_pstrdup (r->pool, value);
+ ap_str_tolower(tmp);
+ r->content_type = tmp;
}
else if (!strcasecmp(data, "Content-Length")) {
ap_table_set(r->headers_out, data, value);
ap_table_set(r->headers_out, data, value);
}
else if (!strcasecmp(data, "Set-Cookie")) {
- ap_table_add(r->err_headers_out, data, value);
+ ap_table_add(r->err_headers_out, data, value);
}
else {
- ap_table_merge(r->err_headers_out, data, value);
+ ap_table_merge(r->err_headers_out, data, value);
}
/* Reset data */
#ifdef RELAX_HEADER_RULE
if (!lf) {
- data += p;
+ data += p;
break;
}
#endif
return TRUE;
- case HSE_REQ_MAP_URL_TO_PATH:
+ case HSE_REQ_MAP_URL_TO_PATH:
/* Map a URL to a filename */
subreq = ap_sub_req_lookup_uri(ap_pstrndup(r->pool, (char *)lpvBuffer,
- *lpdwSize), r);
+ *lpdwSize), r);
GetFullPathName(subreq->filename, *lpdwSize - 1, (char *)lpvBuffer, NULL);
/* IIS puts a trailing slash on directories, Apache doesn't */
if (subreq->finfo.filetype == APR_DIR) {
- int l = strlen((char *)lpvBuffer);
+ int l = strlen((char *)lpvBuffer);
- ((char *)lpvBuffer)[l] = '\\';
- ((char *)lpvBuffer)[l + 1] = '\0';
+ ((char *)lpvBuffer)[l] = '\\';
+ ((char *)lpvBuffer)[l + 1] = '\0';
}
return TRUE;
- case HSE_REQ_DONE_WITH_SESSION:
- /* Do nothing... since we don't support async I/O, they'll
- * return from HttpExtensionProc soon
+ case HSE_REQ_DONE_WITH_SESSION:
+ /* TODO: Signal the main request with the event to complete the session
*/
return TRUE;
- /* We don't support all this async I/O, Microsoft-specific stuff */
- case HSE_REQ_IO_COMPLETION:
- case HSE_REQ_TRANSMIT_FILE:
- /* ### euh... we're passing the wrong type of error code here */
- ap_log_rerror(APLOG_MARK, APLOG_WARNING,
- HTTP_INTERNAL_SERVER_ERROR, r,
- "ISAPI asynchronous I/O not supported: %s",
- r->filename);
- default:
+ /* We don't support all this async I/O, Microsoft-specific stuff */
+ case HSE_REQ_IO_COMPLETION:
+ /* TODO: Emulate a completion port, if we can...
+ * Record the callback address and user defined argument...
+ * we will call this after any async request (including transmitfile)
+ * as if the request had been async.
+ */
+
+ case HSE_REQ_TRANSMIT_FILE:
+ /* Use TransmitFile (in leiu of WriteClient)... nothing wrong with that
+ */
+
+ /* ### euh... we're passing the wrong type of error code here */
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING,
+ HTTP_INTERNAL_SERVER_ERROR, r,
+ "ISAPI asynchronous I/O not supported: %s",
+ r->filename);
+
+ case HSE_APPEND_LOG_PARAMETER:
+ /* Log lpvBuffer, of lpdwSize bytes */
+ return TRUE;
+
+ case HSE_REQ_ABORTIVE_CLOSE:
+ case HSE_REQ_ASYNC_READ_CLIENT:
+ case HSE_REQ_CLOSE_CONNECTION:
+ case HSE_REQ_GET_CERT_INFO_EX:
+ case HSE_REQ_GET_IMPERSONATION_TOKEN:
+ case HSE_REQ_GET_SSPI_INFO:
+ case HSE_REQ_IS_KEEP_CONN:
+ case HSE_REQ_MAP_URL_TO_PATH_EX:
+ case HSE_REQ_REFRESH_ISAPI_ACL:
+
+ default:
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
NULL, /* server config */
NULL, /* merge server config */
NULL, /* command ap_table_t */
- isapi_handlers, /* handlers */
+ isapi_handlers, /* handlers */
NULL /* register hooks */
};
#include "httpd.h"
#include "http_log.h"
+#include "apr_strings.h"
#include <stdarg.h>
#include <time.h>
#include "http_connection.h"
#include "apr_portable.h"
#include "apr_getopt.h"
+#include "apr_strings.h"
#include "ap_mpm.h"
#include "ap_config.h"
#include "ap_listen.h"
context->sa_client = ap_palloc(context->ptrans, len);
if ((getpeername(context->accept_socket,
context->sa_client, &len)) == SOCKET_ERROR) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, h_errno, server_conf,
- "getpeername failed with error %d\n", WSAGetLastError());
+ ap_log_error(APLOG_MARK, APLOG_WARNING, WSAGetLastError(), server_conf,
+ "getpeername failed");
memset(&context->sa_client, '\0', sizeof(context->sa_client));
}
/* Create a pipe to send socket info to the child */
if (!CreatePipe(&hPipeRead, &hPipeWrite, &sa, 0)) {
ap_log_error(APLOG_MARK, APLOG_CRIT, GetLastError(), server_conf,
- "Parent: Unable to create pipe to child process.\n");
+ "Parent: Unable to create pipe to child process.");
return -1;
}
#include "httpd.h"
#include "http_log.h"
#include "mpm_winnt.h"
+#include "apr_strings.h"
/* bet you are looking to change revisions to roll the tarball...
* Guess what, you already did. Revised May '00 to save you from
#include "http_conf_globals.h"
#include "http_log.h"
#include "mpm_winnt.h"
+#include "apr_strings.h"
char *service_name = NULL;
char *display_name = NULL;