Re: [BUGS: 9913, 10789] Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c

2002-07-18 Thread Mark Miesfeld

On Fri, 19 Jul 2002 13:57:22 +1000 (EST), Bojan Smojver wrote:

: My experience from 1.2.0 is similar to Mark's with 2.x - the handler never gets
: called because the r-handler is DIR_MAGIC_TYPE, not JK_HANDLER. So, I think
: Mark's code would be the real fix for both - giving Apache a hint that the
: handler is JK_HANDLER.
:
:  ...
:
: Mladen, what's your take on all this? Do you have a setup handy to verify that
: the changing of hook ordering fixed the problem in mod_jk2?
:
: Mark, does the fix in mod_jk2 work in your environment?

I was just getting ready to post something saying the fix seems to break
mod_jk2 altogether for me.

For one thing, I think, if jk2_map_to_storage is invoked before
jk2_translate then mod_jk2 is going to return DECLINED all the time.
Which is what I am seeing.  Nothing gets sent over to tomcat.

For example:

jk2_map_to_storage( ) ENTER
  Unparsed uri:   /tomcat/examples
  request_rec:009D79A8
  Return DECLINED
jk2_map_to_storage( ) ENTER
  Unparsed uri:   /tomcat/examples/
  request_rec:009D79A8
  Return DECLINED
jk2_map_to_storage( ) ENTER
  Unparsed uri:   /tomcat/examples/index.html
  request_rec:009D59A0
  Return DECLINED
jk2_map_to_storage( ) ENTER
  Unparsed uri:   /tomcat/examples/index.jsp
  request_rec:009D59A0
  Return DECLINED
jk2_handler( )ENTER
  Unparsed uri:   /tomcat/examples/
  request_rec:009D79A8
  uriEnv: 
  Return DECLINED

In jk2_map_to_storage the start of the code is:

jk_uriEnv_t *uriEnv=ap_get_module_config( r-request_config, jk2_module );

if( uriEnv != NULL ) {

but the only calls to

  ap_set_module_config( r-request_config, jk2_module, uriEnv );

are in jk2_translate.

So, it seems to me that jk2_translate needs to be invoked before
jk2_map_to_storage.  Which is what I thought the original order was.
But I have to confess I really do not understand APR_HOOK_MIDDLE,
APR_HOOK_FIRST, etc..

Anyhow, the bottom line is that on my machine doing a clean and then
rebuilding tomcat and mod_jk2 using the latest jakarta-tomcat-connectors
from cvs, leaves me with mod_jk2 not sending anything on to tomcat.


--
Mark Miesfeld
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [BUGS: 9913, 10789] Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apache2 mod_jk2.c

2002-07-18 Thread Bojan Smojver

Quoting Mark Miesfeld [EMAIL PROTECTED]:

 I was just getting ready to post something saying the fix seems to
 break mod_jk2 altogether for me.

Interesting. I haven't actually checked explicit calls to pages with reversed
order and mod_jk 1.2.0, so I don't really know if that breaks it or not. Will
test tonight (Sydney time).

 For one thing, I think, if jk2_map_to_storage is invoked before
 jk2_translate then mod_jk2 is going to return DECLINED all the time.
 Which is what I am seeing.  Nothing gets sent over to tomcat.
 
 For example:
 
 jk2_map_to_storage( ) ENTER
   Unparsed uri:   /tomcat/examples
   request_rec:009D79A8
   Return DECLINED
 jk2_map_to_storage( ) ENTER
   Unparsed uri:   /tomcat/examples/
   request_rec:009D79A8
   Return DECLINED
 jk2_map_to_storage( ) ENTER
   Unparsed uri:   /tomcat/examples/index.html
   request_rec:009D59A0
   Return DECLINED
 jk2_map_to_storage( ) ENTER
   Unparsed uri:   /tomcat/examples/index.jsp
   request_rec:009D59A0
   Return DECLINED
 jk2_handler( )ENTER
   Unparsed uri:   /tomcat/examples/
   request_rec:009D79A8
   uriEnv: 
   Return DECLINED
 
 In jk2_map_to_storage the start of the code is:
 
 jk_uriEnv_t *uriEnv=ap_get_module_config( r-request_config,
 jk2_module );
 
 if( uriEnv != NULL ) {
 
 but the only calls to
 
   ap_set_module_config( r-request_config, jk2_module, uriEnv );
 
 are in jk2_translate.
 
 So, it seems to me that jk2_translate needs to be invoked before
 jk2_map_to_storage.  Which is what I thought the original order was.
 But I have to confess I really do not understand APR_HOOK_MIDDLE,
 APR_HOOK_FIRST, etc.

I don't really understand Apache all that well, but the API documentation talks
about 'Controlling hook calling order'. From 'Apache Hook Functions' document:
...all modules using HOOK_FIRST will run before the HOOK_MIDDLE which are
before HOOK_LAST. If the order is unimportant, HOOK_MIDDLE is recommended.

 Anyhow, the bottom line is that on my machine doing a clean and then
 rebuilding tomcat and mod_jk2 using the latest
 jakarta-tomcat-connectors
 from cvs, leaves me with mod_jk2 not sending anything on to tomcat.

OK. I'll try your solution with mod_jk 1.2.0 and mod_jk2 people might do the
same. I don't really like my fix in 1.2.0 because it's just a cheap hack and it
doesn't address the root cause of the problem

The reason why it didn't work in mod_jk2 is the fact that the test was wrong. It
should have been:

---
if((uriEnv==NULL || strcmp(r-handler,JK_HANDLER)) 
   strcmp(r-handler,DIR_MAGIC_TYPE)))
return DECLINED;
---

But even that probably wouldn't work with TC 4.x because getServletPath() would
start returning strange things. I think your approach is much better.

Bojan

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]