cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
yoavs 2004/06/16 08:37:08 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Bugzilla 26832 done. Revision ChangesPath 1.64 +3 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- jk_isapi_plugin.c 21 Mar 2004 09:45:16 - 1.63 +++ jk_isapi_plugin.c 16 Jun 2004 15:37:08 - 1.64 @@ -355,8 +355,8 @@ forwardURI = uri; } else if (workerEnv-options == JK_OPT_FWDURIESCAPED) { -if (!jk_requtil_escapeUrl -(uri, snuri, INTERNET_MAX_URL_LENGTH)) { +if (jk_requtil_escapeUrl + (uri,snuri,INTERNET_MAX_URL_LENGTH) != JK_OK) { env-l-jkLog(env, env-l, JK_LOG_ERROR, HttpFilterProc [%s] re-encoding request exceeds maximum buffer size.\n, uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2004/03/13 02:36:04 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Return 400 - Bad Request if the hostname is longer then 1012 bytes, and if port is out of rage [0-65536] Revision ChangesPath 1.62 +11 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -r1.61 -r1.62 --- jk_isapi_plugin.c 28 Feb 2004 09:01:11 - 1.61 +++ jk_isapi_plugin.c 13 Mar 2004 10:36:04 - 1.62 @@ -270,7 +270,7 @@ rc = jk_requtil_unescapeUrl(uri); jk_requtil_getParents(uri); - +Host[0] = '\0'; if (pfc-GetServerVariable(pfc, SERVER_NAME, (LPVOID)Host, (LPDWORD)szHost)){ if (szHost 0) { Host[szHost-1] = '\0'; @@ -283,6 +283,14 @@ } } nPort = atoi(Port); +if (strlen(Host) 1012 || nPort 0 || nPort 65535) { +env-l-jkLog(env, env-l, JK_LOG_ERROR, +HttpFilterProc [%s] contains invalid host or port value.\n, +uri); +write_error_response(pfc,400 Bad Request, HTML_ERROR_400); +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); +return SF_STATUS_REQ_FINISHED; +} env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s : %s\n, Host, Port); @@ -578,6 +586,7 @@ rc=(JK_OK == workerEnv-config-setPropertyString( env, workerEnv-config, config.file, worker_file )); } workerEnv-init(env,workerEnv); + env-l-jkLog(env, env-l, JK_LOG_INFO, Set serverRoot %s\n, server_root); if (using_ini_file) { env-l-jkLog(env, env-l, JK_LOG_DEBUG, Using ini file %s.\n, ini_file_name); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2004/02/28 01:01:11 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix the Bug 14538. Use the url rewrite for non mapped url's that contain session path identifier. Revision ChangesPath 1.61 +9 -1 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- jk_isapi_plugin.c 27 Feb 2004 19:28:51 - 1.60 +++ jk_isapi_plugin.c 28 Feb 2004 09:01:11 - 1.61 @@ -366,6 +366,14 @@ SetHeader(pfc, Translate:, NULL); } } else { +char *jsessionid = strstr(uri, JK_PATH_SESSION_IDENTIFIER); +if (jsessionid) { +env-l-jkLog(env, env-l, JK_LOG_INFO, + HttpFilterProc removing session identifier [%s] for non servlet url\n, + jsessionid); +*jsessionid = '\0'; +SetHeader(pfc, url, uri); +} env-l-jkLog(env, env-l, JK_LOG_DEBUG, HttpFilterProc [%s] is not a servlet url\n, uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2004/02/27 11:28:51 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Remove the SF_NOTIFY_AUTH_COMPLETE define checking. If someone wishes to compile jk2 he will anyhow need the platform SDK. Any sdk since year 2000 has that defined in the httpfilt.h Revision ChangesPath 1.60 +5 -17 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -r1.59 -r1.60 --- jk_isapi_plugin.c 24 Feb 2004 08:44:42 - 1.59 +++ jk_isapi_plugin.c 27 Feb 2004 19:28:51 - 1.60 @@ -39,7 +39,6 @@ #include jk_worker.h #include apr_general.h #include jk_iis.h -//#include jk_uri_worker_map.h #define SERVER_ROOT_TAG (serverRoot) #define EXTENSION_URI_TAG (extensionUri) @@ -160,7 +159,7 @@ pVer-dwFilterVersion = http_filter_revision; } auth_notification_flags = get_auth_flags(); -#ifdef SF_NOTIFY_AUTH_COMPLETE + if (auth_notification_flags == SF_NOTIFY_AUTH_COMPLETE) { pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| SF_NOTIFY_SECURE_PORT | @@ -168,9 +167,7 @@ SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_AUTH_COMPLETE; } -else -#endif -{ +else { pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| SF_NOTIFY_SECURE_PORT | SF_NOTIFY_NONSECURE_PORT| @@ -232,15 +229,13 @@ DWORD szTranslate = sizeof(Translate); DWORD szPort = sizeof(Port); int nPort; -#ifdef SF_NOTIFY_AUTH_COMPLETE + if (auth_notification_flags == SF_NOTIFY_AUTH_COMPLETE) { GetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-GetHeader; SetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-SetHeader; AddHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-AddHeader; } -else -#endif -{ +else { GetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-GetHeader; SetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-SetHeader; AddHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-AddHeader; @@ -805,7 +800,6 @@ return env; } -#ifdef SF_NOTIFY_AUTH_COMPLETE static int get_auth_flags() { HKEY hkey; @@ -839,9 +833,3 @@ return rv; } -#else -static int get_auth_flags() -{ -return SF_NOTIFY_PREPROC_HEADERS; -} -#endif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Larry, Thanks. The restored mod_jk behavior is the same as Tomcat 3.3.x with DecodeInterceptor ... safe=true/, the default. Unsafe escapes give 403's. We can add a similar option to mod_jk to turn off the checking. Though, I can't image a situation where it would make sense to accept the risks to gain access to these escapes. The problem is that i_r2.dll is spitting 403 on any URL that contains %2F, remeber fuilter do see ALL the request that pass for the IIS server, we are rejecting URL NOT for tomcat, like in /test%2Ftest.asp, this is the wrong behaviour the user seeing, and i think it's a little agressive, dont you? so this needs to be solved.. Saludos, Ignacio J. Ortega - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
-Original Message- From: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 4:51 AM To: 'Tomcat Developers List' Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c Larry, Thanks. The restored mod_jk behavior is the same as Tomcat 3.3.x with DecodeInterceptor ... safe=true/, the default. Unsafe escapes give 403's. We can add a similar option to mod_jk to turn off the checking. Though, I can't image a situation where it would make sense to accept the risks to gain access to these escapes. The problem is that i_r2.dll is spitting 403 on any URL that contains %2F, remeber fuilter do see ALL the request that pass for the IIS server, we are rejecting URL NOT for tomcat, like in /test%2Ftest.asp, this is the wrong behaviour the user seeing, and i think it's a little agressive, dont you? so this needs to be solved.. Saludos, Ignacio J. Ortega - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
I'm seem to be getting into a habit of clicking Send instead of Save. :( I think this is something that to some degree is a necessary evil. Hopefully I will be able to tell more when I can get back into the code. The trick is allowing this okay URL to succeed while preventing malicious uses of %2F from also succeeding. Cheers, Larry -Original Message- From: Larry Isaacs Sent: Thursday, February 06, 2003 8:02 AM To: Tomcat Developers List Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c -Original Message- From: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 06, 2003 4:51 AM To: 'Tomcat Developers List' Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c Larry, Thanks. The restored mod_jk behavior is the same as Tomcat 3.3.x with DecodeInterceptor ... safe=true/, the default. Unsafe escapes give 403's. We can add a similar option to mod_jk to turn off the checking. Though, I can't image a situation where it would make sense to accept the risks to gain access to these escapes. The problem is that i_r2.dll is spitting 403 on any URL that contains %2F, remeber fuilter do see ALL the request that pass for the IIS server, we are rejecting URL NOT for tomcat, like in /test%2Ftest.asp, this is the wrong behaviour the user seeing, and i think it's a little agressive, dont you? so this needs to be solved.. Saludos, Ignacio J. Ortega - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2003/02/06 08:37:47 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Nacho, we are in the year 2003 ;) Revision ChangesPath 1.56 +2 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- jk_isapi_plugin.c 5 Feb 2003 22:10:51 - 1.55 +++ jk_isapi_plugin.c 6 Feb 2003 16:37:47 - 1.56 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999-2002 The Apache Software Foundation. * + * Copyright (c) 1999-2003 The Apache Software Foundation. * * All rights reserved.* * * * = * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2003/02/06 15:34:45 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix for Bug#16759 ISAPI_REDIRECTOR Handles %2F improperly Was refusing any URL with %2F or %00 embedded always, now it only refuses request mapped to tomcat.. Revision ChangesPath 1.57 +19 -18 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- jk_isapi_plugin.c 6 Feb 2003 16:37:47 - 1.56 +++ jk_isapi_plugin.c 6 Feb 2003 23:34:45 - 1.57 @@ -315,22 +315,6 @@ } rc = jk_requtil_unescapeUrl(uri); -if (rc == BAD_REQUEST) { -env-l-jkLog(env, env-l, JK_LOG_ERROR, - HttpFilterProc [%s] contains one or more invalid escape sequences.\n, - uri); -write_error_response(pfc,400 Bad Request, HTML_ERROR_400); -workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; -} -else if(rc == BAD_PATH) { -env-l-jkLog(env, env-l, JK_LOG_EMERG, - HttpFilterProc [%s] contains forbidden escape sequences.\n, - uri); -write_error_response(pfc,403 Forbidden, HTML_ERROR_403); -workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; -} jk_requtil_getParents(uri); if (pfc-GetServerVariable(pfc, SERVER_NAME, (LPVOID)Host, (LPDWORD)szHost)){ @@ -354,6 +338,23 @@ char *forwardURI; /* This is a servlet, should redirect ... */ +/* First check if the request was invalidated at decode */ +if (rc == BAD_REQUEST) { +env-l-jkLog(env, env-l, JK_LOG_ERROR, +HttpFilterProc [%s] contains one or more invalid escape sequences.\n, +uri); +write_error_response(pfc,400 Bad Request, HTML_ERROR_400); +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); +return SF_STATUS_REQ_FINISHED; +} +else if(rc == BAD_PATH) { +env-l-jkLog(env, env-l, JK_LOG_EMERG, +HttpFilterProc [%s] contains forbidden escape sequences.\n, +uri); +write_error_response(pfc,403 Forbidden, HTML_ERROR_403); +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); +return SF_STATUS_REQ_FINISHED; +} env-l-jkLog(env, env-l, JK_LOG_DEBUG, HttpFilterProc [%s] is a servlet url - should redirect to %s\n, uri, uriEnv-workerName); @@ -408,7 +409,7 @@ workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return SF_STATUS_REQ_ERROR; } -SetHeader(pfc, Translate:, NULL); +SetHeader(pfc, Translate:, NULL); } } else { env-l-jkLog(env, env-l, JK_LOG_DEBUG, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Larry, Sorry, Clicked the wrong button. :) No problem, :), i undertands the concerns, and the change seems a little daring i know.. anyway, reviewing by peers works, thanks god.. :) To finish the thought, with the change below, does http://localhost/test%2F/test.jsp still go to Tomcat? Or is it blocked from going to Tomcat because it is a bad URL. If it doesn't go to Tomcat, how do we know some other filter in the chain isn't going to serve it statically? take into account that to be able to map we first need to unescape the url. it's the unescaping function the one that gives this errors, so we can only block these url prior to do the mapping, so we really dont know if the url should go to tomcat or not at this point.. And It's almost the same case that in apache you need to explicitely block WEB-INF, if you want block people from look at there when using a configuration where tomcat context it's directly configured as an apache served directory.. something that needs to be tweaked to be secure.. I think this is the same case, it's an advanced configuration, there are posible source disclosures, but it's a risk you can sort out.. like in the apache WEB-INF case.. And the casual and default configuration, doesnt have this advance features.. Do you see other way to fix 16759? Saludos, Ignacio J. Ortega - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
I've haven't looked at the full source in a while, so I'm somewhat guessing at the exact impact. I'm working on a Tomcat 3.3.2 release plan which will need to integrate use of the J-T-C connectors. I should be able to take a more in depth look at this as part of that. I wouldn't see it as a step forward where we increase the vulnerability of the majority, and the effort needed to deal with that, in favor of satisfying a small minority that insist on using inherently unsafe escape sequences. Maybe this new behavior should be an option like it is in Tomcat 3.3.x. The default is to err on the side of safety. Operating in this less safe envrionment could be specifically requested via an option, and the user is responsible for dealing with the impact. How does that sound? Cheers, Larry -Original Message- From: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 4:04 AM To: 'Tomcat Developers List' Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c Larry, Sorry, Clicked the wrong button. :) No problem, :), i undertands the concerns, and the change seems a little daring i know.. anyway, reviewing by peers works, thanks god.. :) To finish the thought, with the change below, does http://localhost/test%2F/test.jsp still go to Tomcat? Or is it blocked from going to Tomcat because it is a bad URL. If it doesn't go to Tomcat, how do we know some other filter in the chain isn't going to serve it statically? take into account that to be able to map we first need to unescape the url. it's the unescaping function the one that gives this errors, so we can only block these url prior to do the mapping, so we really dont know if the url should go to tomcat or not at this point.. And It's almost the same case that in apache you need to explicitely block WEB-INF, if you want block people from look at there when using a configuration where tomcat context it's directly configured as an apache served directory.. something that needs to be tweaked to be secure.. I think this is the same case, it's an advanced configuration, there are posible source disclosures, but it's a risk you can sort out.. like in the apache WEB-INF case.. And the casual and default configuration, doesnt have this advance features.. Do you see other way to fix 16759? Saludos, Ignacio J. Ortega - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Larry, I wouldn't see it as a step forward where we increase the vulnerability of the majority, and the effort needed to deal with that, in favor of satisfying a small minority that insist on using inherently unsafe escape sequences. Maybe this new behavior should be an option like it is in Tomcat 3.3.x. The default is to err on the side of safety. Operating in this less safe envrionment could be specifically requested via an option, and the user is responsible for dealing with the impact. How does that sound? Ok, no problem, but there must be a middle ground. Perhaps the tests (jk_req_util.c/jk_requtil_unescapeUrl) now overreact a bit, maybe we can tone down the code, just now it barfs on any embedded '/' %2F, tomcat deals without problems with this issues, and later there is an agressive uri filtering on ./ and combinations.. maybe is better to let this pass without problems to tc, and let tomcat deal with it.. tested and it works very well.. How about this way? In the mean time i'll revert the change.. Saludos, Ignacio J. Ortega - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2003/02/05 14:10:51 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Revert latest Fix for Bug#16759 Revision ChangesPath 1.55 +7 -11 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- jk_isapi_plugin.c 4 Feb 2003 20:45:49 - 1.54 +++ jk_isapi_plugin.c 5 Feb 2003 22:10:51 - 1.55 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999-2003 The Apache Software Foundation. * + * Copyright (c) 1999-2002 The Apache Software Foundation. * * All rights reserved.* * * * = * @@ -316,24 +316,20 @@ rc = jk_requtil_unescapeUrl(uri); if (rc == BAD_REQUEST) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_ERROR, HttpFilterProc [%s] contains one or more invalid escape sequences.\n, uri); -// XXX: Let any other filter process the request, -// if they take any security measure or not doesnt matter. -// write_error_response(pfc,400 Bad Request, HTML_ERROR_400); +write_error_response(pfc,400 Bad Request, HTML_ERROR_400); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_NEXT_NOTIFICATION; +return SF_STATUS_REQ_FINISHED; } else if(rc == BAD_PATH) { -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_EMERG, HttpFilterProc [%s] contains forbidden escape sequences.\n, uri); -// XXX: Let any other filter process the request, -// if they take any security measure or not doesnt matter. -// write_error_response(pfc,403 Forbidden, HTML_ERROR_403); +write_error_response(pfc,403 Forbidden, HTML_ERROR_403); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_NEXT_NOTIFICATION; +return SF_STATUS_REQ_FINISHED; } jk_requtil_getParents(uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Thanks. The restored mod_jk behavior is the same as Tomcat 3.3.x with DecodeInterceptor ... safe=true/, the default. Unsafe escapes give 403's. We can add a similar option to mod_jk to turn off the checking. Though, I can't image a situation where it would make sense to accept the risks to gain access to these escapes. Cheers, Larry -Original Message- From: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 5:02 PM To: 'Tomcat Developers List' Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c Larry, I wouldn't see it as a step forward where we increase the vulnerability of the majority, and the effort needed to deal with that, in favor of satisfying a small minority that insist on using inherently unsafe escape sequences. Maybe this new behavior should be an option like it is in Tomcat 3.3.x. The default is to err on the side of safety. Operating in this less safe envrionment could be specifically requested via an option, and the user is responsible for dealing with the impact. How does that sound? Ok, no problem, but there must be a middle ground. Perhaps the tests (jk_req_util.c/jk_requtil_unescapeUrl) now overreact a bit, maybe we can tone down the code, just now it barfs on any embedded '/' %2F, tomcat deals without problems with this issues, and later there is an agressive uri filtering on ./ and combinations.. maybe is better to let this pass without problems to tc, and let tomcat deal with it.. tested and it works very well.. How about this way? In the mean time i'll revert the change.. Saludos, Ignacio J. Ortega - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2003/02/04 12:45:50 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix for Bug#16759 ISAPI_REDIRECTOR Handles %2F improperly Now a uri considered not valid or bad by jk2 is passed down the filter chain, so letting the server continue processing, also relaxed logging to info as they are not errors anymore.. Revision ChangesPath 1.54 +10 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- jk_isapi_plugin.c 4 Feb 2003 07:44:23 - 1.53 +++ jk_isapi_plugin.c 4 Feb 2003 20:45:49 - 1.54 @@ -316,20 +316,24 @@ rc = jk_requtil_unescapeUrl(uri); if (rc == BAD_REQUEST) { -env-l-jkLog(env, env-l, JK_LOG_ERROR, +env-l-jkLog(env, env-l, JK_LOG_INFO, HttpFilterProc [%s] contains one or more invalid escape sequences.\n, uri); -write_error_response(pfc,400 Bad Request, HTML_ERROR_400); +// XXX: Let any other filter process the request, +// if they take any security measure or not doesnt matter. +// write_error_response(pfc,400 Bad Request, HTML_ERROR_400); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; +return SF_STATUS_REQ_NEXT_NOTIFICATION; } else if(rc == BAD_PATH) { -env-l-jkLog(env, env-l, JK_LOG_EMERG, +env-l-jkLog(env, env-l, JK_LOG_INFO, HttpFilterProc [%s] contains forbidden escape sequences.\n, uri); -write_error_response(pfc,403 Forbidden, HTML_ERROR_403); +// XXX: Let any other filter process the request, +// if they take any security measure or not doesnt matter. +// write_error_response(pfc,403 Forbidden, HTML_ERROR_403); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; +return SF_STATUS_REQ_NEXT_NOTIFICATION; } jk_requtil_getParents(uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Hi Nacho, My brain is isn't firing on all cylinders at the moment, but this makes me a little nervous. I think some of the problems in the past have been where malicious escaping would prevent request from being forwarded to Tomcat, and would be served statically. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:46 PM To: [EMAIL PROTECTED] Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c nacho 2003/02/04 12:45:50 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix for Bug#16759 ISAPI_REDIRECTOR Handles %2F improperly Now a uri considered not valid or bad by jk2 is passed down the filter chain, so letting the server continue processing, also relaxed logging to info as they are not errors anymore.. Revision ChangesPath 1.54 +10 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk _isapi_plugin.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- jk_isapi_plugin.c 4 Feb 2003 07:44:23 - 1.53 +++ jk_isapi_plugin.c 4 Feb 2003 20:45:49 - 1.54 @@ -316,20 +316,24 @@ rc = jk_requtil_unescapeUrl(uri); if (rc == BAD_REQUEST) { -env-l-jkLog(env, env-l, JK_LOG_ERROR, +env-l-jkLog(env, env-l, JK_LOG_INFO, HttpFilterProc [%s] contains one or more invalid escape sequences.\n, uri); -write_error_response(pfc,400 Bad Request, HTML_ERROR_400); +// XXX: Let any other filter process the request, +// if they take any security measure or not doesnt matter. +// write_error_response(pfc,400 Bad Request, HTML_ERROR_400); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; +return SF_STATUS_REQ_NEXT_NOTIFICATION; } else if(rc == BAD_PATH) { -env-l-jkLog(env, env-l, JK_LOG_EMERG, +env-l-jkLog(env, env-l, JK_LOG_INFO, HttpFilterProc [%s] contains forbidden escape sequences.\n, uri); -write_error_response(pfc,403 Forbidden, HTML_ERROR_403); +// XXX: Let any other filter process the request, +// if they take any security measure or not doesnt matter. +// write_error_response(pfc,403 Forbidden, HTML_ERROR_403); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; +return SF_STATUS_REQ_NEXT_NOTIFICATION; } jk_requtil_getParents(uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Sorry, Clicked the wrong button. :) To finish the thought, with the change below, does http://localhost/test%2F/test.jsp still go to Tomcat? Or is it blocked from going to Tomcat because it is a bad URL. If it doesn't go to Tomcat, how do we know some other filter in the chain isn't going to serve it statically? Larry -Original Message- From: Larry Isaacs Sent: Tuesday, February 04, 2003 8:17 PM To: Tomcat Developers List Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c Hi Nacho, My brain is isn't firing on all cylinders at the moment, but this makes me a little nervous. I think some of the problems in the past have been where malicious escaping would prevent request from being forwarded to Tomcat, and would be served statically. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:46 PM To: [EMAIL PROTECTED] Subject: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c nacho 2003/02/04 12:45:50 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix for Bug#16759 ISAPI_REDIRECTOR Handles %2F improperly Now a uri considered not valid or bad by jk2 is passed down the filter chain, so letting the server continue processing, also relaxed logging to info as they are not errors anymore.. Revision ChangesPath 1.54 +10 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk _isapi_plugin.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- jk_isapi_plugin.c 4 Feb 2003 07:44:23 - 1.53 +++ jk_isapi_plugin.c 4 Feb 2003 20:45:49 - 1.54 @@ -316,20 +316,24 @@ rc = jk_requtil_unescapeUrl(uri); if (rc == BAD_REQUEST) { -env-l-jkLog(env, env-l, JK_LOG_ERROR, +env-l-jkLog(env, env-l, JK_LOG_INFO, HttpFilterProc [%s] contains one or more invalid escape sequences.\n, uri); -write_error_response(pfc,400 Bad Request, HTML_ERROR_400); +// XXX: Let any other filter process the request, +// if they take any security measure or not doesnt matter. +// write_error_response(pfc,400 Bad Request, HTML_ERROR_400); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; +return SF_STATUS_REQ_NEXT_NOTIFICATION; } else if(rc == BAD_PATH) { -env-l-jkLog(env, env-l, JK_LOG_EMERG, +env-l-jkLog(env, env-l, JK_LOG_INFO, HttpFilterProc [%s] contains forbidden escape sequences.\n, uri); -write_error_response(pfc,403 Forbidden, HTML_ERROR_403); +// XXX: Let any other filter process the request, +// if they take any security measure or not doesnt matter. +// write_error_response(pfc,403 Forbidden, HTML_ERROR_403); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); -return SF_STATUS_REQ_FINISHED; +return SF_STATUS_REQ_NEXT_NOTIFICATION; } jk_requtil_getParents(uri); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c
nacho 2003/02/01 14:17:16 Modified:jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c Log: Fix for Bug#16638 Jk2 connector with Microsoft IIS slow in multiple domain environment Added a new registry and properties config send_groups. defaults to false. Revision ChangesPath 1.52 +14 -1 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- jk_isapi_plugin.c 26 Oct 2002 12:42:44 - 1.51 +++ jk_isapi_plugin.c 1 Feb 2003 22:17:16 - 1.52 @@ -87,6 +87,7 @@ #define WORKERS_FILE_TAG(workersFile) #define USE_AUTH_COMP_TAG (authComplete) #define THREAD_POOL_TAG (threadPool) +#define SEND_GROUPS_TAG (sendGroups) static char file_name[_MAX_PATH]; @@ -97,6 +98,7 @@ static int was_inited = JK_FALSE; static DWORD auth_notification_flags = 0; static int use_auth_notification_flags = 0; +int send_groups = 0; static jk_workerEnv_t *workerEnv; apr_pool_t *jk_globalPool; @@ -668,6 +670,10 @@ if (tmp) { use_auth_notification_flags = atoi(tmp); } +tmp = map-get(env,map,SEND_GROUPS_TAG); +if (tmp) { +send_groups = atoi(tmp); +} using_ini_file=JK_TRUE; return ok; } @@ -727,6 +733,13 @@ tmpbuf, 8)) { use_auth_notification_flags = atoi(tmpbuf); +} + +if(get_registry_config_parameter(hkey, + SEND_GROUPS_TAG, + tmpbuf, + 8)) { +send_groups = atoi(tmpbuf); } RegCloseKey(hkey); 1.22 +3 -1 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c Index: jk_service_iis.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- jk_service_iis.c 21 Sep 2002 07:28:48 - 1.21 +++ jk_service_iis.c 1 Feb 2003 22:17:16 - 1.22 @@ -81,6 +81,8 @@ #define ROLES_ATTRIBUTE_NAME org.apache.tomcat.jk.roles +extern int send_groups; + static int JK_METHOD jk2_service_iis_head(jk_env_t *env, jk_ws_service_t *s ){ static char crlf[3] = { (char)13, (char)10, '\0' }; const char *reason; @@ -407,7 +409,7 @@ * Add SSL IIS environment */ -if ( strlen(s-remote_user) 0 ){ +if ( send_groups (strlen(s-remote_user) 0 )){ char *groups=jk2_service_iis_get_roles(env, s); if( groups != NULL){ s-attributes-put( env, s-attributes,ROLES_ATTRIBUTE_NAME,groups,NULL); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/10/26 05:42:45 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fake the childId as resolved so that worker_jni works properly. We don't have a multiprocess server here. Revision ChangesPath 1.51 +2 -1 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- jk_isapi_plugin.c 9 Oct 2002 17:11:22 - 1.50 +++ jk_isapi_plugin.c 26 Oct 2002 12:42:44 - 1.51 -803,6 +803,7 return env; } +workerEnv-childId = 0; /* XXX Detect install dir, be means of service configs, */ -- To unsubscribe, e-mail: mailto:tomcat-dev-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-dev-help;jakarta.apache.org
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/10/09 10:11:22 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Skip the checking of default hostname and port. Using that scheme the same behaviour is on all web servers. Revision ChangesPath 1.50 +5 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- jk_isapi_plugin.c 25 Sep 2002 07:36:48 - 1.49 +++ jk_isapi_plugin.c 9 Oct 2002 17:11:22 - 1.50 @@ -270,6 +270,7 @@ DWORD szHost = sizeof(Host); DWORD szTranslate = sizeof(Translate); DWORD szPort = sizeof(Port); +int nPort; #ifdef SF_NOTIFY_AUTH_COMPLETE if (auth_notification_flags == SF_NOTIFY_AUTH_COMPLETE) { GetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-GetHeader; @@ -341,13 +342,11 @@ Port[szPort-1] = '\0'; } } -szPort = atoi(Port); -if (szPort == 80 || szPort == 443) -szPort = 0; +nPort = atoi(Port); env-l-jkLog(env, env-l, JK_LOG_DEBUG, -In HttpFilterProc Virtual Host redirection of %s : %d\n, +In HttpFilterProc Virtual Host redirection of %s : %s\n, Host, Port); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, szPort, uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, nPort, uri ); if( uriEnv!=NULL ) { char *forwardURI; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/09/25 00:36:48 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Chenge the variable declaration order. My compiler reports errors. Revision ChangesPath 1.49 +2 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- jk_isapi_plugin.c 24 Sep 2002 20:15:07 - 1.48 +++ jk_isapi_plugin.c 25 Sep 2002 07:36:48 - 1.49 @@ -178,8 +178,8 @@ BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) { -ULONG http_filter_revision = HTTP_FILTER_REVISION; DWORD dwThreadId; +ULONG http_filter_revision = HTTP_FILTER_REVISION; jk2_inited_event = CreateEvent(NULL, FALSE, FALSE, NULL); jk2_starter_event = CreateEvent(NULL, FALSE, FALSE, NULL); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2002/09/24 13:15:07 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Add a test for 443 as default port Revision ChangesPath 1.48 +3 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- jk_isapi_plugin.c 23 Sep 2002 18:36:38 - 1.47 +++ jk_isapi_plugin.c 24 Sep 2002 20:15:07 - 1.48 @@ -95,7 +95,7 @@ static int is_inited = JK_FALSE; static int is_mapread = JK_FALSE; static int was_inited = JK_FALSE; -static int auth_notification_flags = 0; +static DWORD auth_notification_flags = 0; static int use_auth_notification_flags = 0; static jk_workerEnv_t *workerEnv; @@ -342,7 +342,7 @@ } } szPort = atoi(Port); -if (szPort == 80) +if (szPort == 80 || szPort == 443) szPort = 0; env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s : %d\n, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/09/23 10:42:38 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Supply the port to the uriMap call, This is a TODO, just like for the Apache2. Revision ChangesPath 1.44 +3 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- jk_isapi_plugin.c 21 Sep 2002 07:29:47 - 1.43 +++ jk_isapi_plugin.c 23 Sep 2002 17:42:38 - 1.44 @@ -334,14 +334,14 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s\n, Host); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host,uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, 0, uri ); } if (uriEnv==NULL) { env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc test Default redirection of %s\n, uri); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL, 0, uri ); } if( uriEnv!=NULL ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/09/23 11:30:40 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Use the GetServerVariable for the SERVER_NAME and SERVER_PORT variables. Revision ChangesPath 1.45 +19 -14 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- jk_isapi_plugin.c 23 Sep 2002 17:42:38 - 1.44 +++ jk_isapi_plugin.c 23 Sep 2002 18:30:40 - 1.45 @@ -258,6 +258,7 @@ char snuri[INTERNET_MAX_URL_LENGTH]=/; char Host[INTERNET_MAX_URL_LENGTH]; char Translate[INTERNET_MAX_URL_LENGTH]; +char Port[INTERNET_MAX_URL_LENGTH]; BOOL (WINAPI * GetHeader) (struct _HTTP_FILTER_CONTEXT * pfc, LPSTR lpszName, LPVOID lpvBuffer, LPDWORD lpdwSize ); BOOL (WINAPI * SetHeader) @@ -268,7 +269,7 @@ DWORD sz = sizeof(uri); DWORD szHost = sizeof(Host); DWORD szTranslate = sizeof(Translate); - +DWORD szPort = sizeof(Port); #ifdef SF_NOTIFY_AUTH_COMPLETE if (auth_notification_flags == SF_NOTIFY_AUTH_COMPLETE) { GetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-GetHeader; @@ -329,20 +330,24 @@ } jk_requtil_getParents(uri); - -if(GetHeader(pfc, Host:, (LPVOID)Host, (LPDWORD)szHost)) { -env-l-jkLog(env, env-l, JK_LOG_DEBUG, - In HttpFilterProc Virtual Host redirection of %s\n, - Host); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, 0, uri ); +if (pfc-GetServerVariable(pfc, SERVER_NAME, (LPVOID)Host, (LPDWORD)szHost)){ +if (szHost 0) { +Host[szHost-1] = '\0'; +} } - -if (uriEnv==NULL) { -env-l-jkLog(env, env-l, JK_LOG_DEBUG, - In HttpFilterProc test Default redirection of %s\n, - uri); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL, 0, uri ); +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 = 0; +env-l-jkLog(env, env-l, JK_LOG_DEBUG, +In HttpFilterProc Virtual Host redirection of %s : %d\n, +Host, Port); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, 0, uri ); if( uriEnv!=NULL ) { char *forwardURI; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/09/23 11:34:56 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Forgot the Port to the uriMap call, sorry wrong source directory. Revision ChangesPath 1.46 +2 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- jk_isapi_plugin.c 23 Sep 2002 18:30:40 - 1.45 +++ jk_isapi_plugin.c 23 Sep 2002 18:34:56 - 1.46 @@ -347,7 +347,7 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s : %d\n, Host, Port); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, 0, uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, Port, uri ); if( uriEnv!=NULL ) { char *forwardURI; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/09/23 11:36:38 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: It's not my day :-) Passing char * insted of int. Revision ChangesPath 1.47 +2 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- jk_isapi_plugin.c 23 Sep 2002 18:34:56 - 1.46 +++ jk_isapi_plugin.c 23 Sep 2002 18:36:38 - 1.47 @@ -347,7 +347,7 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s : %d\n, Host, Port); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, Port, uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host, szPort, uri ); if( uriEnv!=NULL ) { char *forwardURI; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/09/21 00:29:47 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix the memory leaks using not using global env allocation on each request and freeing global env after the request. Revision ChangesPath 1.43 +10 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- jk_isapi_plugin.c 15 Aug 2002 11:23:30 - 1.42 +++ jk_isapi_plugin.c 21 Sep 2002 07:29:47 - 1.43 @@ -469,7 +469,10 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, HttpExtensionProc started\n); -GET_SERVER_VARIABLE_VALUE(workerEnv-pool,HTTP_WORKER_HEADER_NAME, ( worker_name )); +huge_buf_sz = sizeof(huge_buf); +get_server_value(lpEcb, HTTP_WORKER_HEADER_NAME, huge_buf, huge_buf_sz, ); +worker_name = huge_buf; + worker=env-getByName( env, worker_name); env-l-jkLog(env, env-l, JK_LOG_DEBUG, @@ -514,10 +517,6 @@ s-afterRequest(env, s); -rPool-reset(env, rPool); - -rc1=worker-rPoolCache-put( env, worker-rPoolCache, rPool ); - if (service != NULL) { lpEcb-ServerSupportFunction(lpEcb-ConnID, HSE_REQ_DONE_WITH_SESSION, @@ -525,6 +524,11 @@ NULL, NULL); } +rPool-reset(env, rPool); +rc1=worker-rPoolCache-put( env, worker-rPoolCache, rPool ); + +workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); + return rc; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/08/15 02:28:42 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix the call to the mapUri. The IIS doesn't support the reverse mappings for now. Revision ChangesPath 1.41 +3 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- jk_isapi_plugin.c 16 Jul 2002 17:29:20 - 1.40 +++ jk_isapi_plugin.c 15 Aug 2002 09:28:42 - 1.41 @@ -334,14 +334,14 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s\n, Host); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host,uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host,uri, 0 ); } if (uriEnv==NULL) { env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc test Default redirection of %s\n, uri); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,uri ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,uri, 0 ); } if( uriEnv!=NULL ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/08/15 04:23:30 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Remove the reverse flag from uriMap call. All the positive/negative mappings is now done inside the uriMap function itself. Revision ChangesPath 1.42 +2 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- jk_isapi_plugin.c 15 Aug 2002 09:28:42 - 1.41 +++ jk_isapi_plugin.c 15 Aug 2002 11:23:30 - 1.42 @@ -334,14 +334,14 @@ env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc Virtual Host redirection of %s\n, Host); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host,uri, 0 ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,Host,uri ); } if (uriEnv==NULL) { env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc test Default redirection of %s\n, uri); -uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,uri, 0 ); +uriEnv = workerEnv-uriMap-mapUri(env, workerEnv-uriMap,NULL,uri ); } if( uriEnv!=NULL ) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/16 10:29:20 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Make all thread function as void and use ExitThread insted of return 0. Change the call to the write_error_response to use the defines from jk_iis.h to skip multiple writting of the same thing. Revision ChangesPath 1.40 +10 -18 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- jk_isapi_plugin.c 14 Jul 2002 13:39:13 - 1.39 +++ jk_isapi_plugin.c 16 Jul 2002 17:29:20 - 1.40 @@ -130,14 +130,9 @@ static void write_error_response(PHTTP_FILTER_CONTEXT pfc,char *status,char * msg) { char crlf[3] = { (char)13, (char)10, '\0' }; -char ctype[30]; +char *ctype = Content-Type:text/html\r\n\r\n; DWORD len = strlen(msg); -sprintf(ctype, -Content-Type:text/html%s%s, -crlf, -crlf); - /* reject !!! */ pfc-ServerSupportFunction(pfc, SF_REQ_SEND_RESPONSE_HEADER, @@ -151,7 +146,7 @@ HANDLE jk2_inited_event; HANDLE jk2_starter_thread = NULL; -DWORD WINAPI jk2_isapi_starter( LPVOID lpParam ) +VOID jk2_isapi_starter( LPVOID lpParam ) { Sleep(1000); @@ -177,7 +172,8 @@ } apr_pool_destroy(jk_globalPool); apr_terminate(); -return 0; +/* Clean up and die. */ +ExitThread(0); } BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) @@ -189,7 +185,7 @@ jk2_starter_event = CreateEvent(NULL, FALSE, FALSE, NULL); jk2_starter_thread = CreateThread(NULL, 0, - jk2_isapi_starter, + (LPTHREAD_START_ROUTINE)jk2_isapi_starter, NULL, 0, dwThreadId); @@ -319,8 +315,7 @@ env-l-jkLog(env, env-l, JK_LOG_ERROR, 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); +write_error_response(pfc,400 Bad Request, HTML_ERROR_400); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return SF_STATUS_REQ_FINISHED; } @@ -328,8 +323,7 @@ env-l-jkLog(env, env-l, JK_LOG_EMERG, HttpFilterProc [%s] contains forbidden escape sequences.\n, uri); -write_error_response(pfc,403 Forbidden, -HTMLBODYH1Access is Forbidden/H1/BODY/HTML); +write_error_response(pfc,403 Forbidden, HTML_ERROR_403); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return SF_STATUS_REQ_FINISHED; } @@ -374,8 +368,7 @@ env-l-jkLog(env, env-l, JK_LOG_ERROR, HttpFilterProc [%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); +write_error_response(pfc,400 Bad Request, HTML_ERROR_400); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return SF_STATUS_REQ_FINISHED; } @@ -430,8 +423,7 @@ HttpFilterProc [%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); +write_error_response(pfc,403 Forbidden, HTML_ERROR_403); workerEnv-globalEnv-releaseEnv( workerEnv-globalEnv, env ); return SF_STATUS_REQ_FINISHED; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/14 06:39:13 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Remove the hack for unloading the jvm. Now its done on the Java side. Check for threadPool config value to be at least 10 or higher. Revision ChangesPath 1.39 +9 -8 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- jk_isapi_plugin.c 10 Jul 2002 17:36:09 - 1.38 +++ jk_isapi_plugin.c 14 Jul 2002 13:39:13 - 1.39 @@ -562,6 +562,7 @@ SetEvent(jk2_starter_event); WaitForSingleObject(jk2_starter_thread, 3000); CloseHandle(jk2_starter_thread); +jk2_starter_thread = INVALID_HANDLE_VALUE; return TRUE; } @@ -577,13 +578,6 @@ char fname[_MAX_FNAME]; switch (ulReason) { -case DLL_PROCESS_DETACH: -/* Dirty hack to unload the jvm */ -if (was_inited jk_jni_status_code) { -ExitProcess(0); -} - break; - case DLL_PROCESS_ATTACH: if (GetModuleFileName( hInst, file_name, sizeof(file_name))) { _splitpath( file_name, drive, dir, fname, NULL ); @@ -667,6 +661,8 @@ tmp = map-get(env,map,THREAD_POOL_TAG); if (tmp) { use_thread_pool = atoi(tmp); +if (use_thread_pool 10) +use_thread_pool = 0; } tmp = map-get(env,map,USE_AUTH_COMP_TAG); if (tmp) { @@ -720,6 +716,11 @@ tmpbuf, 8)) { use_thread_pool = atoi(tmpbuf); +if (use_thread_pool 10) { +use_thread_pool = 0; +env-l-jkLog(env, env-l, JK_LOG_INFO, + read_registry_init_data, ThreadPool must be set to the value 10 or higher\n); +} } if(get_registry_config_parameter(hkey, USE_AUTH_COMP_TAG, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/10 10:36:09 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix the DllMain DLL_PROCESS_DETACH waitng for already closed thread. Revision ChangesPath 1.38 +4 -4 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -r1.37 -r1.38 --- jk_isapi_plugin.c 8 Jul 2002 07:45:32 - 1.37 +++ jk_isapi_plugin.c 10 Jul 2002 17:36:09 - 1.38 @@ -561,6 +561,7 @@ /* detatch the starter thread */ SetEvent(jk2_starter_event); WaitForSingleObject(jk2_starter_thread, 3000); +CloseHandle(jk2_starter_thread); return TRUE; } @@ -577,11 +578,10 @@ switch (ulReason) { case DLL_PROCESS_DETACH: -WaitForSingleObject(jk2_starter_thread, 120); -CloseHandle(jk2_starter_thread); /* Dirty hack to unload the jvm */ -if (was_inited jk_jni_status_code) +if (was_inited jk_jni_status_code) { ExitProcess(0); +} break; case DLL_PROCESS_ATTACH: -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/08 00:45:32 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Move the init to the GetFilterVersion, allowing p file authComplete config value. Needed changes for the ThreadPool. Revision ChangesPath 1.37 +160 -145 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- jk_isapi_plugin.c 8 Jul 2002 00:26:07 - 1.36 +++ jk_isapi_plugin.c 8 Jul 2002 07:45:32 - 1.37 @@ -86,6 +86,7 @@ #define EXTENSION_URI_TAG (extensionUri) #define WORKERS_FILE_TAG(workersFile) #define USE_AUTH_COMP_TAG (authComplete) +#define THREAD_POOL_TAG (threadPool) static char file_name[_MAX_PATH]; @@ -95,9 +96,10 @@ static int is_mapread = JK_FALSE; static int was_inited = JK_FALSE; static int auth_notification_flags = 0; +static int use_auth_notification_flags = 0; static jk_workerEnv_t *workerEnv; -static apr_pool_t *jk_globalPool; +apr_pool_t *jk_globalPool; static char extension_uri[INTERNET_MAX_URL_LENGTH] = /jakarta/isapi_redirector2.dll; static char worker_file[MAX_PATH * 2] = ; @@ -120,6 +122,10 @@ static jk_env_t* jk2_create_config(); static int get_auth_flags(); +/* ThreadPool support + * + */ +int use_thread_pool = 0; static void write_error_response(PHTTP_FILTER_CONTEXT pfc,char *status,char * msg) { @@ -141,14 +147,58 @@ pfc-WriteClient(pfc, msg, len, 0); } +HANDLE jk2_starter_event; +HANDLE jk2_inited_event; +HANDLE jk2_starter_thread = NULL; + +DWORD WINAPI jk2_isapi_starter( LPVOID lpParam ) +{ +Sleep(1000); + +apr_initialize(); +apr_pool_create( jk_globalPool, NULL ); +initialize_extension(); +if (is_inited) { +if (init_jk(NULL)) +is_mapread = JK_TRUE; +} +SetEvent(jk2_inited_event); +WaitForSingleObject(jk2_starter_event, INFINITE); + +if (is_inited) { +was_inited = JK_TRUE; +is_inited = JK_FALSE; +if (workerEnv) { +jk_env_t *env = workerEnv-globalEnv; +jk2_iis_close_pool(env); +workerEnv-close(env, workerEnv); +} +is_mapread = JK_FALSE; +} +apr_pool_destroy(jk_globalPool); +apr_terminate(); +return 0; +} BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) { ULONG http_filter_revision = HTTP_FILTER_REVISION; +DWORD dwThreadId; +jk2_inited_event = CreateEvent(NULL, FALSE, FALSE, NULL); +jk2_starter_event = CreateEvent(NULL, FALSE, FALSE, NULL); -pVer-dwFilterVersion = pVer-dwServerFilterVersion; +jk2_starter_thread = CreateThread(NULL, 0, + jk2_isapi_starter, + NULL, + 0, + dwThreadId); +WaitForSingleObject(jk2_inited_event, INFINITE); +if (!is_inited || !is_mapread) { +return FALSE; +} +pVer-dwFilterVersion = pVer-dwServerFilterVersion; if (pVer-dwFilterVersion http_filter_revision) { pVer-dwFilterVersion = http_filter_revision; } @@ -403,108 +453,109 @@ return TRUE; } -DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpEcb) +DWORD WINAPI HttpExtensionProcWorker(LPEXTENSION_CONTROL_BLOCK lpEcb, + jk_ws_service_t *service) { DWORD rc = HSE_STATUS_ERROR; jk_env_t *env; -lpEcb-dwHttpStatusCode = HTTP_STATUS_SERVER_ERROR; +jk_ws_service_t sOnStack; +jk_ws_service_t *s; +char *worker_name; +char huge_buf[16 * 1024]; /* should be enough for all */ +DWORD huge_buf_sz; +jk_worker_t *worker; +jk_pool_t *rPool=NULL; +int rc1; -if (!is_inited) { -initialize_extension(); -} +if (service) +s = service; +else +s = sOnStack; -/* Initialise jk */ -if (is_inited !is_mapread) { -char serverName[MAX_SERVERNAME]; -DWORD dwLen = sizeof(serverName); -if (lpEcb-GetServerVariable(lpEcb-ConnID, SERVER_NAME, serverName, dwLen)){ -if (dwLen 0) serverName[dwLen-1] = '\0'; -if (init_jk(serverName)) -is_mapread = JK_TRUE; -} -if (!is_mapread) -is_inited = JK_FALSE; +lpEcb-dwHttpStatusCode = HTTP_STATUS_SERVER_ERROR; +env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Mladen, there are 2 ways to configure i_r2.dll, with a properties file in the same dir where the dll resides, and using the registry, i'm all to this patch but i like to see it configurable in the p file aswell, right now this needs to have jk2 inited as is using jk2 own p files reading methods, using jk2 pools and map objets and so on , see read_registry_init_data in jk_isapi_plugin.c.., Saludos , Ignacio J. Ortega -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviado el: 6 de julio de 2002 10:06 Para: [EMAIL PROTECTED] Asunto: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c mturk 2002/07/06 01:05:49 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix the Q250397 bug introducing authComplete registry param that one when set enables the SF_NOTIFY_AUTH_COMPLETE filter notification. Remove the iis5 version checking acordingly using new approach. Revision ChangesPath 1.35 +83 -46 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk _isapi_plugin.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- jk_isapi_plugin.c 5 Jul 2002 08:12:09 - 1.34 +++ jk_isapi_plugin.c 6 Jul 2002 08:05:49 - 1.35 @@ -85,6 +85,7 @@ #define SERVER_ROOT_TAG (serverRoot) #define EXTENSION_URI_TAG (extensionUri) #define WORKERS_FILE_TAG(workersFile) +#define USE_AUTH_COMP_TAG (authComplete) static char file_name[_MAX_PATH]; @@ -93,7 +94,7 @@ static int is_inited = JK_FALSE; static int is_mapread = JK_FALSE; static int was_inited = JK_FALSE; -static int iis5 = -1; +static int auth_notification_flags = 0; static jk_workerEnv_t *workerEnv; static apr_pool_t *jk_globalPool; @@ -117,7 +118,7 @@ static jk_env_t* jk2_create_config(); - +static int get_auth_flags(); static void write_error_response(PHTTP_FILTER_CONTEXT pfc,char *status,char * msg) @@ -151,20 +152,23 @@ if (pVer-dwFilterVersion http_filter_revision) { pVer-dwFilterVersion = http_filter_revision; } - +auth_notification_flags = get_auth_flags(); #ifdef SF_NOTIFY_AUTH_COMPLETE - -pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| -SF_NOTIFY_SECURE_PORT | -SF_NOTIFY_NONSECURE_PORT| -SF_NOTIFY_PREPROC_HEADERS | -SF_NOTIFY_AUTH_COMPLETE; -#else -pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| -SF_NOTIFY_SECURE_PORT | -SF_NOTIFY_NONSECURE_PORT| -SF_NOTIFY_PREPROC_HEADERS; +if (auth_notification_flags == SF_NOTIFY_AUTH_COMPLETE) { +pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| +SF_NOTIFY_SECURE_PORT | +SF_NOTIFY_NONSECURE_PORT| +SF_NOTIFY_PREPROC_HEADERS | +SF_NOTIFY_AUTH_COMPLETE; +} +else #endif +{ +pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| +SF_NOTIFY_SECURE_PORT | +SF_NOTIFY_NONSECURE_PORT| +SF_NOTIFY_PREPROC_HEADERS; +} strcpy(pVer-lpszFilterDesc, VERSION_STRING); @@ -201,28 +205,8 @@ } if (is_inited is_mapread) { env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); -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) { -env-l-jkLog(env, env-l, JK_LOG_INFO,Detected IIS = 5.0\n); -} else { -env-l-jkLog(env, env-l, JK_LOG_INFO,Detected IIS 5.0\n); -} -} -} -#ifdef SF_NOTIFY_AUTH_COMPLETE -if (is_inited - (((SF_NOTIFY_PREPROC_HEADERS == dwNotificationType) !iis5) || - ((SF_NOTIFY_AUTH_COMPLETE == dwNotificationType) iis5) - ) -) -#else -if (is_inited (SF_NOTIFY_PREPROC_HEADERS == dwNotificationType)) -#endif + +if (auth_notification_flags == dwNotificationType) { char uri[INTERNET_MAX_URL_LENGTH]; char snuri
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
-Original Message- From: Ignacio J. Ortega [mailto:[EMAIL PROTECTED]] Sent: 7. srpanj 2002 21:28 To: 'Tomcat Developers List' Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c Mladen, there are 2 ways to configure i_r2.dll, with a properties file in the same dir where the dll resides, and using the registry, i'm all to this patch but i like to see it configurable in the p file aswell, right now this needs to have jk2 inited as is using jk2 own p files reading methods, using jk2 pools and map objets and so on , see read_registry_init_data in jk_isapi_plugin.c.., I'm aware of that, but the problem is that all that has to happen in the phase that we don't have a environment created yet. The solution is either to create the environment prior to or inside the GetFilterVersion to be able to use the current file or registry functions, or use the one I've created. Since I think that this patch is only temporary solution to the SF_NOTIFY_AUTH_COMPLETE problems, and will eventually disappear, rearranging environment creation process and initialization would be IMO overhead. But if you can think of a cleaner solution that wouldn't involve any kind of locking inside either DllMain or GetFilterVersion, and that way locking the iis itself, than we could use the existing configuration mechanism. MT. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
-Original Message- From: Mladen Turk [mailto:[EMAIL PROTECTED]] Sent: 7. srpanj 2002 21:50 To: 'Tomcat Developers List' Subject: RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c Mladen, there are 2 ways to configure i_r2.dll, with a I'm aware of that, but the problem is that all that has to happen in the phase that we don't have a environment created yet. The solution is either to create the environment prior to or inside the GetFilterVersion Ok, it can be used in the GetFilterVersion, just tested moving creation to that function. I'll change that tomorrow to use the existing config param mechanism. MT. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c
nacho 2002/07/07 17:26:07 Modified:jk/java/org/apache/jk/common ChannelSocket.java JkInputStream.java jk/native2/common jk_worker_ajp13.c jk/native2/include jk_service.h jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c Log: * Fix for PUT problmes in tc417+IIS+slide Revision ChangesPath 1.19 +1 -1 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java Index: ChannelSocket.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/ChannelSocket.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ChannelSocket.java2 Jul 2002 20:00:15 - 1.18 +++ ChannelSocket.java8 Jul 2002 00:26:07 - 1.19 @@ -383,7 +383,7 @@ total_read = this.read(ep, buf, hlen, blen); -if (total_read = 0) { +if ((total_read = 0) (blen 0)) { log.warn(can't read body, waited # + blen); return -1; } 1.12 +4 -3 jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java Index: JkInputStream.java === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/JkInputStream.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- JkInputStream.java29 Jun 2002 22:39:13 - 1.11 +++ JkInputStream.java8 Jul 2002 00:26:07 - 1.12 @@ -276,12 +276,13 @@ if( log.isDebugEnabled()) log.debug( doRead + pos + + blen + + available + + end_of_stream+ + responseChunk.getOffset()+ + responseChunk.getLength()); -if( contentLength == pos ) { -end_of_stream=true; +if( end_of_stream ) { return -1; } if( blen == pos ) { -refillReadBuffer(); +if ( !refillReadBuffer() ){ +return -1; +} } responseChunk.setBytes( bodyBuff, pos, blen ); pos=blen; 1.37 +4 -0 jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c Index: jk_worker_ajp13.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- jk_worker_ajp13.c 29 Jun 2002 18:29:51 - 1.36 +++ jk_worker_ajp13.c 8 Jul 2002 00:26:07 - 1.37 @@ -496,6 +496,10 @@ } else { err=jk2_worker_ajp13_forwardSingleThread( env, w, s, e ); } +if (err != JK_OK){ +env-l-jkLog(env, env-l, JK_LOG_ERROR, + ajp13.service() Error forwarding %s\n, e-worker-mbean-name); +} if( w-mbean-debug 0 ) env-l-jkLog(env, env-l, JK_LOG_INFO, 1.16 +2 -1 jakarta-tomcat-connectors/jk/native2/include/jk_service.h Index: jk_service.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_service.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- jk_service.h 5 Jun 2002 21:56:39 - 1.15 +++ jk_service.h 8 Jul 2002 00:26:07 - 1.16 @@ -204,6 +204,7 @@ unsigned is_chunked;/* 1 if content length is unknown (chunked rq) */ unsigned no_more_chunks;/* 1 if last chunk has been read */ long content_read; /* number of bytes read */ +int end_of_stream; /* For IIS avoids blocking calls to lpEcb-ReadClient */ /* * SSL information 1.36 +3 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- jk_isapi_plugin.c 6 Jul 2002 08:05:49 - 1.35 +++ jk_isapi_plugin.c 8 Jul 2002 00:26:07 - 1.36 @@ -2,7 +2,7 @@ * * * The Apache Software License, Version 1.1 * * * - * Copyright (c) 1999-2001 The Apache Software Foundation. * + * Copyright (c) 1999-2002 The Apache Software Foundation. * * All rights
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/06 01:05:49 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Fix the Q250397 bug introducing authComplete registry param that one when set enables the SF_NOTIFY_AUTH_COMPLETE filter notification. Remove the iis5 version checking acordingly using new approach. Revision ChangesPath 1.35 +83 -46 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- jk_isapi_plugin.c 5 Jul 2002 08:12:09 - 1.34 +++ jk_isapi_plugin.c 6 Jul 2002 08:05:49 - 1.35 @@ -85,6 +85,7 @@ #define SERVER_ROOT_TAG (serverRoot) #define EXTENSION_URI_TAG (extensionUri) #define WORKERS_FILE_TAG(workersFile) +#define USE_AUTH_COMP_TAG (authComplete) static char file_name[_MAX_PATH]; @@ -93,7 +94,7 @@ static int is_inited = JK_FALSE; static int is_mapread = JK_FALSE; static int was_inited = JK_FALSE; -static int iis5 = -1; +static int auth_notification_flags = 0; static jk_workerEnv_t *workerEnv; static apr_pool_t *jk_globalPool; @@ -117,7 +118,7 @@ static jk_env_t* jk2_create_config(); - +static int get_auth_flags(); static void write_error_response(PHTTP_FILTER_CONTEXT pfc,char *status,char * msg) @@ -151,20 +152,23 @@ if (pVer-dwFilterVersion http_filter_revision) { pVer-dwFilterVersion = http_filter_revision; } - +auth_notification_flags = get_auth_flags(); #ifdef SF_NOTIFY_AUTH_COMPLETE - -pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| -SF_NOTIFY_SECURE_PORT | -SF_NOTIFY_NONSECURE_PORT| -SF_NOTIFY_PREPROC_HEADERS | -SF_NOTIFY_AUTH_COMPLETE; -#else -pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| -SF_NOTIFY_SECURE_PORT | -SF_NOTIFY_NONSECURE_PORT| -SF_NOTIFY_PREPROC_HEADERS; +if (auth_notification_flags == SF_NOTIFY_AUTH_COMPLETE) { +pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| +SF_NOTIFY_SECURE_PORT | +SF_NOTIFY_NONSECURE_PORT| +SF_NOTIFY_PREPROC_HEADERS | +SF_NOTIFY_AUTH_COMPLETE; +} +else #endif +{ +pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| +SF_NOTIFY_SECURE_PORT | +SF_NOTIFY_NONSECURE_PORT| +SF_NOTIFY_PREPROC_HEADERS; +} strcpy(pVer-lpszFilterDesc, VERSION_STRING); @@ -201,28 +205,8 @@ } if (is_inited is_mapread) { env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); -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) { -env-l-jkLog(env, env-l, JK_LOG_INFO,Detected IIS = 5.0\n); -} else { -env-l-jkLog(env, env-l, JK_LOG_INFO,Detected IIS 5.0\n); -} -} -} -#ifdef SF_NOTIFY_AUTH_COMPLETE -if (is_inited - (((SF_NOTIFY_PREPROC_HEADERS == dwNotificationType) !iis5) || - ((SF_NOTIFY_AUTH_COMPLETE == dwNotificationType) iis5) - ) -) -#else -if (is_inited (SF_NOTIFY_PREPROC_HEADERS == dwNotificationType)) -#endif + +if (auth_notification_flags == dwNotificationType) { char uri[INTERNET_MAX_URL_LENGTH]; char snuri[INTERNET_MAX_URL_LENGTH]=/; @@ -240,22 +224,18 @@ DWORD szTranslate = sizeof(Translate); #ifdef SF_NOTIFY_AUTH_COMPLETE -if (iis5) { +if (auth_notification_flags == SF_NOTIFY_AUTH_COMPLETE) { GetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-GetHeader; SetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-SetHeader; AddHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-AddHeader; -} else { +} +else +#endif +{ GetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-GetHeader; SetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-SetHeader;
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/04 00:23:55 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Set the starter thread extisting through entire extension life cycle. The starter thread at init sleeps for 1 s, causing not blocking of the main IIS thread that calls LoadLibrary for our extension. Revision ChangesPath 1.32 +26 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- jk_isapi_plugin.c 1 Jul 2002 16:53:55 - 1.31 +++ jk_isapi_plugin.c 4 Jul 2002 07:23:55 - 1.32 @@ -520,8 +520,13 @@ return TerminateFilter(dwFlags); } +HANDLE jk2_starter_event; + BOOL WINAPI TerminateFilter(DWORD dwFlags) { +/* detatch the starter thread */ +SetEvent(jk2_starter_event); + if (is_inited) { is_inited = JK_FALSE; if (workerEnv) { @@ -540,11 +545,14 @@ DWORD WINAPI jk2_isapi_starter( LPVOID lpParam ) { +Sleep(1000); + initialize_extension(); if (is_inited) { if (init_jk(NULL)) is_mapread = JK_TRUE; } +WaitForSingleObject(jk2_starter_event, INFINITE); return 0; } @@ -558,21 +566,33 @@ char dir[_MAX_DIR]; char fname[_MAX_FNAME]; DWORD dwThreadId; +DWORD dwRes; +int tcount = 0; switch (ulReason) { case DLL_PROCESS_DETACH: -__try { -if (jk2_starter_thread) -CloseHandle(jk2_starter_thread); -TerminateFilter(HSE_TERM_MUST_UNLOAD); -} __except(1) { +while (!GetExitCodeThread(jk2_starter_thread, dwRes)) { +if (dwRes == STILL_ACTIVE) { +++tcount; +if (tcount 30) { +TerminateThread(jk2_starter_thread, -1); +break; +} +Sleep(100); +} } +CloseHandle(jk2_starter_thread); break; case DLL_PROCESS_ATTACH: if (GetModuleFileName( hInst, file_name, sizeof(file_name))) { _splitpath( file_name, drive, dir, fname, NULL ); _makepath( ini_file_name, drive, dir, fname, .properties ); + +jk2_starter_event = CreateEvent(NULL, +FALSE, +FALSE, +NULL); jk2_starter_thread = CreateThread( NULL, 0, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/04 05:44:56 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Use the WaitForSingleObject instead of GetThreatExitCode. There was a bug that caused terminating the starter thread before the entire clenup finished. The entire extinsion start/stop management is now done in a separate thread. Revision ChangesPath 1.33 +17 -29 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- jk_isapi_plugin.c 4 Jul 2002 07:23:55 - 1.32 +++ jk_isapi_plugin.c 4 Jul 2002 12:44:56 - 1.33 @@ -521,28 +521,17 @@ } HANDLE jk2_starter_event; +HANDLE jk2_starter_thread = NULL; BOOL WINAPI TerminateFilter(DWORD dwFlags) { /* detatch the starter thread */ SetEvent(jk2_starter_event); - -if (is_inited) { -is_inited = JK_FALSE; -if (workerEnv) { -jk_env_t *env = workerEnv-globalEnv; -workerEnv-close(env, workerEnv); -} -apr_pool_destroy(jk_globalPool); -workerEnv=NULL; -is_mapread = JK_FALSE; -} +WaitForSingleObject(jk2_starter_thread, 3000); return TRUE; } -HANDLE jk2_starter_thread = NULL; - DWORD WINAPI jk2_isapi_starter( LPVOID lpParam ) { Sleep(1000); @@ -552,7 +541,17 @@ if (init_jk(NULL)) is_mapread = JK_TRUE; } + WaitForSingleObject(jk2_starter_event, INFINITE); + +if (is_inited) { +is_inited = JK_FALSE; +if (workerEnv) { +jk_env_t *env = workerEnv-globalEnv; +workerEnv-close(env, workerEnv); +} +is_mapread = JK_FALSE; +} return 0; } @@ -566,25 +565,17 @@ char dir[_MAX_DIR]; char fname[_MAX_FNAME]; DWORD dwThreadId; -DWORD dwRes; -int tcount = 0; switch (ulReason) { case DLL_PROCESS_DETACH: -while (!GetExitCodeThread(jk2_starter_thread, dwRes)) { -if (dwRes == STILL_ACTIVE) { -++tcount; -if (tcount 30) { -TerminateThread(jk2_starter_thread, -1); -break; -} -Sleep(100); -} -} +WaitForSingleObject(jk2_starter_thread, INFINITE); CloseHandle(jk2_starter_thread); +apr_terminate(); break; case DLL_PROCESS_ATTACH: +apr_initialize(); +apr_pool_create( jk_globalPool, NULL ); if (GetModuleFileName( hInst, file_name, sizeof(file_name))) { _splitpath( file_name, drive, dir, fname, NULL ); _makepath( ini_file_name, drive, dir, fname, .properties ); @@ -754,9 +745,6 @@ jk_pool_t *globalPool; jk_bean_t *jkb; jk_env_t *env; - -apr_initialize(); -apr_pool_create( jk_globalPool, NULL ); jk2_pool_apr_create( NULL, globalPool, NULL, jk_globalPool ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/07/01 09:53:55 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Grecefully shutdown the Tomcat when IIS service stops. Revision ChangesPath 1.31 +7 -4 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- jk_isapi_plugin.c 29 Jun 2002 14:17:27 - 1.30 +++ jk_isapi_plugin.c 1 Jul 2002 16:53:55 - 1.31 @@ -524,11 +524,14 @@ { if (is_inited) { is_inited = JK_FALSE; - -/* XXX Here goes a graceful shutdown of jk2, Free resources and pools -*/ +if (workerEnv) { +jk_env_t *env = workerEnv-globalEnv; +workerEnv-close(env, workerEnv); +} +apr_pool_destroy(jk_globalPool); +workerEnv=NULL; +is_mapread = JK_FALSE; } - return TRUE; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
mturk 2002/06/29 07:17:27 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Create the thread when DllMain is called with the DLL_PROCCESS_ATTACH param that starts the jk2 initalization. That enables the inprocess TC to be started, cause it disables the thread locking of DllMain itself. Revision ChangesPath 1.30 +34 -8 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- jk_isapi_plugin.c 9 Jun 2002 03:10:43 - 1.29 +++ jk_isapi_plugin.c 29 Jun 2002 14:17:27 - 1.30 @@ -533,6 +533,19 @@ } +HANDLE jk2_starter_thread = NULL; + +DWORD WINAPI jk2_isapi_starter( LPVOID lpParam ) +{ +initialize_extension(); +if (is_inited) { +if (init_jk(NULL)) +is_mapread = JK_TRUE; +} +return 0; +} + + BOOL WINAPI DllMain(HINSTANCE hInst,// Instance Handle of the DLL ULONG ulReason, // Reason why NT called this DLL LPVOID lpReserved) // Reserved parameter for future use @@ -541,24 +554,37 @@ char drive[_MAX_DRIVE]; char dir[_MAX_DIR]; char fname[_MAX_FNAME]; +DWORD dwThreadId; switch (ulReason) { case DLL_PROCESS_DETACH: __try { +if (jk2_starter_thread) +CloseHandle(jk2_starter_thread); TerminateFilter(HSE_TERM_MUST_UNLOAD); } __except(1) { } break; +case DLL_PROCESS_ATTACH: +if (GetModuleFileName( hInst, file_name, sizeof(file_name))) { +_splitpath( file_name, drive, dir, fname, NULL ); +_makepath( ini_file_name, drive, dir, fname, .properties ); + +jk2_starter_thread = CreateThread( NULL, +0, +jk2_isapi_starter, +NULL, +0, +dwThreadId); + +} else { +fReturn = JK_FALSE; +} +break; default: break; } -if (GetModuleFileName( hInst, file_name, sizeof(file_name))) { -_splitpath( file_name, drive, dir, fname, NULL ); -_makepath( ini_file_name, drive, dir, fname, .properties ); -} else { -fReturn = JK_FALSE; -} return fReturn; } @@ -575,7 +601,7 @@ /* Logging the initialization type: registry or properties file in virtual dir */ if(strlen(worker_file)){ -rc=(JK_OK != workerEnv-config-setPropertyString( env, workerEnv-config, config.file, worker_file )); +rc=(JK_OK == workerEnv-config-setPropertyString( env, workerEnv-config, config.file, worker_file )); } workerEnv-init(env,workerEnv); env-l-jkLog(env, env-l, JK_LOG_INFO, Set serverRoot %s\n, server_root); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2002/06/08 18:55:54 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * Fixing the build in win32 * Cosmetic changes Revision ChangesPath 1.27 +7 -7 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- jk_isapi_plugin.c 7 Jun 2002 23:45:30 - 1.26 +++ jk_isapi_plugin.c 9 Jun 2002 01:55:54 - 1.27 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.26 $ * + * Version: $Revision: 1.27 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -100,7 +100,7 @@ static int iis5 = -1; static jk_workerEnv_t *workerEnv; - +static apr_pool_t *jk_globalPool; static char extension_uri[INTERNET_MAX_URL_LENGTH] = /jakarta/isapi_redirector2.dll; static char worker_file[MAX_PATH * 2] = ; @@ -570,7 +570,10 @@ static int init_jk(char *serverName) { int rc = JK_TRUE; - +/* XXX this need review, works well because the initializations are done at the first request + but in case inits should be splited another time using directly globalEnv here could lead + to subtle problems.. +*/ jk_env_t *env = workerEnv-globalEnv; workerEnv-initData-add( env, workerEnv-initData, serverRoot, workerEnv-pool-pstrdup( env, workerEnv-pool, server_root)); @@ -698,8 +701,6 @@ return JK_TRUE; } -apr_pool_t *jk_globalPool; - /** Basic initialization for jk2. */ @@ -728,13 +729,12 @@ l = jkb-object; env-l=l; -env-soName=env-globalPool-calloc(env, env-globalPool, strlen(file_name)+1); +env-soName=env-globalPool-pstrdup(env, env-globalPool, file_name ); if( env-soName == NULL ){ env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating env-soName\n); return env; } -strcpy(env-soName,file_name); env-l-init(env,env-l); /* We should make it relative to JK_HOME or absolute path. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2002/06/08 19:42:53 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * BUG: Nee to initialize apr before first use Revision ChangesPath 1.28 +4 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- jk_isapi_plugin.c 9 Jun 2002 01:55:54 - 1.27 +++ jk_isapi_plugin.c 9 Jun 2002 02:42:53 - 1.28 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.27 $ * + * Version: $Revision: 1.28 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -78,7 +78,7 @@ #include jk_env.h #include jk_service.h #include jk_worker.h - +#include apr_general.h #include jk_iis.h //#include jk_uri_worker_map.h @@ -710,7 +710,8 @@ jk_pool_t *globalPool; jk_bean_t *jkb; jk_env_t *env; - + +apr_initialize(); apr_pool_create( jk_globalPool, NULL ); jk2_pool_apr_create( NULL, globalPool, NULL, jk_globalPool ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2002/06/08 20:10:43 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * Deleted unused defines Revision ChangesPath 1.29 +1 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- jk_isapi_plugin.c 9 Jun 2002 02:42:53 - 1.28 +++ jk_isapi_plugin.c 9 Jun 2002 03:10:43 - 1.29 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.28 $ * + * Version: $Revision: 1.29 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -83,13 +83,8 @@ //#include jk_uri_worker_map.h #define SERVER_ROOT_TAG (serverRoot) -#define URI_SELECT_TAG (uriSelect) #define EXTENSION_URI_TAG (extensionUri) #define WORKERS_FILE_TAG(workersFile) - -#define URI_SELECT_PARSED_VERB (parsed) -#define URI_SELECT_UNPARSED_VERB(unparsed) -#define URI_SELECT_ESCAPED_VERB (escaped) static char file_name[_MAX_PATH]; -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
costin 2002/06/07 16:45:30 Modified:jk/native2/common jk_logger_file.c jk/native2/server/apache13 mod_jk2.c jk/native2/server/apache2 jk_logger_apache2.c mod_jk2.c jk/native2/server/isapi jk_isapi_plugin.c Log: If APR is available, use it to avoid some ugly vprintf/buf ugliness. Use APR pools if apr is available - there is no point in using the old jk pools if we use APR. Right now the only use of the jk_pool remains apache1.3 when built without APR ( to get around some aledged problems when the binary version of apr won't work with single-threaded apache ). This is also supposed to resolve the crash reported by JFC. Revision ChangesPath 1.24 +47 -1 jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c Index: jk_logger_file.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_logger_file.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- jk_logger_file.c 28 May 2002 22:44:50 - 1.23 +++ jk_logger_file.c 7 Jun 2002 23:45:30 - 1.24 @@ -59,7 +59,7 @@ * Description: Utility functions (mainly configuration) * * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.23 $ * + * Version: $Revision: 1.24 $ * ***/ #include jk_env.h @@ -210,6 +210,51 @@ return JK_OK; } +#ifdef HAS_APR + +static int JK_METHOD jk2_logger_file_jkVLog(jk_env_t *env, jk_logger_t *l, + const char *file, + int line, + int level, + const char *fmt, + va_list args) +{ +int rc = 0; +char *buf; +char *fmt1; +apr_pool_t *aprPool=env-tmpPool-_private; +char rfctime[APR_RFC822_DATE_LEN]; +apr_time_t time = apr_time_now(); + +if( !file || !args) { +return -1; +} + +if(l-logger_private==NULL || + l-level = level) { +char *f = (char *)(file + strlen(file) - 1); + +while(f != file '\\' != *f '/' != *f) { +f--; +} +if(f != file) { +f++; +} + +/* XXX or apr_ctime ? */ +apr_rfc822_date( rfctime, time ); +fmt1=apr_pvsprintf( aprPool, [%s] [%s:%d] %s, rfctime, file, line, fmt ); +buf=apr_pvsprintf( aprPool, fmt, args ); + +l-log(env, l, level, buf); + +} + +return rc; +} + + +#else static int JK_METHOD jk2_logger_file_jkVLog(jk_env_t *env, jk_logger_t *l, const char *file, @@ -284,6 +329,7 @@ return rc; } +#endif static int jk2_logger_file_jkLog(jk_env_t *env, jk_logger_t *l, 1.15 +12 -2 jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c Index: mod_jk2.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache13/mod_jk2.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_jk2.c 24 May 2002 07:12:32 - 1.14 +++ mod_jk2.c 7 Jun 2002 23:45:30 - 1.15 @@ -59,7 +59,7 @@ * Description: Apache 1.3 plugin for Jakarta/Tomcat * * Author: Gal Shachor [EMAIL PROTECTED] * * Henri Gomez [EMAIL PROTECTED] * - * Version: $Revision: 1.14 $ * + * Version: $Revision: 1.15 $ * ***/ /* @@ -130,6 +130,10 @@ return NULL; } +#ifdef HAS_APR +apr_pool_t *jk_globalPool; +#endif + /* Create the initial set of objects. You need to cutpaste this and adapt to your server. */ @@ -139,11 +143,17 @@ jk_pool_t *globalPool; jk_bean_t *jkb; +#ifdef HAS_APR +apr_pool_create( jk_globalPool, NULL ); + +jk2_pool_apr_create( NULL, globalPool, NULL, jk_globalPool ); +#else /** First create a pool. We use the default ( jk ) pool impl, * other choices are apr or native. */ jk2_pool_create( NULL, globalPool, NULL, 2048 ); - +#endif + /** Create the global environment. This will register the default
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 2002/06/05 14:40:09 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * Changed levels for some log messages Revision ChangesPath 1.25 +6 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- jk_isapi_plugin.c 31 May 2002 22:51:28 - 1.24 +++ jk_isapi_plugin.c 5 Jun 2002 21:40:09 - 1.25 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.24 $ * + * Version: $Revision: 1.25 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -475,7 +475,7 @@ worker_name); if( worker==NULL ){ -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_ERROR, HttpExtensionProc worker is NULL\n); return rc; } @@ -484,7 +484,7 @@ rPool= worker-rPoolCache-get( env, worker-rPoolCache ); if( rPool == NULL ) { rPool=worker-mbean-pool-create( env, worker-mbean-pool, HUGE_POOL_SIZE ); -env-l-jkLog(env, env-l, JK_LOG_INFO, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, HttpExtensionProc: new rpool\n); } @@ -580,7 +580,7 @@ rc=(JK_OK != workerEnv-config-setPropertyString( env, workerEnv-config, config.file, worker_file )); } workerEnv-init(env,workerEnv); -env-l-jkLog(env, env-l, JK_LOG_ERROR, Set serverRoot %s\n, server_root); +env-l-jkLog(env, env-l, JK_LOG_INFO, Set serverRoot %s\n, server_root); if (using_ini_file) { env-l-jkLog(env, env-l, JK_LOG_DEBUG, Using ini file %s.\n, ini_file_name); } else { @@ -763,10 +763,10 @@ jk_env_t *env; if( workerEnv==NULL ) { env = jk2_create_workerEnv(); -env-l-jkLog(env, env-l, JK_LOG_ERROR, JK2 Config Created); +env-l-jkLog(env, env-l, JK_LOG_INFO, JK2 Config Created); } else { env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); -env-l-jkLog(env, env-l, JK_LOG_ERROR, JK2 Config Reused); +env-l-jkLog(env, env-l, JK_LOG_INFO, JK2 Config Reused); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
costin 2002/05/31 15:51:29 Modified:jk/native2/common jk_mutex_thread.c jk_worker_ajp13.c jk/native2/include jk_config.h jk/native2/server/isapi jk_isapi_plugin.c Log: Fix the windows build for isapi ( nacho: I moved jk_map_read to jk_config_file_read, and I'll try to get a jk_config_registry to work ). Fixed the default lb_factor ( 1 instead of 0, 0 means local ) Revision ChangesPath 1.2 +1 -1 jakarta-tomcat-connectors/jk/native2/common/jk_mutex_thread.c Index: jk_mutex_thread.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_mutex_thread.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_mutex_thread.c 31 May 2002 17:52:05 - 1.1 +++ jk_mutex_thread.c 31 May 2002 22:51:28 - 1.2 @@ -130,7 +130,7 @@ { jk_mutex_t *jkMutex=mutexB-object; -if( jkMutex==NULL || jkMutex-threadMutex==NULL ) return JK_ERR; +if( jkMutex==NULL ) return JK_ERR; DeleteCriticalSection( jkMutex-threadMutex ); return JK_OK; } 1.28 +2 -1 jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c Index: jk_worker_ajp13.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_worker_ajp13.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- jk_worker_ajp13.c 31 May 2002 18:21:00 - 1.27 +++ jk_worker_ajp13.c 31 May 2002 22:51:28 - 1.28 @@ -810,7 +810,8 @@ w-channel= NULL; w-secret= NULL; - + +w-lb_factor=1; w-service = jk2_worker_ajp13_service; result-setAttribute= jk2_worker_ajp13_setAttribute; 1.9 +2 -0 jakarta-tomcat-connectors/jk/native2/include/jk_config.h Index: jk_config.h === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_config.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- jk_config.h 31 May 2002 17:49:07 - 1.8 +++ jk_config.h 31 May 2002 22:51:28 - 1.9 @@ -143,6 +143,8 @@ struct jk_pool *resultPool, char *value); +int jk2_config_file_read(struct jk_env *env, struct jk_map *m,const char *file); + int jk2_config_processNode(struct jk_env *env, struct jk_config *cfg, char *name, int firstTime ); 1.24 +3 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- jk_isapi_plugin.c 29 May 2002 01:16:40 - 1.23 +++ jk_isapi_plugin.c 31 May 2002 22:51:28 - 1.24 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.23 $ * + * Version: $Revision: 1.24 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -611,7 +611,7 @@ jk_map_t *map; if (JK_OK==jk2_map_default_create(env, map, workerEnv-pool )) { -if (JK_OK==jk2_map_read(env,map, ini_file_name)) { +if (JK_OK==jk2_config_file_read(env,map, ini_file_name)) { tmp = map-get(env,map,EXTENSION_URI_TAG); if (tmp) { strcpy(extension_uri, tmp); @@ -772,4 +772,4 @@ return env; -} \ No newline at end of file +} -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/05/28 17:10:18 Modified:jk/native2/common jk_config.c jk_endpoint.c jk_env.c jk_registry.c jk_registry.h jk_workerEnv.c jk/native2/include jk_config.h jk_env.h jk_workerEnv.h jk/native2/jni jk_jni_aprImpl.c jk/native2/server/isapi jk_isapi_plugin.c Log: * Native win32 logger is the default for IIS * Uri parse option now it's part of the standard wk2.p, deleted registry key and asociated defines, and changed code to use workerEnv-options * Added env-SoName for the win32 logger registry settings * Added workerEnv-logger_name and used it at init to use some logger different form default one ( currently logger.file only ) * Reordered initializations, to read first the config file, and later try to initialize the logger. Revision ChangesPath 1.22 +59 -52jakarta-tomcat-connectors/jk/native2/common/jk_config.c Index: jk_config.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_config.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- jk_config.c 23 May 2002 14:54:07 - 1.21 +++ jk_config.c 29 May 2002 00:10:17 - 1.22 @@ -58,7 +58,7 @@ /*** * Description: General purpose config object * * Author: Gal Shachor [EMAIL PROTECTED] * - * Version: $Revision: 1.21 $ * + * Version: $Revision: 1.22 $ * ***/ #include jk_global.h @@ -439,61 +439,69 @@ * and any removal may have disastrous consequences. Using critical * sections would drastically affect the performance. */ -static int jk2_config_processConfigData(jk_env_t *env, jk_config_t *cfg, -jk_map_t *cfgData, int firstTime ) +static int jk2_config_processConfigData(jk_env_t *env, jk_config_t *cfg,int firstTime ) { int i; -int j; +int rc; -for( i=0; icfgData-size( env, cfgData ); i++ ) { -char *name=cfgData-nameAt(env, cfgData, i); -jk_map_t *prefNode=cfgData-valueAt(env, cfgData, i); -jk_bean_t *bean; -int ver; -char *verString; - -bean=env-getBean( env, name ); -if( bean==NULL ) { -if( cfg-mbean-debug 0 ) { -env-l-jkLog(env, env-l, JK_LOG_INFO, - config.setConfig(): Creating %s\n, name ); -} -bean=env-createBean( env, cfg-pool, name ); -} +for( i=0; icfg-cfgData-size( env, cfg-cfgData ); i++ ) { +char *name=cfg-cfgData-nameAt(env, cfg-cfgData, i); +rc=cfg-processNode(env, cfg , name, firstTime); +} +return rc; +} -if( bean == NULL ) { -/* Can't create it, save the value in our map */ -env-l-jkLog(env, env-l, JK_LOG_ERROR, - config.update(): Can't create %s\n, name ); -continue; +static int jk2_config_processNode(jk_env_t *env, jk_config_t *cfg, char *name, int firstTime ) +{ +int j; + +jk_map_t *prefNode=cfg-cfgData-get(env, cfg-cfgData, name); +jk_bean_t *bean; +int ver; +char *verString; + +bean=env-getBean( env, name ); +if( bean==NULL ) { +if( cfg-mbean-debug 0 ) { +env-l-jkLog(env, env-l, JK_LOG_INFO, + config.setConfig(): Creating %s\n, name ); } +bean=env-createBean( env, cfg-pool, name ); +} -verString= prefNode-get( env, prefNode, ver ); -if( !firstTime ) { -if( verString == NULL ) continue; - -ver=atoi( verString ); - -if( ver = bean-ver) { -/* Object didn't change - */ -continue; -} +if( bean == NULL ) { +/* Can't create it, save the value in our map */ +env-l-jkLog(env, env-l, JK_LOG_ERROR, + config.update(): Can't create %s\n, name ); +return JK_ERR; +} + +verString= prefNode-get( env, prefNode, ver ); +if( !firstTime ) { +if( verString == NULL ) { +return JK_OK; } +ver=atoi( verString ); -if( !firstTime ) -env-l-jkLog(env, env-l, JK_LOG_INFO, - config.update(): Updating %s\n, name ); - -/* XXX Maybe we shoud destroy/init ? */ - -for( j=0;
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/05/28 17:50:50 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * default win32 native logger needs to be inited before first use, to make the needed registry changes. XXX Need a way to undone this registry mods? Revision ChangesPath 1.21 +5 -3 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- jk_isapi_plugin.c 29 May 2002 00:10:18 - 1.20 +++ jk_isapi_plugin.c 29 May 2002 00:50:49 - 1.21 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.20 $ * + * Version: $Revision: 1.21 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -728,8 +728,8 @@ l = jkb-object; env-l=l; - env-soName=env-globalPool-calloc(env, env-globalPool, strlen(file_name)+1); +env-l-init(env,env-l); if( env-soName == NULL ){ env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating env-soName\n); @@ -762,11 +762,13 @@ jk_env_t *env; if( workerEnv==NULL ) { env = jk2_create_workerEnv(); +env-l-jkLog(env, env-l, JK_LOG_ERROR, JK2 Config Created); } else { env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +env-l-jkLog(env, env-l, JK_LOG_ERROR, JK2 Config Reused); } -env-l-jkLog(env, env-l, JK_LOG_ERROR, JK2 Config Created); + return env; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/05/28 17:59:33 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * Oops, init needs to be after setting soName Revision ChangesPath 1.22 +3 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- jk_isapi_plugin.c 29 May 2002 00:50:49 - 1.21 +++ jk_isapi_plugin.c 29 May 2002 00:59:33 - 1.22 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.21 $ * + * Version: $Revision: 1.22 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -729,13 +729,14 @@ env-l=l; env-soName=env-globalPool-calloc(env, env-globalPool, strlen(file_name)+1); -env-l-init(env,env-l); if( env-soName == NULL ){ env-l-jkLog(env, env-l, JK_LOG_ERROR, Error creating env-soName\n); return env; } strcpy(env-soName,file_name); +env-l-init(env,env-l); + /* We should make it relative to JK_HOME or absolute path. ap_server_root_relative(cmd-pool,opt); */ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/05/28 18:16:40 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * logger reconfigurations need to be done at globalEnv. XXX Thread issues, isapi needs a complete revamp of initialization, now is a mess, works, but needs a complete rewrite Revision ChangesPath 1.23 +2 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- jk_isapi_plugin.c 29 May 2002 00:59:33 - 1.22 +++ jk_isapi_plugin.c 29 May 2002 01:16:40 - 1.23 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.22 $ * + * Version: $Revision: 1.23 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -571,7 +571,7 @@ { int rc = JK_TRUE; -jk_env_t *env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); +jk_env_t *env = workerEnv-globalEnv; workerEnv-initData-add( env, workerEnv-initData, serverRoot, workerEnv-pool-pstrdup( env, workerEnv-pool, server_root)); /* Logging the initialization type: registry or properties file in virtual dir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
Added few #ifdefs to make it compile with my version of MSVC ( probably an old one ). It's not a new MSVC version, You need to download the Microsoft Platform SDK, to get the includes and libs needed to compile an isapi_redirector2.dll with all the later developments, mainly to be able to specify tomcatAuthentication=false on iis5, that is to be able to use Native IIS Auth on tomcat, so i would prefer very much to add the needed info to some readme, than to permit to build a non Complete i_r2.dll Saludos , Ignacio J. Ortega -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
On Thu, 23 May 2002, Ignacio J. Ortega wrote: Added few #ifdefs to make it compile with my version of MSVC ( probably an old one ). It's not a new MSVC version, You need to download the Microsoft Platform SDK, to get the includes and libs needed to compile an isapi_redirector2.dll with all the later developments, mainly to be able to specify tomcatAuthentication=false on iis5, that is to be able to use Native IIS Auth on tomcat, so i would prefer very much to add the needed info to some readme, than to permit to build a non Complete i_r2.dll Well, I don't think it hurts too much to allow a build with the 'plain' MSVC ( just 3 #ifdefs, the code is reasonably clean ). I'll try to get the SDK, but if it requires me to signon ( to passport :-) - I'll give up. I assume some ISAPI servers ( and PWS ) do not support the new stuff anyway. I'm fine with requiring the MP SDK if it's easy to download, but at least for now I would prefer beeing able to compile with a plain MSVC. Costin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
costin 02/05/22 16:48:18 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Added few #ifdefs to make it compile with my version of MSVC ( probably an old one ). Nacho - let me know if it brakes your build ( but it shouldn't ) Revision ChangesPath 1.18 +33 -11 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- jk_isapi_plugin.c 19 May 2002 21:44:23 - 1.17 +++ jk_isapi_plugin.c 22 May 2002 23:48:17 - 1.18 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.17 $ * + * Version: $Revision: 1.18 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -161,13 +161,21 @@ if (pVer-dwFilterVersion http_filter_revision) { pVer-dwFilterVersion = http_filter_revision; } + +#ifdef SF_NOTIFY_AUTH_COMPLETE pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| SF_NOTIFY_SECURE_PORT | SF_NOTIFY_NONSECURE_PORT| SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_AUTH_COMPLETE; - +#else + pVer-dwFlags = SF_NOTIFY_ORDER_HIGH| +SF_NOTIFY_SECURE_PORT | +SF_NOTIFY_NONSECURE_PORT| +SF_NOTIFY_PREPROC_HEADERS; +#endif + strcpy(pVer-lpszFilterDesc, VERSION_STRING); if (!is_inited) { @@ -212,11 +220,18 @@ } } } +#ifdef SF_NOTIFY_AUTH_COMPLETE if (is_inited (((SF_NOTIFY_PREPROC_HEADERS == dwNotificationType) !iis5) || ((SF_NOTIFY_AUTH_COMPLETE == dwNotificationType) iis5) ) ) +#else + if (is_inited + (((SF_NOTIFY_PREPROC_HEADERS == dwNotificationType) !iis5) + ) + ) +#endif { char uri[INTERNET_MAX_URL_LENGTH]; char snuri[INTERNET_MAX_URL_LENGTH]=/; @@ -233,15 +248,22 @@ DWORD szHost = sizeof(Host); DWORD szTranslate = sizeof(Translate); - if (iis5) { - GetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-GetHeader; - SetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-SetHeader; - AddHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-AddHeader; - } else { - GetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-GetHeader; - SetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-SetHeader; - AddHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-AddHeader; - } +#ifdef SF_NOTIFY_AUTH_COMPLETE + if (iis5) { + GetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-GetHeader; + SetHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-SetHeader; + AddHeader=((PHTTP_FILTER_AUTH_COMPLETE_INFO)pvNotification)-AddHeader; + } else { + GetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-GetHeader; + SetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-SetHeader; + AddHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-AddHeader; + } +#else + GetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-GetHeader; + SetHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-SetHeader; + AddHeader=((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)-AddHeader; +#endif + env-l-jkLog(env, env-l, JK_LOG_DEBUG, -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/05/19 14:44:23 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * If workerEnv is already created use it, instead of trying to create another. Revision ChangesPath 1.17 +4 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- jk_isapi_plugin.c 18 May 2002 22:38:11 - 1.16 +++ jk_isapi_plugin.c 19 May 2002 21:44:23 - 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 @@ -780,7 +780,9 @@ { jk_env_t *env; if( workerEnv==NULL ) { -env=jk2_create_workerEnv(); +env = jk2_create_workerEnv(); +} else { +env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); } env-l-jkLog(env, env-l, JK_LOG_ERROR, JK2 Config Created); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/05/18 15:38:11 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * Better messages * Adding some more checks when allocating maps Revision ChangesPath 1.16 +94 -104 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- jk_isapi_plugin.c 11 May 2002 01:44:13 - 1.15 +++ jk_isapi_plugin.c 18 May 2002 22:38:11 - 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 @@ -82,10 +82,10 @@ #include jk_iis.h //#include jk_uri_worker_map.h -#define WORKERS_FILE_TAG (worker_file) -#define SERVER_ROOT_TAG (server_root) -#define URI_SELECT_TAG (uri_select) -#define EXTENSION_URI_TAG (extension_uri) +#define SERVER_ROOT_TAG (serverRoot) +#define URI_SELECT_TAG (uriSelect) +#define EXTENSION_URI_TAG (extensionUri) +#define WORKERS_FILE_TAG (workersFile) #define URI_SELECT_PARSED_VERB (parsed) #define URI_SELECT_UNPARSED_VERB(unparsed) @@ -116,9 +116,9 @@ static int init_jk(char *serverName); -static int initialize_extension(void); +static int initialize_extension(); -static int read_registry_init_data(void); +static int read_registry_init_data(jk_env_t *env); static int get_registry_config_parameter(HKEY hkey, const char *tag, @@ -556,12 +556,11 @@ { int rc = JK_FALSE; -jk_env_t *env=jk2_create_config(); - -rc=(JK_OK == workerEnv-config-setPropertyString( env, workerEnv-config, config.file, worker_file )); - +jk_env_t *env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); /* Logging the initialization type: registry or properties file in virtual dir */ +//rc=(JK_OK == workerEnv-config-update( env, workerEnv-config, NULL)); +rc=(JK_OK == workerEnv-config-setPropertyString( env, workerEnv-config, config.file, worker_file )); if (using_ini_file) { env-l-jkLog(env, env-l, JK_LOG_DEBUG, Using ini file %s.\n, ini_file_name); } else { @@ -577,9 +576,13 @@ return rc; } -static int initialize_extension(void) +static int initialize_extension() { -if (read_registry_init_data()) { +jk_env_t *env=jk2_create_config(); +if (read_registry_init_data(env)) { +workerEnv-initData-add( env, workerEnv-initData, serverRoot, + workerEnv-pool-pstrdup( env, workerEnv-pool, server_root)); +env-l-jkLog(env, env-l, JK_LOG_ERROR, Set serverRoot %s\n, server_root); is_inited = JK_TRUE; } return is_inited; @@ -602,106 +605,99 @@ return -1; } -static int read_registry_init_data(void) +static int read_registry_init_data(jk_env_t *env) { char tmpbuf[INTERNET_MAX_URL_LENGTH]; HKEY hkey; long rc; int ok = JK_TRUE; -/* char *tmp; jk_map_t *map; - -if (map_alloc(map)) { -if (map_read_properties(map, ini_file_name)) { -using_ini_file = JK_TRUE; - } -} -if (using_ini_file) { -tmp = map_get_string(map, JK_LOG_FILE_TAG, NULL); -if (tmp) { -strcpy(log_file, tmp); -} else { -ok = JK_FALSE; -} -tmp = map_get_string(map, JK_LOG_LEVEL_TAG, NULL); -if (tmp) { -log_level = jk2_logger_file_parseLogLevel(tmp); -} else { -ok = JK_FALSE; -} -tmp = map_get_string(map, EXTENSION_URI_TAG, NULL); -if (tmp) { -strcpy(extension_uri, tmp); -} else { -ok = JK_FALSE; -} -tmp = map_get_string(map, SERVER_ROOT_TAG, NULL); -if (tmp) { -strcpy(server_root, tmp); -} else { -ok = JK_FALSE; -} -tmp = map_get_string(map, URI_SELECT_TAG, NULL); -if (tmp) { -int opt = parse_uri_select(tmp); -if (opt = 0) { -uri_select_option = opt; +
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c
nacho 02/05/10 16:15:35 Modified:jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c Log: * JK2 isapi redirector is working!! Found the latest blocking bug, now needs extensive testing :) Revision ChangesPath 1.14 +9 -6 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- jk_isapi_plugin.c 4 May 2002 19:06:31 - 1.13 +++ jk_isapi_plugin.c 10 May 2002 23:15:35 - 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 @@ -181,8 +181,8 @@ DWORD dwNotificationType, LPVOID pvNotification) { -jk_env_t *env; -jk_uriEnv_t *uriEnv; +jk_env_t *env=NULL; +jk_uriEnv_t *uriEnv=NULL; /* Initialise jk */ if (is_inited !is_mapread) { @@ -480,6 +480,12 @@ if (JK_OK == worker-service(env, worker, s)){ rc=HSE_STATUS_SUCCESS; +lpEcb-dwHttpStatusCode = HTTP_STATUS_OK; +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + HttpExtensionProc service() returned OK\n); +} else { +env-l-jkLog(env, env-l, JK_LOG_DEBUG, + HttpExtensionProc service() Failed\n); } s-afterRequest(env, s); @@ -488,9 +494,6 @@ rc1=worker-rPoolCache-put( env, worker-rPoolCache, rPool ); -lpEcb-dwHttpStatusCode = HTTP_STATUS_OK; -env-l-jkLog(env, env-l, JK_LOG_DEBUG, - HttpExtensionProc service() returned OK\n); } else { env-l-jkLog(env, env-l, JK_LOG_ERROR, HttpExtensionProc error, not initialized\n); 1.15 +1 -0 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c Index: jk_service_iis.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- jk_service_iis.c 4 May 2002 19:06:31 - 1.14 +++ jk_service_iis.c 10 May 2002 23:15:35 - 1.15 @@ -143,6 +143,7 @@ strcat(headers_str, s-headers_out-valueAt(env,s-headers_out,i)); strcat(headers_str, crlf); } +strcat(headers_str, crlf); } else { headers_str = crlf; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/05/10 18:44:13 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: * Fixed jkstatus, now works in IIS too Revision ChangesPath 1.15 +2 -1 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- jk_isapi_plugin.c 10 May 2002 23:15:35 - 1.14 +++ jk_isapi_plugin.c 11 May 2002 01:44:13 - 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 @@ -474,6 +474,7 @@ s-response_started = JK_FALSE; s-content_read = 0; s-ws_private = lpEcb; +s-workerEnv = workerEnv; /* Initialize the ws_service structure */ s-init( env, s, worker, lpEcb ); -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c
nacho 02/05/04 12:06:31 Modified:jk/native2/server/isapi jk_isapi_plugin.c jk_service_iis.c Log: * Fixed it seems that the pool now resides at the mbean Revision ChangesPath 1.13 +2 -2 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- jk_isapi_plugin.c 1 May 2002 22:23:36 - 1.12 +++ jk_isapi_plugin.c 4 May 2002 19:06:31 - 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 @@ -463,7 +463,7 @@ be shared with other server adapters */ rPool= worker-rPoolCache-get( env, worker-rPoolCache ); if( rPool == NULL ) { -rPool=worker-pool-create( env, worker-pool, HUGE_POOL_SIZE ); +rPool=worker-mbean-pool-create( env, worker-mbean-pool, HUGE_POOL_SIZE ); env-l-jkLog(env, env-l, JK_LOG_INFO, HttpExtensionProc: new rpool\n); } 1.14 +11 -11 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c Index: jk_service_iis.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_service_iis.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- jk_service_iis.c 1 May 2002 22:23:36 - 1.13 +++ jk_service_iis.c 4 May 2002 19:06:31 - 1.14 @@ -285,26 +285,26 @@ s-jvm_route = NULL; -GET_SERVER_VARIABLE_VALUE(w-pool,HTTP_URI_HEADER_NAME, s-req_uri); -GET_SERVER_VARIABLE_VALUE(w-pool,HTTP_QUERY_HEADER_NAME, s-query_string); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,HTTP_URI_HEADER_NAME, s-req_uri); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,HTTP_QUERY_HEADER_NAME, s-query_string); if (s-req_uri == NULL) { s-query_string = lpEcb-lpszQueryString; /* *worker_name= DEFAULT_WORKER_NAME; */ -GET_SERVER_VARIABLE_VALUE(w-pool,URL, s-req_uri); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,URL, s-req_uri); if (jk_requtil_unescapeUrl(s-req_uri) 0) return JK_ERR; jk_requtil_getParents(s-req_uri); } -GET_SERVER_VARIABLE_VALUE(w-pool,AUTH_TYPE, s-auth_type); -GET_SERVER_VARIABLE_VALUE(w-pool,REMOTE_USER, s-remote_user); -GET_SERVER_VARIABLE_VALUE(w-pool,SERVER_PROTOCOL, s-protocol); -GET_SERVER_VARIABLE_VALUE(w-pool,REMOTE_HOST, s-remote_host); -GET_SERVER_VARIABLE_VALUE(w-pool,REMOTE_ADDR, s-remote_addr); -GET_SERVER_VARIABLE_VALUE(w-pool,SERVER_NAME, s-server_name); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,AUTH_TYPE, s-auth_type); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,REMOTE_USER, s-remote_user); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,SERVER_PROTOCOL, s-protocol); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,REMOTE_HOST, s-remote_host); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,REMOTE_ADDR, s-remote_addr); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,SERVER_NAME, s-server_name); GET_SERVER_VARIABLE_VALUE_INT(SERVER_PORT, s-server_port, 80); -GET_SERVER_VARIABLE_VALUE(w-pool,SERVER_SOFTWARE, s-server_software); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,SERVER_SOFTWARE, s-server_software); GET_SERVER_VARIABLE_VALUE_INT(SERVER_PORT_SECURE, s-is_ssl, 0); s-method = lpEcb-lpszMethod; @@ -352,7 +352,7 @@ unsigned num_of_vars = 0; for(i = 0 ; i 9 ; i++) { -GET_SERVER_VARIABLE_VALUE(w-pool,ssl_env_names[i], ssl_env_values[i]); +GET_SERVER_VARIABLE_VALUE(w-mbean-pool,ssl_env_names[i], ssl_env_values[i]); if (ssl_env_values[i]) { num_of_vars++; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c jk_iis.h
nacho 02/04/24 16:00:14 Modified:jk/native2/server/isapi jk_isapi_plugin.c jk_iis.h Log: * Reading the config file * Removed some debug code * Load and does some logging :) XXX: trying ajp13 worker issues a NPE, needs absolute paths for be able to log. Revision ChangesPath 1.8 +14 -23 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jk_isapi_plugin.c 20 Apr 2002 03:06:18 - 1.7 +++ jk_isapi_plugin.c 24 Apr 2002 23:00:14 - 1.8 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.7 $ * + * Version: $Revision: 1.8 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -105,7 +105,6 @@ static char worker_file[MAX_PATH * 2]; static char server_root[MAX_PATH * 2]; -FILE *fLog; #define URI_SELECT_OPT_PARSED 0 @@ -117,9 +116,9 @@ static int init_jk(char *serverName); -static int initialize_extension(void); +static int initialize_extension(); -static int read_registry_init_data(void); +static int read_registry_init_data(); static int get_registry_config_parameter(HKEY hkey, const char *tag, @@ -172,11 +171,9 @@ strcpy(pVer-lpszFilterDesc, VERSION_STRING); if (!is_inited) { -fprintf(fLog,GetFilterVersion::!is_inited\n); return initialize_extension(); } -fprintf(fLog,GetFilterVersion::Return TRUE\n); return TRUE; } @@ -412,7 +409,6 @@ if (!is_inited) { return initialize_extension(); } - return TRUE; } @@ -523,9 +519,6 @@ char dir[_MAX_DIR]; char fname[_MAX_FNAME]; char file_name[_MAX_PATH]; - -fLog=fopen(c:\\isapi.log,a); -fprintf(fLog,DllMain::ulReason=%d\n,ulReason); switch (ulReason) { case DLL_PROCESS_DETACH: @@ -544,8 +537,6 @@ } else { fReturn = JK_FALSE; } -fprintf(fLog,DllMain::fReturn=%d\n,fReturn); -fclose(fLog); return fReturn; } @@ -553,8 +544,10 @@ { int rc = JK_FALSE; -jk_env_t *env=jk2_create_config(); - +jk_env_t *env=jk2_create_config(); + +rc=workerEnv-config-setPropertyString( env, workerEnv-config, config.file, worker_file ); + /* Logging the initialization type: registry or properties file in virtual dir */ if (using_ini_file) { @@ -571,13 +564,11 @@ return rc; } -static int initialize_extension(void) +static int initialize_extension() { -fprintf(fLog,initialize_extension::is_inited=%d\n,is_inited); if (read_registry_init_data()) { is_inited = JK_TRUE; } -fprintf(fLog,initialize_extension::is_inited=%d\n,is_inited); return is_inited; } @@ -598,7 +589,7 @@ return -1; } -static int read_registry_init_data(void) +static int read_registry_init_data() { char tmpbuf[INTERNET_MAX_URL_LENGTH]; HKEY hkey; @@ -658,7 +649,7 @@ return JK_FALSE; } -if(get_registry_config_parameter(hkey, +if(rc=get_registry_config_parameter(hkey, EXTENSION_URI_TAG, tmpbuf, sizeof(extension_uri))) { @@ -667,7 +658,7 @@ ok = JK_FALSE; } -if(get_registry_config_parameter(hkey, +if(rc=get_registry_config_parameter(hkey, SERVER_ROOT_TAG, tmpbuf, sizeof(server_root))) { @@ -675,7 +666,7 @@ } else { ok = JK_FALSE; } -if(get_registry_config_parameter(hkey, +if(rc=get_registry_config_parameter(hkey, JK_WORKER_FILE_TAG, tmpbuf, sizeof(worker_file))) { @@ -684,7 +675,7 @@ ok = JK_FALSE; } -if(get_registry_config_parameter(hkey, +
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/04/24 16:06:07 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Doh, Build then commit ;) Revision ChangesPath 1.9 +9 -9 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- jk_isapi_plugin.c 24 Apr 2002 23:00:14 - 1.8 +++ jk_isapi_plugin.c 24 Apr 2002 23:06:07 - 1.9 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.8 $ * + * Version: $Revision: 1.9 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -116,9 +116,9 @@ static int init_jk(char *serverName); -static int initialize_extension(); +static int initialize_extension(void); -static int read_registry_init_data(); +static int read_registry_init_data(void); static int get_registry_config_parameter(HKEY hkey, const char *tag, @@ -564,7 +564,7 @@ return rc; } -static int initialize_extension() +static int initialize_extension(void) { if (read_registry_init_data()) { is_inited = JK_TRUE; @@ -589,7 +589,7 @@ return -1; } -static int read_registry_init_data() +static int read_registry_init_data(void) { char tmpbuf[INTERNET_MAX_URL_LENGTH]; HKEY hkey; @@ -649,7 +649,7 @@ return JK_FALSE; } -if(rc=get_registry_config_parameter(hkey, +if(get_registry_config_parameter(hkey, EXTENSION_URI_TAG, tmpbuf, sizeof(extension_uri))) { @@ -658,7 +658,7 @@ ok = JK_FALSE; } -if(rc=get_registry_config_parameter(hkey, +if(get_registry_config_parameter(hkey, SERVER_ROOT_TAG, tmpbuf, sizeof(server_root))) { @@ -666,7 +666,7 @@ } else { ok = JK_FALSE; } -if(rc=get_registry_config_parameter(hkey, +if(get_registry_config_parameter(hkey, JK_WORKER_FILE_TAG, tmpbuf, sizeof(worker_file))) { @@ -675,7 +675,7 @@ ok = JK_FALSE; } -if(rc=get_registry_config_parameter(hkey, +if(get_registry_config_parameter(hkey, URI_SELECT_TAG, tmpbuf, sizeof(tmpbuf))) { @@ -776,7 +776,7 @@ jk_uriEnv_t *newUri; jk_bean_t *jkb; jk_env_t *env; - if( workerEnv==NULL ) { +if( workerEnv==NULL ) { env=jk2_create_workerEnv(); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
nacho 02/04/18 12:46:31 Added: jk/native2/server/isapi jk_isapi_plugin.c Log: * Work in progess.. doesnt compile Revision ChangesPath 1.1 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === /* = * * * * The Apache Software License, Version 1.1 * * * * Copyright (c) 1999-2001 The Apache Software Foundation. * * All rights reserved.* * * * = * * * * Redistribution and use in source and binary forms, with or without modi- * * fication, are permitted provided that the following conditions are met: * * * * 1. Redistributions of source code must retain the above copyright notice * *notice, this list of conditions and the following disclaimer. * * * * 2. Redistributions in binary form must reproduce the above copyright * *notice, this list of conditions and the following disclaimer in the * *documentation and/or other materials provided with the distribution. * * * * 3. The end-user documentation included with the redistribution, if any, * *must include the following acknowlegement: * * * * This product includes software developed by the Apache Software * *Foundation http://www.apache.org/. * * * *Alternately, this acknowlegement may appear in the software itself, if * *and wherever such third-party acknowlegements normally appear. * * * * 4. The names The Jakarta Project, Jk, and Apache Software * *Foundation must not be used to endorse or promote products derived * *from this software without prior written permission. For written * *permission, please contact [EMAIL PROTECTED].* * * * 5. Products derived from this software may not be called Apache nor may * *Apache appear in their names without prior written permission of the * *Apache Software Foundation.* * * * THIS SOFTWARE IS PROVIDED AS IS AND ANY EXPRESSED OR IMPLIED WARRANTIES * * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY * * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * * POSSIBILITY OF SUCH DAMAGE. * * * * = * * * * This software consists of voluntary contributions made by many indivi- * * duals on behalf of the Apache Software Foundation. For more information * * on the Apache Software Foundation, please see http://www.apache.org/. * * * * = */ /*** * Description: ISAPI plugin for IIS/PWS
cvs commit: jakarta-tomcat-connectors/jk/native2/server/isapi jk_isapi_plugin.c
costin 02/04/18 20:31:05 Modified:jk/native2/server/isapi jk_isapi_plugin.c Log: Few more changes. I would brake the FilterProc in fewer smaller methods - and maybe move some code into jk_uriMap.c ( if it's general-purpose ) or remove it ( if it's already done in jk_uriMap.c. In the end, FilterProc should only call the uriMap - everything else should be shared. Revision ChangesPath 1.4 +75 -78 jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c Index: jk_isapi_plugin.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_isapi_plugin.c 19 Apr 2002 00:23:45 - 1.3 +++ jk_isapi_plugin.c 19 Apr 2002 03:31:05 - 1.4 @@ -60,7 +60,7 @@ * Author: Gal Shachor [EMAIL PROTECTED] * * Author: Larry Isaacs [EMAIL PROTECTED] * * Author: Ignacio J. Ortega [EMAIL PROTECTED] * - * Version: $Revision: 1.3 $ * + * Version: $Revision: 1.4 $ * ***/ // This define is needed to include wincrypt,h, needed to get client certificates @@ -91,7 +91,6 @@ static int iis5 = -1; static jk_workerEnv_t *workerEnv; -static jk_logger_t *logger = NULL; static char extension_uri[INTERNET_MAX_URL_LENGTH] = /jakarta/isapi_redirector2.dll; @@ -185,6 +184,8 @@ DWORD dwNotificationType, LPVOID pvNotification) { +jk_env_t *env = workerEnv-globalEnv-getEnv( workerEnv-globalEnv ); + /* Initialise jk */ if (is_inited !is_mapread) { char serverName[MAX_SERVERNAME]; @@ -207,9 +208,9 @@ 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); + env-l-jkLog(env, env-l, JK_LOG_INFO,Detected IIS = 5.0\n); } else { - jk_log(logger, JK_LOG_INFO,Detected IIS 5.0\n); + env-l-jkLog(env, env-l, JK_LOG_INFO,Detected IIS 5.0\n); } } } @@ -246,7 +247,7 @@ } -jk_log(logger, JK_LOG_DEBUG, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, HttpFilterProc started\n); @@ -259,7 +260,7 @@ SetHeader(pfc, TOMCAT_TRANSLATE_HEADER_NAME, NULL); if (!GetHeader(pfc, url, (LPVOID)uri, (LPDWORD)sz)) { -jk_log(logger, JK_LOG_ERROR, +env-l-jkLog(env, env-l, JK_LOG_ERROR, HttpFilterProc error while getting the url\n); return SF_STATUS_REQ_ERROR; } @@ -274,7 +275,7 @@ rc = unescape_url(uri); if (rc == BAD_REQUEST) { -jk_log(logger, JK_LOG_ERROR, +env-l-jkLog(env, env-l, JK_LOG_ERROR, HttpFilterProc [%s] contains one or more invalid escape sequences.\n, uri); write_error_response(pfc,400 Bad Request, @@ -282,7 +283,7 @@ return SF_STATUS_REQ_FINISHED; } else if(rc == BAD_PATH) { -jk_log(logger, JK_LOG_EMERG, +env-l-jkLog(env, env-l, JK_LOG_EMERG, HttpFilterProc [%s] contains forbidden escape sequences.\n, uri); write_error_response(pfc,403 Forbidden, @@ -294,13 +295,13 @@ if(GetHeader(pfc, Host:, (LPVOID)Host, (LPDWORD)szHost)) { strcat(snuri,Host); strcat(snuri,uri); -jk_log(logger, JK_LOG_DEBUG, +env-l-jkLog(env, env-l, 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, +env-l-jkLog(env, env-l, JK_LOG_DEBUG, In HttpFilterProc test Default redirection of %s\n, uri); //worker = map_uri_to_worker(uw_map, uri, logger); @@ -310,7 +311,7 @@ char *forwardURI; /* This is a servlet,