From 0ecf0cce280db90e5c41460e784dbb5e6da6bd68 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Sun, 21 Jul 2002 09:19:19 +0000 Subject: [PATCH] A half hour to waste waiting for builds... this is what you get. mod_isapi will build and run on OSX... presume others as well unless I choose some awful errno values for portability. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96136 13f79535-47bb-0310-9956-ffa450edef68 --- modules/arch/win32/.cvsignore | 11 +++++++++++ modules/arch/win32/Makefile.in | 3 +++ modules/arch/win32/config.m4 | 11 +++++++++++ modules/arch/win32/mod_isapi.c | 13 +++++++------ modules/arch/win32/mod_isapi.h | 26 ++++++++++++++++++++++++-- 5 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 modules/arch/win32/Makefile.in create mode 100644 modules/arch/win32/config.m4 diff --git a/modules/arch/win32/.cvsignore b/modules/arch/win32/.cvsignore index 1bb03def78..8a31aca1e9 100644 --- a/modules/arch/win32/.cvsignore +++ b/modules/arch/win32/.cvsignore @@ -1,5 +1,16 @@ +.deps +.libs +*.la +modules.mk +Makefile +*.lo +*.slo +*.so Debug Release +*.plg +*.aps +*.dep *.mak *.rc BuildLog.htm diff --git a/modules/arch/win32/Makefile.in b/modules/arch/win32/Makefile.in new file mode 100644 index 0000000000..7c5c149d85 --- /dev/null +++ b/modules/arch/win32/Makefile.in @@ -0,0 +1,3 @@ +# a modules Makefile has no explicit targets -- they will be defined by +# whatever modules are enabled. just grab special.mk to deal with this. +include $(top_srcdir)/build/special.mk diff --git a/modules/arch/win32/config.m4 b/modules/arch/win32/config.m4 new file mode 100644 index 0000000000..25f7a85092 --- /dev/null +++ b/modules/arch/win32/config.m4 @@ -0,0 +1,11 @@ +dnl modules enabled in this directory by default + +dnl APACHE_MODULE(name, helptext[, objects[, structname[, default[, config]]]]) + +APACHE_MODPATH_INIT(arch/win32) + +APACHE_MODULE(isapi, isapi extension support, , , no) + +APR_ADDTO(LT_LDFLAGS,-export-dynamic) + +APACHE_MODPATH_FINISH diff --git a/modules/arch/win32/mod_isapi.c b/modules/arch/win32/mod_isapi.c index bd99f003e0..21cf62ca23 100644 --- a/modules/arch/win32/mod_isapi.c +++ b/modules/arch/win32/mod_isapi.c @@ -308,7 +308,7 @@ static apr_status_t isapi_load(apr_pool_t *p, server_rec *s, isapi_loaded *isa) * location, etc) they apply to. */ isa->report_version = MAKELONG(0, 5); /* Revision 5.0 */ - isa->timeout = INFINITE; /* microsecs */ + isa->timeout = 300 * 1000000; /* microsecs, not used */ rv = apr_dso_load(&isa->handle, isa->filename, p); if (rv) @@ -515,7 +515,7 @@ apr_status_t isapi_lookup(apr_pool_t *p, server_rec *s, request_rec *r, **********************************************************/ /* Our "Connection ID" structure */ -typedef struct isapi_cid { +struct isapi_cid { EXTENSION_CONTROL_BLOCK *ecb; isapi_dir_conf dconf; isapi_loaded *isa; @@ -524,7 +524,7 @@ typedef struct isapi_cid { PFN_HSE_IO_COMPLETION completion; void *completion_arg; apr_thread_mutex_t *completed; -} isapi_cid; +}; int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, char *variable_name, @@ -1158,17 +1158,18 @@ int APR_THREAD_FUNC ServerSupportFunction(isapi_cid *cid, */ if (subreq->path_info && *subreq->path_info) { apr_cpystrn(info->lpszPath + info->cchMatchingPath, - subreq->path_info, MAX_PATH - info->cchMatchingPath); + subreq->path_info, + sizeof(info->lpszPath) - info->cchMatchingPath); info->cchMatchingURL -= strlen(subreq->path_info); if (subreq->finfo.filetype == APR_DIR - && info->cchMatchingPath < MAX_PATH - 1) { + && info->cchMatchingPath < sizeof(info->lpszPath) - 1) { /* roll forward over path_info's first slash */ ++info->cchMatchingPath; ++info->cchMatchingURL; } } else if (subreq->finfo.filetype == APR_DIR - && info->cchMatchingPath < MAX_PATH - 1) { + && info->cchMatchingPath < sizeof(info->lpszPath) - 1) { /* Add a trailing slash for directory */ info->lpszPath[info->cchMatchingPath++] = '/'; info->lpszPath[info->cchMatchingPath] = '\0'; diff --git a/modules/arch/win32/mod_isapi.h b/modules/arch/win32/mod_isapi.h index 3a4ffd951b..6c96db4ba6 100644 --- a/modules/arch/win32/mod_isapi.h +++ b/modules/arch/win32/mod_isapi.h @@ -78,7 +78,8 @@ typedef (APR_THREAD_FUNC *PFN_GETEXTENSIONVERSION)(HSE_VERSION_INFO *ver_info); /* Our internal 'HCONN' representation, always opaque to the user. */ -typedef struct isapi_cid isapi_cid, *HCONN; +typedef struct isapi_cid isapi_cid; +typedef struct isapi_cid *HCONN; /* Prototypes of the essential functions exposed by mod_isapi * for the module to communicate with Apache. @@ -201,7 +202,7 @@ typedef struct HSE_TF_INFO { } HSE_TF_INFO; typedef struct HSE_URL_MAPEX_INFO { - char lpszPath[MAX_PATH]; + char lpszPath[260]; apr_uint32_t dwFlags; apr_uint32_t cchMatchingPath; apr_uint32_t cchMatchingURL; @@ -251,6 +252,27 @@ typedef apr_uint32_t (APR_THREAD_FUNC #define HSE_STATUS_PENDING 3 /* Emulated (thread lock) */ #define HSE_STATUS_ERROR 4 +/* Anticipated error code for common faults within mod_isapi itself + */ +#ifndef ERROR_INSUFFICIENT_BUFFER +#define ERROR_INSUFFICIENT_BUFFER ENOBUFS +#endif +#ifndef ERROR_INVALID_INDEX +#define ERROR_INVALID_INDEX EINVAL +#endif +#ifndef ERROR_INVALID_PARAMETER +#define ERROR_INVALID_PARAMETER EINVAL +#endif +#ifndef ERROR_READ_FAULT +#define ERROR_READ_FAULT EIO +#endif +#ifndef ERROR_WRITE_FAULT +#define ERROR_WRITE_FAULT EIO +#endif +#ifndef ERROR_SUCCESS +#define ERROR_SUCCESS 0 +#endif + /* Valid flags passed with TerminateExtension() */ #define HSE_TERM_MUST_UNLOAD 1 -- 2.40.0