cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/09/22 23:35:10 Modified:jk/native/iis jk_isapi_plugin.c Log: Use simple Translate header for multiple instances. Patch provided by Tim Whittington fixes #35298. Revision ChangesPath 1.54 +7 -4 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- jk_isapi_plugin.c 14 Sep 2005 10:52:43 - 1.53 +++ jk_isapi_plugin.c 23 Sep 2005 06:35:10 - 1.54 @@ -79,6 +79,10 @@ #define URI_SELECT_UNPARSED_VERB(unparsed) #define URI_SELECT_ESCAPED_VERB (escaped) +#define TRANSLATE_HEADER (Translate:) +#define TRANSLATE_HEADER_NAME (Translate) +#define TRANSLATE_HEADER_NAME_LC (translate) + #define BAD_REQUEST -1 #define BAD_PATH-2 #define MAX_SERVERNAME 128 @@ -907,7 +911,7 @@ * This allows the servlet to handle 'Translate: f'. */ if (GetHeader -(pfc, Translate:, (LPVOID) Translate, +(pfc, TRANSLATE_HEADER, (LPVOID) Translate, (LPDWORD) szTranslate) Translate != NULL szTranslate 0) { if (!AddHeader @@ -1555,8 +1559,7 @@ } else if (!strnicmp(tmp, TOMCAT_TRANSLATE_HEADER_NAME, strlen(TOMCAT_TRANSLATE_HEADER_NAME))) { -tmp += 6; /* TOMCAT */ -s-headers_names[i] = tmp; +s-headers_names[i] = TRANSLATE_HEADER_NAME_LC; } else { s-headers_names[i] = tmp; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/09/22 23:54:16 Modified:jk/native/iis jk_isapi_plugin.c Log: Remove temporary HTTP_TOMCATQUERY header from ALL_HTTP. Patch provided by Tim Whittington that fixes #36765 Revision ChangesPath 1.55 +13 -2 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- jk_isapi_plugin.c 23 Sep 2005 06:35:10 - 1.54 +++ jk_isapi_plugin.c 23 Sep 2005 06:54:16 - 1.55 @@ -1529,7 +1529,10 @@ size_t len_of_http_prefix = strlen(HTTP_); BOOL need_content_length_header = (s-content_length == 0); -cnt -= 2; /* For our two special headers */ +cnt -= 2; /* For our two special headers: + * HTTP_TOMCATURI_ + * HTTP_TOMCATWORKER_ + */ /* allocate an extra header slot in case we need to add a content-length header */ s-headers_names = jk_pool_alloc(private_data-p, (cnt + 1) * sizeof(char *)); @@ -1551,6 +1554,14 @@ strlen(WORKER_HEADER_NAME))) { real_header = JK_FALSE; } +else if (!strnicmp(tmp, QUERY_HEADER_NAME, + strlen(QUERY_HEADER_NAME))) { +/* HTTP_TOMCATQUERY_ was supplied, + * remove it from the count and skip + */ +cnt--; +real_header = JK_FALSE; +} else if (need_content_length_header !strnicmp(tmp, CONTENT_LENGTH, strlen(CONTENT_LENGTH))) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/09/14 03:52:44 Modified:jk/native/iis jk_isapi_plugin.c Log: Fix patch 35298. The patch was lacking the HTTP_ prefix headers with dll instance postfix. Also the postfix is bogus if there is underscore between header names. Probably the IIS issue. Revision ChangesPath 1.53 +29 -21jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- jk_isapi_plugin.c 12 Sep 2005 14:10:51 - 1.52 +++ jk_isapi_plugin.c 14 Sep 2005 10:52:43 - 1.53 @@ -51,26 +51,25 @@ * 3. The contents of the Translate header, if any * */ -#define URI_HEADER_NAME_BASE (TOMCATURI) -#define QUERY_HEADER_NAME_BASE (TOMCATQUERY) -#define WORKER_HEADER_NAME_BASE (TOMCATWORKER) +#define URI_HEADER_NAME_BASE (TOMCATURI) +#define QUERY_HEADER_NAME_BASE(TOMCATQUERY) +#define WORKER_HEADER_NAME_BASE (TOMCATWORKER) #define TOMCAT_TRANSLATE_HEADER_NAME_BASE (TOMCATTRANSLATE) +#define CONTENT_LENGTH(CONTENT_LENGTH:) +/* The template used to construct our unique headers + * from the base name and module instance + */ +#define HEADER_TEMPLATE (%s%p:) +#define HTTP_HEADER_TEMPLATE (HTTP_%s%p) static char URI_HEADER_NAME[_MAX_FNAME]; static char QUERY_HEADER_NAME[_MAX_FNAME]; static char WORKER_HEADER_NAME[_MAX_FNAME]; static char TOMCAT_TRANSLATE_HEADER_NAME[_MAX_FNAME]; -/* The template used to construct our unique headers - * from the base name and module instance - */ -#define HEADER_TEMPLATE (%s_%p:) - -#define CONTENT_LENGTH (CONTENT_LENGTH) - -#define HTTP_URI_HEADER_NAME (HTTP_TOMCATURI) -#define HTTP_QUERY_HEADER_NAME (HTTP_TOMCATQUERY) -#define HTTP_WORKER_HEADER_NAME (HTTP_TOMCATWORKER) +static char HTTP_URI_HEADER_NAME[_MAX_FNAME]; +static char HTTP_QUERY_HEADER_NAME[_MAX_FNAME]; +static char HTTP_WORKER_HEADER_NAME[_MAX_FNAME]; #define REGISTRY_LOCATION (Software\\Apache Software Foundation\\Jakarta Isapi Redirector\\1.0) #define EXTENSION_URI_TAG (extension_uri) @@ -133,7 +132,7 @@ static int iis5 = -1; static jk_uri_worker_map_t *uw_map = NULL; -static jk_map_t *wp_map = NULL; /* worker_properties */ +static jk_map_t *workers_map = NULL; static jk_logger_t *logger = NULL; static char *SERVER_NAME = SERVER_NAME; static char *SERVER_SOFTWARE = SERVER_SOFTWARE; @@ -1071,9 +1070,9 @@ uri_worker_map_free(uw_map, logger); is_mapread = JK_FALSE; } -memset(worker_env, 0, sizeof(worker_env)); -if (wp_map) { -jk_map_free(wp_map); +if (workers_map) { +jk_map_free(workers_map); +workers_map = NULL; } wc_close(logger); if (logger) { @@ -,6 +1110,11 @@ sprintf(QUERY_HEADER_NAME, HEADER_TEMPLATE, QUERY_HEADER_NAME_BASE, hInst); sprintf(WORKER_HEADER_NAME, HEADER_TEMPLATE, WORKER_HEADER_NAME_BASE, hInst); sprintf(TOMCAT_TRANSLATE_HEADER_NAME, HEADER_TEMPLATE, TOMCAT_TRANSLATE_HEADER_NAME_BASE, hInst); + +sprintf(HTTP_URI_HEADER_NAME, HTTP_HEADER_TEMPLATE, URI_HEADER_NAME_BASE, hInst); +sprintf(HTTP_QUERY_HEADER_NAME, HTTP_HEADER_TEMPLATE, QUERY_HEADER_NAME_BASE, hInst); +sprintf(HTTP_WORKER_HEADER_NAME, HTTP_HEADER_TEMPLATE, WORKER_HEADER_NAME_BASE, hInst); + break; case DLL_PROCESS_DETACH: __try { @@ -1168,14 +1172,14 @@ } if (rc) { rc = JK_FALSE; -if (jk_map_alloc(wp_map)) { -if (jk_map_read_properties(wp_map, worker_file, NULL)) { +if (jk_map_alloc(workers_map)) { +if (jk_map_read_properties(workers_map, worker_file, NULL)) { /* we add the URI-WORKER MAP since workers using AJP14 will feed it */ worker_env.uri_to_worker = uw_map; worker_env.server_name = serverName; -if (wc_open(wp_map, worker_env, logger)) { +if (wc_open(workers_map, worker_env, logger)) { rc = JK_TRUE; } } @@ -1183,6 +1187,10 @@ jk_log(logger, JK_LOG_EMERG, Unable to read worker file %s., worker_file); } +if (rc != JK_TRUE) { +jk_map_free(workers_map); +workers_map = NULL; +} } } - To unsubscribe, e-mail: [EMAIL
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/09/12 05:54:31 Modified:jk/native/iis jk_isapi_plugin.c Log: Fix bug #36102 by using anon shared memory on windows. IIS can launch multiple child processes, so we need to share the date between them all. Revision ChangesPath 1.50 +3 -3 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- jk_isapi_plugin.c 18 May 2005 18:04:53 - 1.49 +++ jk_isapi_plugin.c 12 Sep 2005 12:54:31 - 1.50 @@ -40,7 +40,7 @@ #include jk_shm.h #define VERSION_STRING Jakarta/ISAPI/ JK_VERSTRING - +#define SHM_DEF_NAME JKISAPISHMEM #define DEFAULT_WORKER_NAME (ajp13) /* * We use special headers to pass values from the filter to the @@ -1117,7 +1117,7 @@ /* Simulate shared memory * For now use fixed size. */ - jk_shm_open(NULL, JK_SHM_DEF_SIZE, logger); + jk_shm_open(SHM_DEF_NAME, JK_SHM_DEF_SIZE, logger); /* 10 is minimum supported on WINXP */ jk_set_worker_def_cache_size(10); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/09/12 07:10:51 Modified:jk/native/iis jk_isapi_plugin.c Log: Fix #35864 Status worker doesn't list workers Patch provided by Martin Goldhahn Revision ChangesPath 1.52 +9 -6 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- jk_isapi_plugin.c 12 Sep 2005 13:46:00 - 1.51 +++ jk_isapi_plugin.c 12 Sep 2005 14:10:51 - 1.52 @@ -133,6 +133,7 @@ static int iis5 = -1; static jk_uri_worker_map_t *uw_map = NULL; +static jk_map_t *wp_map = NULL; /* worker_properties */ static jk_logger_t *logger = NULL; static char *SERVER_NAME = SERVER_NAME; static char *SERVER_SOFTWARE = SERVER_SOFTWARE; @@ -1070,6 +1071,10 @@ uri_worker_map_free(uw_map, logger); is_mapread = JK_FALSE; } +memset(worker_env, 0, sizeof(worker_env)); +if (wp_map) { +jk_map_free(wp_map); +} wc_close(logger); if (logger) { jk_close_file_logger(logger); @@ -1125,7 +1130,6 @@ static int init_jk(char *serverName) { int rc = JK_FALSE; -jk_map_t *map; if (!jk_open_file_logger(logger, log_file, log_level)) { logger = NULL; @@ -1164,14 +1168,14 @@ } if (rc) { rc = JK_FALSE; -if (jk_map_alloc(map)) { -if (jk_map_read_properties(map, worker_file, NULL)) { +if (jk_map_alloc(wp_map)) { +if (jk_map_read_properties(wp_map, worker_file, NULL)) { /* we add the URI-WORKER MAP since workers using AJP14 will feed it */ worker_env.uri_to_worker = uw_map; worker_env.server_name = serverName; -if (wc_open(map, worker_env, logger)) { +if (wc_open(wp_map, worker_env, logger)) { rc = JK_TRUE; } } @@ -1179,7 +1183,6 @@ jk_log(logger, JK_LOG_EMERG, Unable to read worker file %s., worker_file); } -jk_map_free(map); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/04/23 03:02:21 Modified:jk/native/iis jk_isapi_plugin.c Log: Log original request instead logging request for isapi extension, by using SF_NOTIFY_LOG handler. Revision ChangesPath 1.46 +29 -1 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- jk_isapi_plugin.c 17 Mar 2005 12:06:03 - 1.45 +++ jk_isapi_plugin.c 23 Apr 2005 10:02:21 - 1.46 @@ -152,6 +152,11 @@ LPEXTENSION_CONTROL_BLOCK lpEcb; }; +typedef struct isapi_log_data_t isapi_log_data_t; +struct isapi_log_data_t { +char uri[INTERNET_MAX_URL_LENGTH]; +char query[INTERNET_MAX_URL_LENGTH]; +}; static int JK_METHOD start_response(jk_ws_service_t *s, int status, @@ -649,6 +654,7 @@ SF_NOTIFY_SECURE_PORT | SF_NOTIFY_NONSECURE_PORT | SF_NOTIFY_PREPROC_HEADERS | +SF_NOTIFY_LOG | SF_NOTIFY_AUTH_COMPLETE; strcpy(pVer-lpszFilterDesc, VERSION_STRING); @@ -901,6 +907,20 @@ } SetHeader(pfc, Translate:, NULL); } +if (!pfc-pFilterContext) { +isapi_log_data_t *ld = (isapi_log_data_t *)pfc-AllocMem(pfc, sizeof(isapi_log_data_t), 0); +if (!ld) { +jk_log(logger, JK_LOG_ERROR, + error while allocating memory); +SetLastError(ERROR_NOT_ENOUGH_MEMORY); +return SF_STATUS_REQ_ERROR; +} +memset(ld, 0, sizeof(isapi_log_data_t)); +strcpy(ld-uri, forwardURI); +if (query strlen(query) 0) +strcpy(ld-query, query); +pfc-pFilterContext = ld; +} } else { if (JK_IS_DEBUG_LEVEL(logger)) @@ -909,6 +929,14 @@ } } } +else if (is_inited (dwNotificationType == SF_NOTIFY_LOG)) { +if (pfc-pFilterContext) { +isapi_log_data_t *ld = (isapi_log_data_t *)pfc-pFilterContext; +HTTP_FILTER_LOG *pl = (HTTP_FILTER_LOG *)pvNotification; +pl-pszTarget = ld-uri; +pl-pszParameters = ld-query; +} +} return SF_STATUS_REQ_NEXT_NOTIFICATION; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/03/17 04:06:03 Modified:jk/native/apache-1.3 mod_jk.c jk/native/apache-2.0 mod_jk.c jk/native/iis jk_isapi_plugin.c Log: Use 404 instead 403 when client tries to access WEB-INF. This is to comply with Servlet spec. Revision ChangesPath 1.74 +3 -3 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- mod_jk.c 22 Feb 2005 14:40:36 - 1.73 +++ mod_jk.c 17 Mar 2005 12:06:03 - 1.74 @@ -2122,9 +2122,9 @@ if (!strcasecmp(child_dir, WEB-INF) || !strcasecmp(child_dir, META-INF)) { jk_log(l, JK_LOG_DEBUG, - mod_jk::jk_translate, AutoAlias FORBIDDEN for URI: %s, + mod_jk::jk_translate, AutoAlias HTTP_NOT_FOUND for URI: %s, r-uri); -return FORBIDDEN; +return HTTP_NOT_FOUND; } } } 1.131 +3 -3 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v retrieving revision 1.130 retrieving revision 1.131 diff -u -r1.130 -r1.131 --- mod_jk.c 22 Feb 2005 14:40:37 - 1.130 +++ mod_jk.c 17 Mar 2005 12:06:03 - 1.131 @@ -2568,9 +2568,9 @@ || !strcasecmp(child_dir, META-INF)) { if (JK_IS_DEBUG_LEVEL(conf-log)) jk_log(conf-log, JK_LOG_DEBUG, - mod_jk::jk_translate, AutoAlias HTTP_FORBIDDEN for URI: %s, + mod_jk::jk_translate, AutoAlias HTTP_NOT_FOUND for URI: %s, r-uri); -return HTTP_FORBIDDEN; +return HTTP_NOT_FOUND; } } } 1.45 +49 -49jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- jk_isapi_plugin.c 25 Feb 2005 10:54:26 - 1.44 +++ jk_isapi_plugin.c 17 Mar 2005 12:06:03 - 1.45 @@ -79,11 +79,11 @@ Your browser (or proxy) sent a request that \ this server could not understand./DL/DD/BODY/HTML -#define HTML_ERROR_403 !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\ \ -HTMLHEADTITLEAccess forbidden!!/TITLE/HEAD \ -BODYH1Access forbidden!/H1DLDD\n \ -You don't have permission to access the requested object. \ -It is either read-protected or not readable by the server./DL/DD/BODY/HTML +#define HTML_ERROR_404 !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\ \ +HTMLHEADTITLEObject not found!/TITLE/HEAD \ +BODYH1The requested URL was not found on this server \ +/H1DLDD\nIf you entered the URL manually please check your \ +spelling and try again./DL/DD/BODY/HTML #define JK_TOLOWER(x) ((char)tolower((BYTE)(x))) @@ -337,42 +337,42 @@ int status; char *reason; } *r, reasons[] = { -{ 100, Continue }, -{ 101, Switching Protocols }, -{ 200, OK }, -{ 201, Created }, -{ 202, Accepted }, -{ 203, Non-Authoritative Information }, -{ 204, No Content }, -{ 205, Reset Content }, -{ 206, Partial Content }, -{ 300, Multiple Choices }, -{ 301, Moved Permanently }, -{ 302, Moved Temporarily }, -{ 303, See Other }, -{ 304, Not Modified }, -{ 305, Use Proxy }, -{ 400, Bad Request }, -{ 401, Unauthorized }, -
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/25 01:40:05 Modified:jk/native/iis jk_isapi_plugin.c Log: Add default cache size for IIS. Revision ChangesPath 1.42 +17 -14jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- jk_isapi_plugin.c 21 Feb 2005 09:29:34 - 1.41 +++ jk_isapi_plugin.c 25 Feb 2005 09:40:05 - 1.42 @@ -362,20 +362,20 @@ */ static char *stristr(const char *s, const char *find) { - char c, sc; - size_t len; +char c, sc; +size_t len; - if ((c = tolower((unsigned char)(*find++))) != 0) { - len = strlen(find); - do { - do { - if ((sc = tolower((unsigned char)(*s++))) == 0) - return (NULL); - } while (sc != c); - } while (strnicmp(s, find, len) != 0); - s--; - } - return ((char *)s); +if ((c = tolower((unsigned char)(*find++))) != 0) { +len = strlen(find); +do { +do { +if ((sc = tolower((unsigned char)(*s++))) == 0) +return (NULL); +} while (sc != c); +} while (strnicmp(s, find, len) != 0); +s--; +} +return ((char *)s); } static int uri_is_web_inf(const char *uri) @@ -1037,6 +1037,9 @@ */ jk_shm_open(NULL, JK_SHM_DEF_SIZE, logger); + /* 10 is minimum supported on WINXP */ + jk_set_worker_def_cache_size(10); + /* Logging the initialization type: registry or properties file in virtual dir */ if (JK_IS_DEBUG_LEVEL(logger)) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/25 02:20:06 Modified:jk/native/iis jk_isapi_plugin.c Log: Remove default value from get_server_variable. It was not used at first flace. Revision ChangesPath 1.43 +12 -16jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- jk_isapi_plugin.c 25 Feb 2005 09:40:05 - 1.42 +++ jk_isapi_plugin.c 25 Feb 2005 10:20:06 - 1.43 @@ -95,8 +95,7 @@ if (get_server_value(private_data-lpEcb, \ (name), \ huge_buf, \ -huge_buf_sz,\ -)) { \ +huge_buf_sz)) { \ (place) = jk_pool_strdup(private_data-p, \ huge_buf); \ } } while(0) @@ -107,8 +106,7 @@ if (get_server_value(private_data-lpEcb, \ (name), \ huge_buf, \ -huge_buf_sz,\ -)) { \ +huge_buf_sz)) { \ (place) = atoi(huge_buf); \ if (0 == (place)) { \ (place) = def; \ @@ -182,7 +180,7 @@ static int get_server_value(LPEXTENSION_CONTROL_BLOCK lpEcb, char *name, -char *buf, DWORD bufsz, char *def_val); +char *buf, DWORD bufsz); static int base64_encode_cert_len(int len); @@ -1399,7 +1397,7 @@ huge_buf_sz = sizeof(huge_buf); if (get_server_value(private_data-lpEcb, - ALL_HTTP, huge_buf, huge_buf_sz, )) { + ALL_HTTP, huge_buf, huge_buf_sz)) { unsigned int cnt = 0; char *tmp; @@ -1512,18 +1510,16 @@ } static int get_server_value(LPEXTENSION_CONTROL_BLOCK lpEcb, -char *name, char *buf, DWORD bufsz, char *def_val) +char *name, char *buf, DWORD bufsz) { -if (!lpEcb-GetServerVariable(lpEcb-ConnID, - name, buf, (LPDWORD) bufsz)) { -strcpy(buf, def_val); +DWORD sz = bufsz; +buf[0] = '\0'; +if (!lpEcb-GetServerVariable(lpEcb-ConnID, name, + buf, (LPDWORD) sz)) return JK_FALSE; -} - -if (bufsz 0) { -buf[bufsz - 1] = '\0'; -} +if (sz = bufsz) +buf[sz-1] = '\0'; return JK_TRUE; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/25 02:54:26 Modified:jk/native/iis jk_isapi_plugin.c Log: Calculate reason string if not provided to be HTTP rfc compliant. Revision ChangesPath 1.44 +57 -2 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- jk_isapi_plugin.c 25 Feb 2005 10:20:06 - 1.43 +++ jk_isapi_plugin.c 25 Feb 2005 10:54:26 - 1.44 @@ -331,6 +331,61 @@ return where; } +static char *status_reason(int status) +{ +static struct reasons { +int status; +char *reason; +} *r, reasons[] = { +{ 100, Continue }, +{ 101, Switching Protocols }, +{ 200, OK }, +{ 201, Created }, +{ 202, Accepted }, +{ 203, Non-Authoritative Information }, +{ 204, No Content }, +{ 205, Reset Content }, +{ 206, Partial Content }, +{ 300, Multiple Choices }, +{ 301, Moved Permanently }, +{ 302, Moved Temporarily }, +{ 303, See Other }, +{ 304, Not Modified }, +{ 305, Use Proxy }, +{ 400, Bad Request }, +{ 401, Unauthorized }, +{ 402, Payment Required }, +{ 403, Forbidden }, +{ 404, Not Found }, +{ 405, Method Not Allowed }, +{ 406, Not Acceptable }, +{ 407, Proxy Authentication Required }, +{ 408, Request Timeout }, +{ 409, Conflict }, +{ 410, Gone }, +{ 411, Length Required }, +{ 412, Precondition Failed }, +{ 413, Request Entity Too Large }, +{ 414, Request-URI Too Long }, +{ 415, Unsupported Media Type }, +{ 500, Internal Server Error }, +{ 501, Not Implemented }, +{ 502, Bad Gateway }, +{ 503, Service Unavailable }, +{ 504, Gateway Timeout }, +{ 505, HTTP Version Not Supported }, +{ 000, NULL} +}; + +r = reasons; +while (r-status = status) +if (r-status == status) +return r-reason; +else +r++; +return No Reason; +} + static int escape_url(const char *path, char *dest, int destsize) { const BYTE *s = (const BYTE *)path; @@ -433,7 +488,7 @@ * Create the status line */ if (!reason) { -reason = ; +reason = status_reason(status); } status_str = (char *)_alloca((6 + strlen(reason)) * sizeof(char)); sprintf(status_str, %d %s, status, reason); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/21 01:29:34 Modified:jk/native/iis jk_isapi_plugin.c Log: Update isapi redirector to accept new dynamic uri mappigs. Revision ChangesPath 1.41 +9 -40 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- jk_isapi_plugin.c 17 Feb 2005 15:03:15 - 1.40 +++ jk_isapi_plugin.c 21 Feb 2005 09:29:34 - 1.41 @@ -134,7 +134,7 @@ static char log_file[MAX_PATH * 2]; static int log_level = JK_LOG_EMERG_LEVEL; static char worker_file[MAX_PATH * 2]; -static char worker_mount_file[MAX_PATH * 2]; +static char worker_mount_file[MAX_PATH * 2] = {0}; #define URI_SELECT_OPT_PARSED 0 #define URI_SELECT_OPT_UNPARSED 1 @@ -1055,47 +1055,16 @@ worker_mount_file); jk_log(logger, JK_LOG_DEBUG, Using uri select %d., uri_select_option); } -if (jk_map_alloc(map)) { -if (jk_map_read_properties(map, worker_mount_file)) { -/* remove non-mapping entries (assume they were string substitutions) */ -jk_map_t *map2; -if (jk_map_alloc(map2)) { -int sz, i; -void *old; - -sz = jk_map_size(map); -for (i = 0; i sz; i++) { -const char *name = jk_map_name_at(map, i); -if (*name == '/' || *name == '!') { -jk_map_put(map2, name, jk_map_value_at(map, i), old); -} -else { -if (JK_IS_DEBUG_LEVEL(logger)) -jk_log(logger, JK_LOG_DEBUG, - Ignoring worker mount file entry %s=%s., - name, jk_map_value_at(map, i)); -} -} - -if (uri_worker_map_alloc(uw_map, map2, logger)) { -rc = JK_TRUE; -} - -jk_map_free(map2); -} -} -else { -jk_log(logger, JK_LOG_EMERG, - Unable to read worker mount file %s., - worker_mount_file); -} -jk_map_free(map); +if (uri_worker_map_alloc(uw_map, NULL, logger)) { +rc = JK_FALSE; +uw_map-fname = worker_mount_file; +if (worker_mount_file[0]) +rc = uri_worker_map_load(uw_map, logger); } - if (rc) { rc = JK_FALSE; if (jk_map_alloc(map)) { -if (jk_map_read_properties(map, worker_file)) { +if (jk_map_read_properties(map, worker_file, NULL)) { /* we add the URI-WORKER MAP since workers using AJP14 will feed it */ worker_env.uri_to_worker = uw_map; @@ -1152,7 +1121,7 @@ jk_map_t *map; if (jk_map_alloc(map)) { -if (jk_map_read_properties(map, ini_file_name)) { +if (jk_map_read_properties(map, ini_file_name, NULL)) { using_ini_file = JK_TRUE; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/16 07:09:21 Modified:jk/native/apache-1.3 mod_jk.c jk/native/apache-2.0 mod_jk.c jk/native/common jk_ajp12_worker.c jk_ajp_common.c jk_global.h jk_lb_worker.c jk_service.h jk/native/iis jk_isapi_plugin.c Log: Change the way how is_recoverable is handled. Instead this which was never used, use that value to return the specific http error code, namely 500 or 503. Revision ChangesPath 1.69 +5 -5 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v retrieving revision 1.68 retrieving revision 1.69 diff -u -r1.68 -r1.69 --- mod_jk.c 15 Feb 2005 07:30:49 - 1.68 +++ mod_jk.c 16 Feb 2005 15:09:20 - 1.69 @@ -1637,6 +1637,7 @@ struct timeval tv_begin, tv_end; #endif int rc = JK_FALSE; +int is_error = JK_HTTP_SERVER_ERROR; apache_private_data_t private_data; jk_ws_service_t s; jk_pool_atom_t buf[SMALL_POOL_SIZE]; @@ -1661,8 +1662,7 @@ if (init_ws_service(private_data, s, conf)) { jk_endpoint_t *end = NULL; if (worker-get_endpoint(worker, end, l)) { -int is_recoverable_error = JK_FALSE; -rc = end-service(end, s, l, is_recoverable_error); +rc = end-service(end, s, l, is_error); if (s.content_read s.content_length || (s.is_chunked !s.no_more_chunks)) { @@ -1705,7 +1705,7 @@ for worker=%s, worker_name); JK_TRACE_EXIT(l); -return HTTP_INTERNAL_SERVER_ERROR; +return is_error; } jk_close_pool(private_data.p); @@ -1739,7 +1739,7 @@ for worker=%s, rc, worker_name); JK_TRACE_EXIT(l); -return HTTP_INTERNAL_SERVER_ERROR; +return is_error; } } else { 1.126 +5 -5 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v retrieving revision 1.125 retrieving revision 1.126 diff -u -r1.125 -r1.126 --- mod_jk.c 15 Feb 2005 07:30:49 - 1.125 +++ mod_jk.c 16 Feb 2005 15:09:20 - 1.126 @@ -86,8 +86,8 @@ #define __sys_timeval_h__ #endif -#include jk_ajp13.h #include jk_global.h +#include jk_ajp13.h #include jk_logger.h #include jk_map.h #include jk_pool.h @@ -1797,6 +1797,7 @@ #ifndef NO_GETTIMEOFDAY struct timeval tv_begin, tv_end; #endif +int is_error = HTTP_INTERNAL_SERVER_ERROR; int rc = JK_FALSE; apache_private_data_t private_data; jk_ws_service_t s; @@ -1829,9 +1830,8 @@ /* worker-get_endpoint might fail if we are out of memory so check */ /* and handle it */ if (worker-get_endpoint(worker, end, xconf-log)) { -int is_recoverable_error = JK_FALSE; rc = end-service(end, s, xconf-log, - is_recoverable_error); + is_error); if (s.content_read s.content_length || (s.is_chunked !s.no_more_chunks)) { @@ -1915,7 +1915,7 @@ for worker=%s, rc, worker_name); JK_TRACE_EXIT(xconf-log); -return HTTP_INTERNAL_SERVER_ERROR; +return is_error; } } else { 1.24 +5 -5 jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c Index: jk_ajp12_worker.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- jk_ajp12_worker.c 16 Feb 2005 08:15:56 - 1.23 +++ jk_ajp12_worker.c 16 Feb 2005 15:09:20 - 1.24 @@ -85,15 +85,15 @@ static int JK_METHOD service(jk_endpoint_t *e, jk_ws_service_t *s, - jk_logger_t *l, int *is_recoverable_error) + jk_logger_t *l, int *is_error) { jk_log(l, JK_LOG_DEBUG, Into jk_endpoint_t::service); -if (e
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/13 04:26:24 Modified:jk/native/iis jk_isapi_plugin.c Log: Implement new API calls for shm and set vhost uriworker_map Revision ChangesPath 1.38 +5 -5 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- jk_isapi_plugin.c 12 Feb 2005 11:55:34 - 1.37 +++ jk_isapi_plugin.c 13 Feb 2005 12:26:24 - 1.38 @@ -1028,12 +1028,12 @@ int rc = JK_FALSE; jk_map_t *map; - /* Simulate shared memory */ - jk_shm_open(NULL); - if (!jk_open_file_logger(logger, log_file, log_level)) { logger = NULL; } + /* Simulate shared memory */ + jk_shm_open(NULL, logger); + /* Logging the initialization type: registry or properties file in virtual dir */ if (JK_IS_DEBUG_LEVEL(logger)) { @@ -1338,7 +1338,7 @@ s-headers_names = NULL; s-headers_values = NULL; s-num_headers = 0; - +s-uw_map = uw_map; /* * Add SSL IIS environment */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/12 03:55:34 Modified:jk/native/apache-1.3 mod_jk.c jk/native/apache-2.0 mod_jk.c jk/native/common jk_service.h jk_uri_worker_map.c jk_uri_worker_map.h jk/native/iis jk_isapi_plugin.c Log: Resolve constness for uri_worker_map. The worker is const per request. Revision ChangesPath 1.64 +2 -2 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- mod_jk.c 6 Feb 2005 13:30:34 - 1.63 +++ mod_jk.c 12 Feb 2005 11:55:33 - 1.64 @@ -1926,7 +1926,7 @@ if (conf) { jk_logger_t *l = conf-log ? conf-log : main_log; -char *worker = map_uri_to_worker(conf-uw_map, r-uri, l); +const char *worker = map_uri_to_worker(conf-uw_map, r-uri, l); /* Don't know the worker, ForwardDirectories is set, there is a * previous request for which the handler is JK_HANDLER (as set by 1.123 +3 -3 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v retrieving revision 1.122 retrieving revision 1.123 diff -u -r1.122 -r1.123 --- mod_jk.c 9 Feb 2005 07:39:08 - 1.122 +++ mod_jk.c 12 Feb 2005 11:55:33 - 1.123 @@ -2376,7 +2376,7 @@ jk_module); if (conf) { -char *worker; +const char *worker; char *uri; if ((r-handler != NULL) (!strcmp(r-handler, JK_HANDLER))) { /* Somebody already set the handler, probably manual config @@ -2556,7 +2556,7 @@ jk_module); if (conf) { -char *worker; +const char *worker; char *uri; if ((r-handler != NULL) (!strcmp(r-handler, JK_HANDLER))) { /* Somebody already set the handler, probably manual config 1.23 +2 -2 jakarta-tomcat-connectors/jk/native/common/jk_service.h Index: jk_service.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_service.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- jk_service.h 12 Feb 2005 11:33:59 - 1.22 +++ jk_service.h 12 Feb 2005 11:55:33 - 1.23 @@ -123,7 +123,7 @@ */ const char *method; const char *protocol; -const char *req_uri; +char *req_uri; const char *remote_addr; const char *remote_host; const char *remote_user; 1.44 +6 -8 jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c Index: jk_uri_worker_map.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- jk_uri_worker_map.c 6 Feb 2005 13:30:34 - 1.43 +++ jk_uri_worker_map.c 12 Feb 2005 11:55:33 - 1.44 @@ -49,7 +49,7 @@ char *uri; /* Name of worker mapped */ -char *worker_name; +const char *worker_name; /* Suffix of uri */ char *suffix; @@ -569,7 +569,6 @@ continue; if (uwr-match_type == MATCH_TYPE_WILDCHAR_PATH) { -char *wname; /* Map is already sorted by ctxt_len */ if (wildchar_match(uri, uwr-context, #ifdef WIN32 @@ -578,7 +577,6 @@ 0 #endif ) == 0) { -wname = uwr-worker_name; jk_log(l, JK_LOG_DEBUG, Found a wildchar no match %s - %s, uwr-worker_name, uwr-context); @@ -661,15 +659,15 @@ } -char *map_uri_to_worker(jk_uri_worker_map_t *uw_map, -char *uri, jk_logger_t *l) +const char *map_uri_to_worker(jk_uri_worker_map_t *uw_map, + char *uri, jk_logger_t *l) { unsigned int i; int best_match = -1; unsigned int longest_match = 0; char *url_rewrite; char rewrite_char = ';'; -char *rv = NULL; +const char *rv = NULL; JK_TRACE_ENTER(l); if (!uw_map || !uri) { @@ -721,7 +719,7 @@
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2005/02/06 05:30:35 Modified:jk/native/apache-1.3 mod_jk.c jk/native/apache-2.0 mod_jk.c jk/native/common jk_ajp12_worker.c jk_ajp14_worker.c jk_ajp_common.c jk_ajp_common.h jk_connect.c jk_connect.h jk_lb_worker.c jk_map.c jk_map.h jk_service.h jk_uri_worker_map.c jk_uri_worker_map.h jk_util.c jk_util.h jk_worker.c jk/native/iis jk_isapi_plugin.c Log: Change all property_get calls to 'const char *'. Revision ChangesPath 1.63 +2 -2 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- mod_jk.c 6 Feb 2005 09:37:59 - 1.62 +++ mod_jk.c 6 Feb 2005 13:30:34 - 1.63 @@ -1781,7 +1781,7 @@ int sz = jk_map_size(src); int i; for (i = 0; i sz; i++) { -char *name = jk_map_name_at(src, i); +const char *name = jk_map_name_at(src, i); if (jk_map_get(src, name, NULL) == NULL) { if (!jk_map_put (dst, name, ap_pstrdup(p, jk_map_get_string(src, name, NULL)), 1.120 +1 -1 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -r1.119 -r1.120 --- mod_jk.c 6 Feb 2005 11:30:46 - 1.119 +++ mod_jk.c 6 Feb 2005 13:30:34 - 1.120 @@ -2039,7 +2039,7 @@ int sz = jk_map_size(src); int i; for (i = 0; i sz; i++) { -char *name = jk_map_name_at(src, i); +const char *name = jk_map_name_at(src, i); if (jk_map_get(src, name, NULL) == NULL) { if (!jk_map_put(dst, name, apr_pstrdup(p, jk_map_get_string(src, name, NULL)), 1.18 +2 -2 jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c Index: jk_ajp12_worker.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- jk_ajp12_worker.c 6 Feb 2005 09:37:59 - 1.17 +++ jk_ajp12_worker.c 6 Feb 2005 13:30:34 - 1.18 @@ -161,7 +161,7 @@ p-name, AJP_DEF_PORT); -char *host = jk_get_worker_host(props, +const char *host = jk_get_worker_host(props, p-name, AJP_DEF_HOST); 1.26 +2 -2 jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c Index: jk_ajp14_worker.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp14_worker.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- jk_ajp14_worker.c 6 Feb 2005 09:37:59 - 1.25 +++ jk_ajp14_worker.c 6 Feb 2005 13:30:34 - 1.26 @@ -257,7 +257,7 @@ jk_worker_env_t *we, jk_logger_t *l) { ajp_worker_t *aw; -char *secret_key; +const char *secret_key; JK_TRACE_ENTER(l); if (ajp_validate(pThis, props, we, l, AJP14_PROTO) == JK_FALSE) { 1.74 +2 -4 jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c Index: jk_ajp_common.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- jk_ajp_common.c 6 Feb 2005 09:37:59 - 1.73 +++ jk_ajp_common.c 6 Feb 2005 13:30:34 - 1.74 @@ -1693,7 +1693,7 @@ jk_worker_env_t *we, jk_logger_t *l, int proto) { int port; -char *host; +const char *host; JK_TRACE_ENTER(l); @@ -1882,8 +1882,6 @@ if (pThis *pThis (*pThis)-worker_private) { ajp_worker_t *aw = (*pThis)-worker_private; -free(aw-name); - if (JK_IS_DEBUG_LEVEL(l)) jk_log(l, JK_LOG_DEBUG, up to %d endpoint to close, 1.28 +3 -3 jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.h Index: jk_ajp_common.h === RCS file:
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2004/12/14 12:17:05 Modified:jk/native/iis jk_isapi_plugin.c Log: Use stristr function instead converting the string to lowercase. Revision ChangesPath 1.32 +24 -13jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- jk_isapi_plugin.c 14 Dec 2004 19:19:04 - 1.31 +++ jk_isapi_plugin.c 14 Dec 2004 20:17:05 - 1.32 @@ -343,22 +343,33 @@ return JK_TRUE; } -static int uri_is_web_inf(const char *uri) +/* + * Find the first occurrence of find in s. + */ +static char *stristr(const char *s, const char *find) { -char b[INTERNET_MAX_URL_LENGTH + 1]; -int i = 0; + char c, sc; + size_t len; -while (*uri) { -b[i++] = JK_TOLOWER(*uri); -uri++; -if (i (INTERNET_MAX_URL_LENGTH - 1)) -break; -} -b[i] = '\0'; -if (strstr(b, web-inf)) { + if ((c = tolower((unsigned char)(*find++))) != 0) { + len = strlen(find); + do { + do { + if ((sc = tolower((unsigned char)(*s++))) == 0) + return (NULL); + } while (sc != c); + } while (strnicmp(s, find, len) != 0); + s--; + } + return ((char *)s); +} + +static int uri_is_web_inf(const char *uri) +{ +if (stristr(uri, web-inf)) { return JK_TRUE; } -if (strstr(b, meta-inf)) { +if (stristr(uri, meta-inf)) { return JK_TRUE; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2004/12/14 23:23:03 Modified:jk/native/iis jk_isapi_plugin.c Log: Copy/paste error messages from JK2 Revision ChangesPath 1.33 +22 -8 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- jk_isapi_plugin.c 14 Dec 2004 20:17:05 - 1.32 +++ jk_isapi_plugin.c 15 Dec 2004 07:23:03 - 1.33 @@ -72,6 +72,19 @@ #define BAD_PATH-2 #define MAX_SERVERNAME 128 +#define HTML_ERROR_400 !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\ \ +HTMLHEADTITLEBad request!/TITLE/HEAD\ +BODYH1Bad request!/H1DLDD\n \ +Your browser (or proxy) sent a request that \ +this server could not understand./DL/DD/BODY/HTML + +#define HTML_ERROR_403 !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\ \ +HTMLHEADTITLEAccess forbidden!!/TITLE/HEAD \ +BODYH1Access forbidden!/H1DLDD\n \ +You don't have permission to access the requested object. \ +It is either read-protected or not readable by the server./DL/DD/BODY/HTML + + #define JK_TOLOWER(x) ((char)tolower((BYTE)(x))) #define GET_SERVER_VARIABLE_VALUE(name, place) \ @@ -379,13 +392,14 @@ static void write_error_response(PHTTP_FILTER_CONTEXT pfc, char *status, char *msg) { -size_t len = strlen(msg); +DWORD len = (DWORD)strlen(msg); /* reject !!! */ +pfc-AddResponseHeaders(pfc, CONTENT_TYPE, 0); pfc-ServerSupportFunction(pfc, SF_REQ_SEND_RESPONSE_HEADER, - status, (DWORD) CONTENT_TYPE, 0); -pfc-WriteClient(pfc, msg, (LPDWORD)len, 0); + status, 0, 0); +pfc-WriteClient(pfc, msg, len, 0); } @@ -701,7 +715,7 @@ [%s] contains one or more invalid escape sequences.\n, uri); write_error_response(pfc, 400 Bad Request, - HTMLBODYH1Request contains invalid encoding/H1/BODY/HTML); + HTML_ERROR_400); return SF_STATUS_REQ_FINISHED; } else if (rc == BAD_PATH) { @@ -709,7 +723,7 @@ [%s] contains forbidden escape sequences.\n, uri); write_error_response(pfc, 403 Forbidden, - HTMLBODYH1Access is Forbidden/H1/BODY/HTML); + HTML_ERROR_403); return SF_STATUS_REQ_FINISHED; } getparents(uri); @@ -761,7 +775,7 @@ uri); write_error_response(pfc, 403 Forbidden, - HTMLBODYH1Access is Forbidden/H1/BODY/HTML); + HTML_ERROR_403); return SF_STATUS_REQ_FINISHED; } @@ -791,7 +805,7 @@ [%s] re-encoding request exceeds maximum buffer size.\n, uri); write_error_response(pfc, 400 Bad Request, - HTMLBODYH1Request contains too many characters that need to be encoded./H1/BODY/HTML); + HTML_ERROR_400); return SF_STATUS_REQ_FINISHED; } jk_log(logger, JK_LOG_DEBUG, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2004/12/14 11:19:04 Modified:jk/native/iis jk_isapi_plugin.c Log: Fix bug #32696 caused by changing url to lowercase. Also move checking for web-inf on earlier stage. Revision ChangesPath 1.31 +30 -26jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- jk_isapi_plugin.c 30 Nov 2004 08:39:44 - 1.30 +++ jk_isapi_plugin.c 14 Dec 2004 19:19:04 - 1.31 @@ -343,17 +343,22 @@ return JK_TRUE; } -static int uri_is_web_inf(char *uri) +static int uri_is_web_inf(const char *uri) { -char *c = uri; -while (*c) { -*c = JK_TOLOWER(*c); -c++; +char b[INTERNET_MAX_URL_LENGTH + 1]; +int i = 0; + +while (*uri) { +b[i++] = JK_TOLOWER(*uri); +uri++; +if (i (INTERNET_MAX_URL_LENGTH - 1)) +break; } -if (strstr(uri, web-inf)) { +b[i] = '\0'; +if (strstr(b, web-inf)) { return JK_TRUE; } -if (strstr(uri, meta-inf)) { +if (strstr(b, meta-inf)) { return JK_TRUE; } @@ -731,6 +736,23 @@ uri); worker = map_uri_to_worker(uw_map, uri, logger); } +/* + * Check if somebody is feading us with his own TOMCAT data headers. + * We reject such postings ! + */ +jk_log(logger, JK_LOG_DEBUG, + check if [%s] is points to the web-inf directory\n, + uri); + +if (uri_is_web_inf(uri)) { +jk_log(logger, JK_LOG_EMERG, + [%s] points to the web-inf or meta-inf directory.\nSomebody try to hack into the site!!!\n, + uri); + +write_error_response(pfc, 403 Forbidden, + HTMLBODYH1Access is Forbidden/H1/BODY/HTML); +return SF_STATUS_REQ_FINISHED; +} if (worker) { char *forwardURI; @@ -800,24 +822,6 @@ else { jk_log(logger, JK_LOG_DEBUG, [%s] is not a servlet url\n, uri); -} - -/* - * Check if somebody is feading us with his own TOMCAT data headers. - * We reject such postings ! - */ -jk_log(logger, JK_LOG_DEBUG, - check if [%s] is points to the web-inf directory\n, - uri); - -if (uri_is_web_inf(uri)) { -jk_log(logger, JK_LOG_EMERG, - [%s] points to the web-inf or meta-inf directory.\nSomebody try to hack into the site!!!\n, - uri); - -write_error_response(pfc, 403 Forbidden, - HTMLBODYH1Access is Forbidden/H1/BODY/HTML); -return SF_STATUS_REQ_FINISHED; } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2004/11/30 00:39:44 Modified:jk/native/iis jk_isapi_plugin.c Log: Allow no mount for IIS. The url has to start with exclamation (!) for nomount context. Revision ChangesPath 1.30 +2 -2 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- jk_isapi_plugin.c 12 Nov 2004 18:45:24 - 1.29 +++ jk_isapi_plugin.c 30 Nov 2004 08:39:44 - 1.30 @@ -1022,7 +1022,7 @@ sz = jk_map_size(map); for (i = 0; i sz; i++) { char *name = jk_map_name_at(map, i); -if ('/' == *name) { +if (*name == '/' || *name == '!') { jk_map_put(map2, name, jk_map_value_at(map, i), old); } else { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2004/11/12 03:56:18 Modified:jk/native/iis jk_isapi_plugin.c Log: Use new trace macros and native types where possible. Clean up log messages. Revision ChangesPath 1.28 +67 -64jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- jk_isapi_plugin.c 9 Nov 2004 12:17:44 - 1.27 +++ jk_isapi_plugin.c 12 Nov 2004 11:56:18 - 1.28 @@ -19,7 +19,8 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision$ * + * Author: Mladen Turk [EMAIL PROTECTED] * + * Version: $Revision$ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -71,7 +72,7 @@ #define BAD_PATH-2 #define MAX_SERVERNAME 128 -#define JK_TOLOWER(x) ((char)tolower((unsigned char)(x))) +#define JK_TOLOWER(x) ((char)tolower((BYTE)(x))) #define GET_SERVER_VARIABLE_VALUE(name, place) \ do { \ @@ -112,7 +113,7 @@ static jk_logger_t *logger = NULL; static char *SERVER_NAME = SERVER_NAME; static char *SERVER_SOFTWARE = SERVER_SOFTWARE; - +static char *CONTENT_TYPE = Content-Type:text/html\r\n\r\n; static char extension_uri[INTERNET_MAX_URL_LENGTH] = /jakarta/isapi_redirect.dll; @@ -135,7 +136,7 @@ jk_pool_t p; int request_started; -unsigned bytes_read_so_far; +unsigned int bytes_read_so_far; LPEXTENSION_CONTROL_BLOCK lpEcb; }; @@ -145,12 +146,12 @@ const char *reason, const char *const *header_names, const char *const *header_values, -unsigned num_of_headers); +unsigned int num_of_headers); static int JK_METHOD read(jk_ws_service_t *s, - void *b, unsigned l, unsigned *a); + void *b, unsigned int l, unsigned int *a); -static int JK_METHOD write(jk_ws_service_t *s, const void *b, unsigned l); +static int JK_METHOD write(jk_ws_service_t *s, const void *b, unsigned int l); static int init_ws_service(isapi_private_data_t * private_data, jk_ws_service_t *s, char **worker_name); @@ -257,7 +258,7 @@ else l = 0; n = l; -while ((name[n] = name[m])) { +while ((name[n] = name[m]) != '\0') { n++; m++; } @@ -287,7 +288,7 @@ #define T_OS_ESCAPE_PATH(4) -static const unsigned char test_char_table[256] = { +static const BYTE test_char_table[256] = { 0, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 0, 7, 6, 1, 6, 1, 1, 9, 9, 1, 0, 8, 0, 0, 10, @@ -306,11 +307,11 @@ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }; -#define TEST_CHAR(c, f) (test_char_table[(unsigned)(c)] (f)) +#define TEST_CHAR(c, f) (test_char_table[(unsigned int)(c)] (f)) static const char c2x_table[] = 0123456789abcdef; -static unsigned char *c2x(unsigned what, unsigned char *where) +static BYTE *c2x(unsigned int what, BYTE *where) { *where++ = '%'; *where++ = c2x_table[what 4]; @@ -320,10 +321,10 @@ static int escape_url(const char *path, char *dest, int destsize) { -const unsigned char *s = (const unsigned char *)path; -unsigned char *d = (unsigned char *)dest; -unsigned char *e = d + destsize - 1; -unsigned char *ee = d + destsize - 3; +const BYTE *s = (const BYTE *)path; +BYTE *d = (BYTE *)dest; +BYTE *e = d + destsize - 1; +BYTE *ee = d + destsize - 3; while (*s) { if (TEST_CHAR(*s, T_OS_ESCAPE_PATH)) { @@ -362,15 +363,12 @@ static void write_error_response(PHTTP_FILTER_CONTEXT pfc, char *status, char *msg) { -char ctype[30]; size_t len = strlen(msg); -strcpy(ctype, Content-Type:text/html\r\n\r\n); - /* reject !!! */ pfc-ServerSupportFunction(pfc,
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2004/11/12 10:45:24 Modified:jk/native/apache-1.3 mod_jk.c jk/native/apache-2.0 mod_jk.c jk/native/common jk_ajp_common.c jk_service.h jk_util.c jk_util.h jk/native/iis jk_isapi_plugin.c Log: Added custom 'retries' for worker, so we don't depend on default setting. If set to a number grater then 3, it will sleep for 100ms on retry greater then 3 and then try again. Revision ChangesPath 1.52 +3 -1 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- mod_jk.c 12 Nov 2004 08:42:47 - 1.51 +++ mod_jk.c 12 Nov 2004 18:45:24 - 1.52 @@ -1554,6 +1554,8 @@ jk_init_ws_service(s); +/* Update retries for this worker */ +s.retries = worker-retries; s.ws_private = private_data; s.pool = private_data.p; #ifndef NO_GETTIMEOFDAY 1.101 +5 -2 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v retrieving revision 1.100 retrieving revision 1.101 diff -u -r1.100 -r1.101 --- mod_jk.c 12 Nov 2004 09:02:04 - 1.100 +++ mod_jk.c 12 Nov 2004 18:45:24 - 1.101 @@ -1732,7 +1732,9 @@ } if (worker) { +#ifndef NO_GETTIMEOFDAY struct timeval tv_begin, tv_end; +#endif int rc = JK_FALSE; apache_private_data_t private_data; jk_ws_service_t s; @@ -1744,7 +1746,8 @@ private_data.r = r; jk_init_ws_service(s); - +/* Update retries for this worker */ +s.retries = worker-retries; s.ws_private = private_data; s.pool = private_data.p; #ifndef NO_GETTIMEOFDAY 1.63 +39 -5 jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c Index: jk_ajp_common.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- jk_ajp_common.c 12 Nov 2004 12:47:37 - 1.62 +++ jk_ajp_common.c 12 Nov 2004 18:45:24 - 1.63 @@ -35,6 +35,24 @@ #include novsock2.h #endif +/* Sleep for 100ms */ +static void jk_sleep_def() +{ +#ifdef OS2 +DosSleep(100); +#elif defined(BEOS) +snooze(100 * 1000); +#elif defined(NETWARE) +delay(100); +#elif defined(WIN32) +Sleep(100); +#else +struct timeval tv; +tv.tv_usec = 100 * 1000; +tv.tv_sec = 0; +select(0, NULL, NULL, NULL, tv); +#endif +} const char *response_trans_headers[] = { Content-Type, @@ -1442,8 +1460,6 @@ return JK_FALSE; } -#define JK_RETRIES 3 - /* * service is now splitted in ajp_send_request and ajp_get_reply * much more easier to do errors recovery @@ -1497,7 +1513,7 @@ * JK_RETRIES could be replaced by the number of workers in * a load-balancing configuration */ -for (i = 0; i JK_RETRIES; i++) { +for (i = 0; i s-retries; i++) { /* * We're using reqmsg which hold initial request * if Tomcat is stopped or restarted, we will pass reqmsg @@ -1546,6 +1562,10 @@ jk_log(l, JK_LOG_INFO, Receiving from tomcat failed, recoverable operation attempt=%d\n, i); +/* Check for custom retries */ +if (i = JK_RETRIES) { +jk_sleep_def(); +} } } @@ -1562,8 +1582,8 @@ } else { jk_log(l, JK_LOG_INFO, - sending request to tomcat failed in send loop. - retry=%d\n, i); + Sending request to tomcat failed, + recoverable operation attempt=%d\n, i); } } @@ -1728,6 +1748,20 @@ setting recovery opts to %d\n, p-recovery_opts); +pThis-retries = +jk_get_worker_retries(props, p-name, + JK_RETRIES); +if (pThis-retries 1) { +jk_log(l, JK_LOG_INFO, + number of retries must be grater then 1.
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
mturk 2004/10/08 03:37:12 Modified:jk/native/iis jk_isapi_plugin.c Log: Remove computing properties file on each dll event. Fix reporting error page to client, and few compile time warnigs. Revision ChangesPath 1.25 +43 -38jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- jk_isapi_plugin.c 8 Oct 2004 08:55:13 - 1.24 +++ jk_isapi_plugin.c 8 Oct 2004 10:37:12 - 1.25 @@ -71,6 +71,7 @@ #define BAD_PATH-2 #define MAX_SERVERNAME 128 +#define JK_TOLOWER(x) ((char)tolower((unsigned char)(x))) #define GET_SERVER_VARIABLE_VALUE(name, place) \ do { \ @@ -128,7 +129,8 @@ static jk_worker_env_t worker_env; -struct isapi_private_data +typedef struct isapi_private_data_t isapi_private_data_t; +struct isapi_private_data_t { jk_pool_t p; @@ -136,7 +138,6 @@ unsigned bytes_read_so_far; LPEXTENSION_CONTROL_BLOCK lpEcb; }; -typedef struct isapi_private_data isapi_private_data_t; static int JK_METHOD start_response(jk_ws_service_t *s, @@ -171,7 +172,7 @@ static int base64_encode_cert_len(int len); static int base64_encode_cert(char *encoded, - const unsigned char *string, int len); + const char *string, int len); static char x2c(const char *what) @@ -256,8 +257,10 @@ else l = 0; n = l; -while ((name[n] = name[m])) -(++n, ++m); +while ((name[n] = name[m])) { +n++; +m++; +} } else ++l; @@ -319,20 +322,19 @@ { const unsigned char *s = (const unsigned char *)path; unsigned char *d = (unsigned char *)dest; -unsigned char *e = dest + destsize - 1; -unsigned char *ee = dest + destsize - 3; -unsigned c; +unsigned char *e = d + destsize - 1; +unsigned char *ee = d + destsize - 3; -while ((c = *s)) { -if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) { +while (*s) { +if (TEST_CHAR(*s, T_OS_ESCAPE_PATH)) { if (d = ee) return JK_FALSE; -d = c2x(c, d); +d = c2x(*s, d); } else { if (d = e) return JK_FALSE; -*d++ = c; +*d++ = *s; } ++s; } @@ -344,7 +346,7 @@ { char *c = uri; while (*c) { -*c = tolower(*c); +*c = JK_TOLOWER(*c); c++; } if (strstr(uri, web-inf)) { @@ -360,17 +362,16 @@ static void write_error_response(PHTTP_FILTER_CONTEXT pfc, char *status, char *msg) { -char crlf[3] = { (char)13, (char)10, '\0' }; char ctype[30]; -DWORD len = strlen(msg); +size_t len = strlen(msg); -sprintf(ctype, Content-Type:text/html%s%s, crlf, crlf); +strcpy(ctype, Content-Type:text/html\r\n\r\n); /* reject !!! */ pfc-ServerSupportFunction(pfc, SF_REQ_SEND_RESPONSE_HEADER, - status, (DWORD) crlf, (DWORD) ctype); -pfc-WriteClient(pfc, msg, len, 0); + status, (DWORD) ctype[0], 0); +pfc-WriteClient(pfc, msg, (LPDWORD)len, 0); } @@ -395,7 +396,7 @@ if (s s-ws_private) { isapi_private_data_t *p = s-ws_private; if (!p-request_started) { -DWORD len_of_status; +size_t len_of_status; char *status_str; char *headers_str; @@ -415,8 +416,7 @@ * Create response headers string */ if (num_of_headers) { -unsigned i; -unsigned len_of_headers; +size_t i, len_of_headers; for (i = 0, len_of_headers = 0; i num_of_headers; i++) { len_of_headers += strlen(header_names[i]); len_of_headers += strlen(header_values[i]); @@ -442,7 +442,7 @@ if (!p-lpEcb-ServerSupportFunction(p-lpEcb-ConnID, HSE_REQ_SEND_RESPONSE_HEADER, status_str, - (LPDWORD) len_of_status, + (LPDWORD) len_of_status,
Re: cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
[EMAIL PROTECTED] wrote: billbarker2004/07/21 22:46:13 Modified:jk/native/iis jk_isapi_plugin.c Log: Fix broken mapping parsing. The patch looks safe enough, since nobody should care that we modify the uri. Submitted By: Jess Holle [EMAIL PROTECTED] Revision ChangesPath 1.23 +4 -5 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Could I consider the jk 1.2.6 ready for release of should we delay it a bit ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
Henri Gomez wrote: Could I consider the jk 1.2.6 ready for release of should we delay it a bit ? No release please. There is a bug in jk_global.h so you cannot compile on WIN32. It's couple of days ago that jean-frederic introduced protable.h, that is nonexistent on WIN32 builds. Here is a quick fix: #ifndef WIN32 #include portable.h #else #define HAVE_VSNPRINTF #define HAVE_SNPRINTF #endif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature
Re: cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
Mladen Turk wrote: Henri Gomez wrote: Could I consider the jk 1.2.6 ready for release of should we delay it a bit ? No release please. There is a bug in jk_global.h so you cannot compile on WIN32. It's couple of days ago that jean-frederic introduced protable.h, that is nonexistent on WIN32 builds. Here is a quick fix: #ifndef WIN32 #include portable.h #else #define HAVE_VSNPRINTF #define HAVE_SNPRINTF #endif I commit ASAP Mladen, while I'm making huge ab against Apache2, Tomcat 3.3.2 (Coyote), jk and mod_proxy. Some interesting results to come :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
billbarker2004/07/21 22:46:13 Modified:jk/native/iis jk_isapi_plugin.c Log: Fix broken mapping parsing. The patch looks safe enough, since nobody should care that we modify the uri. Submitted By: Jess Holle [EMAIL PROTECTED] Revision ChangesPath 1.23 +4 -5 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- jk_isapi_plugin.c 24 Feb 2004 08:45:50 - 1.22 +++ jk_isapi_plugin.c 22 Jul 2004 05:46:13 - 1.23 @@ -718,14 +718,13 @@ jk_log(logger, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s\n, snuri); -} else { - strncpy(snuri, uri, sizeof(snuri)); - } +worker = map_uri_to_worker(uw_map, snuri, logger); +} if (!worker) { jk_log(logger, JK_LOG_DEBUG, In HttpFilterProc test Default redirection of %s\n, uri); -worker = map_uri_to_worker(uw_map, snuri, logger); +worker = map_uri_to_worker(uw_map, uri, logger); } if (worker) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
hgomez 2004/02/11 01:52:03 Modified:jk/native/iis jk_isapi_plugin.c Log: Initalize the reco status Revision ChangesPath 1.21 +4 -1 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- jk_isapi_plugin.c 5 Nov 2003 09:15:41 - 1.20 +++ jk_isapi_plugin.c 11 Feb 2004 09:52:03 - 1.21 @@ -1273,6 +1273,9 @@ s-read = read; s-write = write; +/* Clear RECO status */ +s-reco_status = RECO_NONE; + GET_SERVER_VARIABLE_VALUE(HTTP_WORKER_HEADER_NAME, (*worker_name)); GET_SERVER_VARIABLE_VALUE(HTTP_URI_HEADER_NAME, s-req_uri); GET_SERVER_VARIABLE_VALUE(HTTP_QUERY_HEADER_NAME, s-query_string); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
billbarker2003/08/25 21:41:54 Modified:jk/native/iis jk_isapi_plugin.c Log: Updating IIS for the changed contract. This one scares me, but I don't know (or want to know :) the ISAPI enough to know if it is safe to use stack-frame buffers. Nacho, Mladin: If you could review this, I'd be very grateful. Unlike Apache, I can't actually build this one. Revision ChangesPath 1.19 +5 -4 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- jk_isapi_plugin.c 25 Sep 2002 00:49:40 - 1.18 +++ jk_isapi_plugin.c 26 Aug 2003 04:41:54 - 1.19 @@ -759,13 +759,14 @@ jk_log(logger, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s\n, snuri); -worker = map_uri_to_worker(uw_map, snuri, logger); -} +} else { + strncpy(snuri, uri, sizeof(snuri)); + } if (!worker) { jk_log(logger, JK_LOG_DEBUG, In HttpFilterProc test Default redirection of %s\n, uri); -worker = map_uri_to_worker(uw_map, uri, logger); +worker = map_uri_to_worker(uw_map, snuri, logger); } if (worker) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
nacho 2002/09/24 17:49:40 Modified:jk/native/iis jk_isapi_plugin.c Log: Better testing for vhosts, use the supplied server name and port instead of directly the Host header ones.. Revision ChangesPath 1.18 +21 -4 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- jk_isapi_plugin.c 7 May 2002 01:37:51 - 1.17 +++ jk_isapi_plugin.c 25 Sep 2002 00:49:40 - 1.18 @@ -667,7 +667,8 @@ { char uri[INTERNET_MAX_URL_LENGTH]; char snuri[INTERNET_MAX_URL_LENGTH]=/; -char Host[INTERNET_MAX_URL_LENGTH]; +char Host[INTERNET_MAX_URL_LENGTH]=; +char Port[INTERNET_MAX_URL_LENGTH]=; char Translate[INTERNET_MAX_URL_LENGTH]; BOOL (WINAPI * GetHeader) (struct _HTTP_FILTER_CONTEXT * pfc, LPSTR lpszName, LPVOID lpvBuffer, LPDWORD lpdwSize ); @@ -678,6 +679,7 @@ char *query; DWORD sz = sizeof(uri); DWORD szHost = sizeof(Host); +DWORD szPort = sizeof(Port); DWORD szTranslate = sizeof(Translate); if (iis5) { @@ -735,8 +737,23 @@ return SF_STATUS_REQ_FINISHED; } getparents(uri); - -if(GetHeader(pfc, Host:, (LPVOID)Host, (LPDWORD)szHost)) { +if (pfc-GetServerVariable(pfc, SERVER_NAME, (LPVOID)Host, (LPDWORD)szHost)){ +if (szHost 0) { +Host[szHost-1] = '\0'; +} +} +Port[0] = '\0'; +if (pfc-GetServerVariable(pfc, SERVER_PORT, (LPVOID)Port, (LPDWORD)szPort)){ +if (szPort 0) { +Port[szPort-1] = '\0'; +} +} +szPort = atoi(Port); +if (szPort != 80 szPort != 443 szHost 0){ +strcat(Host,:); +strcat(Host,Port); +} +if (szHost 0) { strcat(snuri,Host); strcat(snuri,uri); jk_log(logger, JK_LOG_DEBUG, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
larryi 02/05/06 18:37:51 Modified:jk/native/iis jk_isapi_plugin.c Log: Update to use common version string Revision ChangesPath 1.17 +2 -2 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- jk_isapi_plugin.c 1 May 2002 22:59:12 - 1.16 +++ jk_isapi_plugin.c 7 May 2002 01:37:51 - 1.17 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.16 $ * + * Version: $Revision: 1.17 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -78,7 +78,7 @@ #include jk_worker.h #include jk_uri_worker_map.h -#define VERSION_STRING Jakarta/ISAPI/1.0b1 +#define VERSION_STRING Jakarta/ISAPI/ JK_VERSTRING #define DEFAULT_WORKER_NAME (ajp13) /* -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
nacho 02/05/01 15:59:12 Modified:jk/native/iis jk_isapi_plugin.c Log: * Problems with extension return codes in IIS 6.0. It seems IIS version prior to 6.0, were buggy and not honored the HSE_STATUS_SUCCESS_KEEP_CONN extension return values. This is why the bug not revealed before. Thanks to Lenny Karpel Revision ChangesPath 1.16 +8 -22 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- jk_isapi_plugin.c 9 Apr 2002 23:09:25 - 1.15 +++ jk_isapi_plugin.c 1 May 2002 22:59:12 - 1.16 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.15 $ * + * Version: $Revision: 1.16 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -669,26 +669,12 @@ char snuri[INTERNET_MAX_URL_LENGTH]=/; char Host[INTERNET_MAX_URL_LENGTH]; char Translate[INTERNET_MAX_URL_LENGTH]; - - BOOL (WINAPI * GetHeader) ( - struct _HTTP_FILTER_CONTEXT * pfc, - LPSTR lpszName, - LPVOIDlpvBuffer, - LPDWORD lpdwSize - ); - - BOOL (WINAPI * SetHeader) ( - struct _HTTP_FILTER_CONTEXT * pfc, - LPSTR lpszName, - LPSTR lpszValue - ); - - BOOL (WINAPI * AddHeader) ( - struct _HTTP_FILTER_CONTEXT * pfc, - LPSTR lpszName, - LPSTR lpszValue - ); - + BOOL (WINAPI * GetHeader) + (struct _HTTP_FILTER_CONTEXT * pfc, LPSTR lpszName, LPVOID lpvBuffer, LPDWORD lpdwSize ); + BOOL (WINAPI * SetHeader) + (struct _HTTP_FILTER_CONTEXT * pfc, LPSTR lpszName, LPSTR lpszValue ); + BOOL (WINAPI * AddHeader) + (struct _HTTP_FILTER_CONTEXT * pfc, LPSTR lpszName,LPSTR lpszValue ); char *query; DWORD sz = sizeof(uri); DWORD szHost = sizeof(Host); @@ -917,7 +903,7 @@ if (worker-get_endpoint(worker, e, logger)) { int recover = JK_FALSE; if (e-service(e, s, logger, recover)) { -rc = HSE_STATUS_SUCCESS_AND_KEEP_CONN; +rc = HSE_STATUS_SUCCESS; lpEcb-dwHttpStatusCode = HTTP_STATUS_OK; jk_log(logger, JK_LOG_DEBUG, HttpExtensionProc service() returned OK\n); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
nacho 02/04/09 16:09:25 Modified:jk/native/iis jk_isapi_plugin.c Log: * Fix for #2342 Revision ChangesPath 1.15 +73 -23jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- jk_isapi_plugin.c 13 Jan 2002 21:54:32 - 1.14 +++ jk_isapi_plugin.c 9 Apr 2002 23:09:25 - 1.15 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.14 $ * + * Version: $Revision: 1.15 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -113,6 +113,7 @@ #define BAD_PATH -2 #define MAX_SERVERNAME 128 + #define GET_SERVER_VARIABLE_VALUE(name, place) {\ (place) = NULL; \ huge_buf_sz = sizeof(huge_buf); \ @@ -145,9 +146,12 @@ static int using_ini_file = JK_FALSE; static int is_inited = JK_FALSE; static intis_mapread = JK_FALSE; +static int iis5 = -1; + static jk_uri_worker_map_t *uw_map = NULL; static jk_logger_t *logger = NULL; static char *SERVER_NAME = SERVER_NAME; +static char *SERVER_SOFTWARE = SERVER_SOFTWARE; static char extension_uri[INTERNET_MAX_URL_LENGTH] = /jakarta/isapi_redirect.dll; @@ -610,7 +614,8 @@ pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| SF_NOTIFY_SECURE_PORT | SF_NOTIFY_NONSECURE_PORT| -SF_NOTIFY_PREPROC_HEADERS; +SF_NOTIFY_PREPROC_HEADERS | +SF_NOTIFY_AUTH_COMPLETE; strcpy(pVer-lpszFilterDesc, VERSION_STRING); @@ -630,8 +635,7 @@ char serverName[MAX_SERVERNAME]; DWORD dwLen = sizeof(serverName); -if (pfc-GetServerVariable(pfc, SERVER_NAME, serverName, dwLen)) -{ +if (pfc-GetServerVariable(pfc, SERVER_NAME, serverName, dwLen)){ if (dwLen 0) serverName[dwLen-1] = '\0'; if (init_jk(serverName)) is_mapread = JK_TRUE; @@ -641,19 +645,66 @@ is_inited = JK_FALSE; } +if (is_inited (iis5 0) ) { +char serverSoftware[256]; +DWORD dwLen = sizeof(serverSoftware); + iis5=0; +if (pfc-GetServerVariable(pfc,SERVER_SOFTWARE, serverSoftware, dwLen)){ + iis5=(atof(serverSoftware + 14) = 5.0); + if (iis5) { + jk_log(logger, JK_LOG_INFO,Detected IIS = 5.0\n); + } else { + jk_log(logger, JK_LOG_INFO,Detected IIS 5.0\n); + } +} +} + if (is_inited - (SF_NOTIFY_PREPROC_HEADERS == dwNotificationType)) { -PHTTP_FILTER_PREPROC_HEADERS p = (PHTTP_FILTER_PREPROC_HEADERS)pvNotification; + (((SF_NOTIFY_PREPROC_HEADERS == dwNotificationType) !iis5) || + ((SF_NOTIFY_AUTH_COMPLETE == dwNotificationType) iis5) + ) + ) + { char uri[INTERNET_MAX_URL_LENGTH]; char snuri[INTERNET_MAX_URL_LENGTH]=/; char Host[INTERNET_MAX_URL_LENGTH]; char Translate[INTERNET_MAX_URL_LENGTH]; + BOOL (WINAPI * GetHeader) ( + struct _HTTP_FILTER_CONTEXT * pfc, + LPSTR lpszName, + LPVOIDlpvBuffer, + LPDWORD lpdwSize + ); + + BOOL (WINAPI * SetHeader) ( + struct _HTTP_FILTER_CONTEXT * pfc, + LPSTR lpszName, + LPSTR lpszValue + ); + + BOOL (WINAPI * AddHeader) ( + struct _HTTP_FILTER_CONTEXT * pfc, + LPSTR lpszName, + LPSTR lpszValue + ); + char *query; DWORD sz = sizeof(uri); DWORD szHost = sizeof(Host); DWORD szTranslate = sizeof(Translate); +
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
larryi 02/01/13 13:54:32 Modified:jk/native/iis jk_isapi_plugin.c Log: Port uri_select option from Tomcat 3.3. Fix some tabs. Revision ChangesPath 1.14 +188 -53 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- jk_isapi_plugin.c 5 Jan 2002 04:26:32 - 1.13 +++ jk_isapi_plugin.c 13 Jan 2002 21:54:32 - 1.14 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.13 $ * + * Version: $Revision: 1.14 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -103,6 +103,12 @@ #define REGISTRY_LOCATION (Software\\Apache Software Foundation\\Jakarta Isapi Redirector\\1.0) #define EXTENSION_URI_TAG (extension_uri) +#define URI_SELECT_TAG (uri_select) + +#define URI_SELECT_PARSED_VERB (parsed) +#define URI_SELECT_UNPARSED_VERB(unparsed) +#define URI_SELECT_ESCAPED_VERB (escaped) + #define BAD_REQUEST -1 #define BAD_PATH -2 #define MAX_SERVERNAME 128 @@ -150,6 +156,12 @@ static char worker_file[MAX_PATH * 2]; static char worker_mount_file[MAX_PATH * 2]; +#define URI_SELECT_OPT_PARSED 0 +#define URI_SELECT_OPT_UNPARSED 1 +#define URI_SELECT_OPT_ESCAPED 2 + +static int uri_select_option = URI_SELECT_OPT_PARSED; + static jk_worker_env_t worker_env; struct isapi_private_data { @@ -309,6 +321,63 @@ } } +/* Apache code to escape a URL */ + +#define T_OS_ESCAPE_PATH (4) + +static const unsigned char test_char_table[256] = { +0,14,14,14,14,14,14,14,14,14,15,14,14,14,14,14,14,14,14,14, +14,14,14,14,14,14,14,14,14,14,14,14,14,0,7,6,1,6,1,1, +9,9,1,0,8,0,0,10,0,0,0,0,0,0,0,0,0,0,8,15, +15,8,15,15,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,15,15,15,7,0,7,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,15,7,15,1,14,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, +6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6 +}; + +#define TEST_CHAR(c, f) (test_char_table[(unsigned)(c)] (f)) + +static const char c2x_table[] = 0123456789abcdef; + +static unsigned char *c2x(unsigned what, unsigned char *where) +{ +*where++ = '%'; +*where++ = c2x_table[what 4]; +*where++ = c2x_table[what 0xf]; +return where; +} + +static int escape_url(const char *path, char *dest, int destsize) +{ +const unsigned char *s = (const unsigned char *)path; +unsigned char *d = (unsigned char *)dest; +unsigned char *e = dest + destsize - 1; +unsigned char *ee = dest + destsize - 3; +unsigned c; + +while ((c = *s)) { + if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) { +if (d = ee ) +return JK_FALSE; + d = c2x(c, d); + } + else { +if (d = e ) +return JK_FALSE; + *d++ = c; + } + ++s; +} +*d = '\0'; +return JK_TRUE; +} + static int uri_is_web_inf(char *uri) { char *c = uri; @@ -646,13 +715,40 @@ } if (worker) { +char *forwardURI; + /* This is a servlet, should redirect ... */ jk_log(logger, JK_LOG_DEBUG, HttpFilterProc [%s] is a servlet url - should redirect to %s\n, uri, worker); - -if(!p-AddHeader(pfc, URI_HEADER_NAME, uri) || +/* get URI we should forward */ +if (uri_select_option == URI_SELECT_OPT_UNPARSED) { +/* get original unparsed URI */ +p-GetHeader(pfc, url, (LPVOID)uri, (LPDWORD)sz); +/* restore terminator for uri portion */ +if (query) +*(query - 1) = '\0'; +jk_log(logger, JK_LOG_DEBUG, + HttpFilterProc fowarding original URI [%s]\n,uri);
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
larryi 02/01/04 20:26:32 Modified:jk/native/iis jk_isapi_plugin.c Log: In HttpFilterProc, the '?' is searched for in an escaped URI. In init_ws_service as part of HttpExtensionProc, the '?' is searched for in a URI that has been unescaped. This isn't guaranteed to find the same '?'. To avoid this, save the query string in it's own tomcat header and use that in init_ws_service instead of searching again. Added some logging if the worker and worker mount files are not found. Fix some tabs and a typo. Revision ChangesPath 1.13 +22 -29jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_isapi_plugin.c 14 Dec 2001 01:29:26 - 1.12 +++ jk_isapi_plugin.c 5 Jan 2002 04:26:32 - 1.13 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.12 $ * + * Version: $Revision: 1.13 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -91,11 +91,13 @@ * */ #define URI_HEADER_NAME (TOMCATURI:) +#define QUERY_HEADER_NAME (TOMCATQUERY:) #define WORKER_HEADER_NAME (TOMCATWORKER:) #define TOMCAT_TRANSLATE_HEADER_NAME (TOMCATTRANSLATE:) #define CONTENT_LENGTH (CONTENT_LENGTH:) #define HTTP_URI_HEADER_NAME (HTTP_TOMCATURI) +#define HTTP_QUERY_HEADER_NAME (HTTP_TOMCATQUERY) #define HTTP_WORKER_HEADER_NAME (HTTP_TOMCATWORKER) #define REGISTRY_LOCATION (Software\\Apache Software Foundation\\Jakarta Isapi Redirector\\1.0) @@ -574,9 +576,9 @@ (SF_NOTIFY_PREPROC_HEADERS == dwNotificationType)) { PHTTP_FILTER_PREPROC_HEADERS p = (PHTTP_FILTER_PREPROC_HEADERS)pvNotification; char uri[INTERNET_MAX_URL_LENGTH]; - char snuri[INTERNET_MAX_URL_LENGTH]=/; - char Host[INTERNET_MAX_URL_LENGTH]; - char Translate[INTERNET_MAX_URL_LENGTH]; +char snuri[INTERNET_MAX_URL_LENGTH]=/; +char Host[INTERNET_MAX_URL_LENGTH]; +char Translate[INTERNET_MAX_URL_LENGTH]; char *query; DWORD sz = sizeof(uri); @@ -591,6 +593,7 @@ * Just in case somebody set these headers in the request! */ p-SetHeader(pfc, URI_HEADER_NAME, NULL); +p-SetHeader(pfc, QUERY_HEADER_NAME, NULL); p-SetHeader(pfc, WORKER_HEADER_NAME, NULL); p-SetHeader(pfc, TOMCAT_TRANSLATE_HEADER_NAME, NULL); @@ -605,13 +608,13 @@ char *worker=0; query = strchr(uri, '?'); if (query) { -*query = '\0'; +*query++ = '\0'; } rc = unescape_url(uri); if (rc == BAD_REQUEST) { jk_log(logger, JK_LOG_ERROR, - HttpFilterProc [%s] contains on or more invalid escape sequences.\n, + HttpFilterProc [%s] contains one or more invalid escape sequences.\n, uri); write_error_response(pfc,400 Bad Request, HTMLBODYH1Request contains invalid encoding/H1/BODY/HTML); @@ -641,17 +644,6 @@ uri); worker = map_uri_to_worker(uw_map, uri, logger); } -if(query) { -char *querytmp = uri + strlen(uri); -*querytmp++ = '?'; -query++; -/* if uri was shortened, move the query characters */ -if (querytmp != query) { -while (*query != '\0') -*querytmp++ = *query++; -*querytmp = '\0'; -} -} if (worker) { /* This is a servlet, should redirect ... */ @@ -660,7 +652,9 @@ uri, worker); - if (!p-AddHeader(pfc, URI_HEADER_NAME, uri) || +if(!p-AddHeader(pfc, URI_HEADER_NAME, uri) || + ( (query != NULL strlen(query) 0) + ? !p-AddHeader(pfc, QUERY_HEADER_NAME, query) : FALSE ) || !p-AddHeader(pfc, WORKER_HEADER_NAME, worker) ||
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
seguin 01/12/13 14:31:30 Modified:jk/native/iis jk_isapi_plugin.c Log: added a semi-colon so this would build (not sure how/if it was building for anybody else...). Revision ChangesPath 1.11 +2 -2 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- jk_isapi_plugin.c 2001/12/08 15:42:25 1.10 +++ jk_isapi_plugin.c 2001/12/13 22:31:30 1.11 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.10 $ * + * Version: $Revision: 1.11 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -528,7 +528,7 @@ BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) { -ULONG http_filter_revision = HTTP_FILTER_REVISION +ULONG http_filter_revision = HTTP_FILTER_REVISION; pVer-dwFilterVersion = pVer-dwServerFilterVersion; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
larryi 01/12/13 17:29:26 Modified:jk/native/iis jk_isapi_plugin.c Log: Copy the worker_mount_file properties map to a second properties map, leaving out the non-mapping entries. Assume they were string substitutions. This allows it to work with the uriworkermap.properties file generated by Tomcat 3.3's IISConfig module. Revision ChangesPath 1.12 +40 -19jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- jk_isapi_plugin.c 2001/12/13 22:31:30 1.11 +++ jk_isapi_plugin.c 2001/12/14 01:29:26 1.12 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.11 $ * + * Version: $Revision: 1.12 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -867,23 +867,44 @@ if (!jk_open_file_logger(logger, log_file, log_level)) { logger = NULL; } - /* Logging the initialization type: registry or properties file in virtual dir - */ - if (using_ini_file) { - jk_log(logger, JK_LOG_DEBUG, Using ini file %s.\n, ini_file_name); - } else { - jk_log(logger, JK_LOG_DEBUG, Using registry.\n); - } - jk_log(logger, JK_LOG_DEBUG, Using log file %s.\n, log_file); - jk_log(logger, JK_LOG_DEBUG, Using log level %d.\n, log_level); - jk_log(logger, JK_LOG_DEBUG, Using extension uri %s.\n, extension_uri); - jk_log(logger, JK_LOG_DEBUG, Using worker file %s.\n, worker_file); - jk_log(logger, JK_LOG_DEBUG, Using worker mount file %s.\n, worker_mount_file); +/* Logging the initialization type: registry or properties file in virtual dir +*/ +if (using_ini_file) { +jk_log(logger, JK_LOG_DEBUG, Using ini file %s.\n, ini_file_name); +} else { +jk_log(logger, JK_LOG_DEBUG, Using registry.\n); +} +jk_log(logger, JK_LOG_DEBUG, Using log file %s.\n, log_file); +jk_log(logger, JK_LOG_DEBUG, Using log level %d.\n, log_level); +jk_log(logger, JK_LOG_DEBUG, Using extension uri %s.\n, extension_uri); +jk_log(logger, JK_LOG_DEBUG, Using worker file %s.\n, worker_file); +jk_log(logger, JK_LOG_DEBUG, Using worker mount file %s.\n, worker_mount_file); if (map_alloc(map)) { if (map_read_properties(map, worker_mount_file)) { -if (uri_worker_map_alloc(uw_map, map, logger)) { -rc = JK_TRUE; +/* remove non-mapping entries (assume they were string substitutions) */ +jk_map_t *map2; +if (map_alloc(map2)) { +int sz,i; +void* old; + +sz = map_size(map); +for(i = 0; i sz ; i++) { +char *name = map_name_at(map, i); +if ('/' == *name) { +map_put(map2, name, map_value_at(map, i), old); +} else { +jk_log(logger, JK_LOG_DEBUG, + Ignoring worker mount file entry %s=%s.\n, + name, map_value_at(map, i)); +} +} + +if (uri_worker_map_alloc(uw_map, map2, logger)) { +rc = JK_TRUE; +} + +map_free(map2); } } map_free(map); @@ -893,10 +914,10 @@ rc = JK_FALSE; if (map_alloc(map)) { if (map_read_properties(map, worker_file)) { - /* we add the URI-WORKER MAP since workers using AJP14 will feed it */ +/* we add the URI-WORKER MAP since workers using AJP14 will feed it */ - worker_env.uri_to_worker = uw_map; - worker_env.server_name = serverName; +worker_env.uri_to_worker = uw_map; +worker_env.server_name = serverName; if (wc_open(map, worker_env, logger)) { rc = JK_TRUE; @@ -906,7 +927,7 @@ } } - return rc; +return rc; } static int initialize_extension(void) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
larryi 01/12/08 07:42:25 Modified:jk/native/iis jk_isapi_plugin.c Log: Fix bug where if uri is shortened by un-escaping or normalizing, the query string gets lost. Also converted some tabs to spaces. Revision ChangesPath 1.10 +40 -32jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- jk_isapi_plugin.c 2001/11/07 21:46:28 1.9 +++ jk_isapi_plugin.c 2001/12/08 15:42:25 1.10 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.9 $ * + * Version: $Revision: 1.10 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -554,21 +554,21 @@ DWORD dwNotificationType, LPVOID pvNotification) { - /* Initialise jk */ - if (is_inited !is_mapread) { - char serverName[MAX_SERVERNAME]; - DWORD dwLen = sizeof(serverName); - - if (pfc-GetServerVariable(pfc, SERVER_NAME, serverName, dwLen)) - { - if (dwLen 0) serverName[dwLen-1] = '\0'; - if (init_jk(serverName)) - is_mapread = JK_TRUE; - } - /* If we can't read the map we become dormant */ - if (!is_mapread) - is_inited = JK_FALSE; - } +/* Initialise jk */ +if (is_inited !is_mapread) { +char serverName[MAX_SERVERNAME]; +DWORD dwLen = sizeof(serverName); + +if (pfc-GetServerVariable(pfc, SERVER_NAME, serverName, dwLen)) +{ +if (dwLen 0) serverName[dwLen-1] = '\0'; +if (init_jk(serverName)) +is_mapread = JK_TRUE; +} +/* If we can't read the map we become dormant */ +if (!is_mapread) +is_inited = JK_FALSE; +} if (is_inited (SF_NOTIFY_PREPROC_HEADERS == dwNotificationType)) { @@ -627,22 +627,30 @@ } getparents(uri); - if(p-GetHeader(pfc, Host:, (LPVOID)Host, (LPDWORD)szHost)) { - strcat(snuri,Host); - strcat(snuri,uri); - jk_log(logger, JK_LOG_DEBUG, -In HttpFilterProc Virtual Host redirection of %s\n, -snuri); - worker = map_uri_to_worker(uw_map, snuri, logger); - } - if (!worker) { - jk_log(logger, JK_LOG_DEBUG, -In HttpFilterProc test Default redirection of %s\n, -uri); - worker = map_uri_to_worker(uw_map, uri, logger); - } -if (query) { -*query = '?'; +if(p-GetHeader(pfc, Host:, (LPVOID)Host, (LPDWORD)szHost)) { +strcat(snuri,Host); +strcat(snuri,uri); +jk_log(logger, JK_LOG_DEBUG, + In HttpFilterProc Virtual Host redirection of %s\n, + snuri); +worker = map_uri_to_worker(uw_map, snuri, logger); +} +if (!worker) { +jk_log(logger, JK_LOG_DEBUG, + In HttpFilterProc test Default redirection of %s\n, + uri); +worker = map_uri_to_worker(uw_map, uri, logger); +} +if(query) { +char *querytmp = uri + strlen(uri); +*querytmp++ = '?'; +query++; +/* if uri was shortened, move the query characters */ +if (querytmp != query) { +while (*query != '\0') +*querytmp++ = *query++; +*querytmp = '\0'; +} } if (worker) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
andya 01/06/24 08:37:44 Modified:jk/native/iis jk_isapi_plugin.c Log: Defer jk initialisation until server name is known (which means when the filter or extension proc has been called). Builds, loads but not extensively tested. Revision ChangesPath 1.6 +152 -106 jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- jk_isapi_plugin.c 2001/06/23 15:56:55 1.5 +++ jk_isapi_plugin.c 2001/06/24 15:37:43 1.6 @@ -58,7 +58,7 @@ /*** * Description: ISAPI plugin for IIS/PWS * * Author: Gal Shachor [EMAIL PROTECTED] * - * Version: $Revision: 1.5 $ * + * Version: $Revision: 1.6 $ * ***/ #include httpext.h @@ -92,11 +92,13 @@ #define REGISTRY_LOCATION (Software\\Apache Software Foundation\\Jakarta Isapi Redirector\\1.0) #define EXTENSION_URI_TAG (extension_uri) + +#define MAX_SERVERNAME 128 #define GET_SERVER_VARIABLE_VALUE(name, place) {\ (place) = NULL; \ huge_buf_sz = sizeof(huge_buf); \ -if(get_server_value(private_data-lpEcb,\ +if (get_server_value(private_data-lpEcb,\ (name), \ huge_buf, \ huge_buf_sz,\ @@ -107,23 +109,26 @@ #define GET_SERVER_VARIABLE_VALUE_INT(name, place, def) { \ huge_buf_sz = sizeof(huge_buf); \ -if(get_server_value(private_data-lpEcb,\ +if (get_server_value(private_data-lpEcb,\ (name), \ huge_buf, \ huge_buf_sz,\ )) { \ (place) = atoi(huge_buf); \ -if(0 == (place)) { \ +if (0 == (place)) { \ (place) = def; \ } \ } else {\ (place) = def; \ } \ }\ + +static char *SERVER_NAME = SERVER_NAME; -static int is_inited = JK_FALSE; -static jk_uri_worker_map_t *uw_map = NULL; -static jk_logger_t *logger = NULL; +static int is_inited = JK_FALSE; +static int is_mapread = JK_FALSE; +static jk_uri_worker_map_t *uw_map = NULL; +static jk_logger_t *logger = NULL; static char extension_uri[INTERNET_MAX_URL_LENGTH] = /jakarta/isapi_redirect.dll; static char log_file[MAX_PATH * 2]; @@ -163,6 +168,8 @@ jk_ws_service_t *s, char **worker_name); +static int init_jk(char *serverName); + static int initialize_extension(void); static int read_registry_init_data(void); @@ -186,7 +193,7 @@ *c = tolower(*c); c++; } -if(strstr(uri, web-inf)) { +if (strstr(uri, web-inf)) { return JK_TRUE; } @@ -205,15 +212,15 @@ jk_log(logger, JK_LOG_DEBUG, Into jk_ws_service_t::start_response\n); -if(status 100 || status 1000) { +if (status 100 || status 1000) { jk_log(logger, JK_LOG_ERROR, jk_ws_service_t::start_response, invalid status %d\n, status); return JK_FALSE; } -if(s s-ws_private) { +if (s s-ws_private) { isapi_private_data_t *p = s-ws_private; -if(!p-request_started) { +if (!p-request_started) { DWORD len_of_status; char *status_str; char *headers_str; @@ -223,7 +230,7 @@ /* * Create the status line */ -if(!reason) { +if (!reason) { reason = ; } status_str = (char *)_alloca((6 + strlen(reason)) * sizeof(char)); @@ -233,7 +240,7 @@ /* * Create response headers string */ -if(num_of_headers) { +if (num_of_headers) { unsigned i;