You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jean-frederic clere <jf...@fujitsu-siemens.com> on 2004/03/04 17:49:21 UTC

Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apach e2 mod_jk2.c

jean-frederic clere wrote:
> jfclere@apache.org wrote:
> 
>>jfclere     2004/03/03 09:55:32
>>
>>  Modified:    jk/native2/server/apache2 mod_jk2.c
>>  Log:
>>  Remove jk2_translate... It is still not 100% OK:
>>  - LocationMatch does not work.
>>  - Some _not_found ends in Tomcat when using mod_dav.
> 
> 
> That is still not OK. I will go on later. Sorry :-(

Now it looks better. The only thing I have removed is the logic for mod_dir
Tomcat will do it if needed.

Cheers

Jean-Frederic

> 
> 
>>  
>>  Revision  Changes    Path
>>  1.72      +27 -30    jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c
>>  
>>  Index: mod_jk2.c
>>  ===================================================================
>>  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/apache2/mod_jk2.c,v
>>  retrieving revision 1.71
>>  retrieving revision 1.72
>>  diff -u -r1.71 -r1.72
>>  --- mod_jk2.c	3 Mar 2004 09:15:48 -0000	1.71
>>  +++ mod_jk2.c	3 Mar 2004 17:55:31 -0000	1.72
>>  @@ -42,7 +42,6 @@
>>    */
>>   static int dirCounter=0;
>>   
>>  -
>>   #define JK_HANDLER          ("jakarta-servlet2")
>>   #define JK_MAGIC_TYPE       ("application/x-jakarta-servlet2")
>>   
>>  @@ -662,9 +661,11 @@
>>       int rc1;
>>   
>>       uriEnv=ap_get_module_config( r->request_config, &jk2_module );
>>  +    if (uriEnv==NULL) 
>>  +      uriEnv=ap_get_module_config( r->per_dir_config, &jk2_module );
>>   
>>       /* not for me, try next handler */
>>  -    if(uriEnv==NULL || strcmp(r->handler,JK_HANDLER))
>>  +    if(uriEnv==NULL || !strcmp(r->handler,JK_HANDLER))
>>         return DECLINED;
>>       
>>       /* If this is a proxy request, we'll notify an error */
>>  @@ -854,38 +855,35 @@
>>   /* bypass the directory_walk and file_walk for non-file requests */
>>   static int jk2_map_to_storage(request_rec *r)
>>   {
>>  -    jk_uriEnv_t *uriEnv=ap_get_module_config( r->request_config, &jk2_module );
>>  -    
>>  -    if( uriEnv != NULL ) {
>>  -    
>>  -        /* First find just the name of the file, no directory */
>>  -        r->filename = (char *)apr_filepath_name_get(r->uri);
>>  +    jk_uriEnv_t *uriEnv;
>>  +    jk_env_t *env;
>>   
>>  -        /* Only if sub-request for a directory, most likely from mod_dir */
>>  -        if (r->main && r->main->filename &&
>>  -            !*apr_filepath_name_get(r->main->filename)){
>>  -
>>  -            /* The filename from the main request will be set to what should
>>  -             * be picked up, aliases included. Tomcat will need to know about
>>  -             * those aliases or things won't work for them. Normal files
>>  -             * should be fine. */
>>  -
>>  -            /* Need absolute path to stat */
>>  -            if (apr_filepath_merge(&r->filename,
>>  -                                   r->main->filename, r->filename,
>>  -                                   APR_FILEPATH_SECUREROOT |
>>  -                                   APR_FILEPATH_TRUENAME,
>>  -                                   r->pool)
>>  -                != APR_SUCCESS){
>>  -              return DECLINED; /* We should never get here, very bad */
>>  -            }
>>  +    if (r->proxyreq || workerEnv==NULL) {
>>  +        return DECLINED;
>>  +    }
>>  +
>>  +    /* From something like [uri:/examples/STAR] in workers2.properties */
>>  +    env = workerEnv->globalEnv->getEnv( workerEnv->globalEnv );
>>  +    uriEnv=workerEnv->uriMap->mapUri(env, workerEnv->uriMap,
>>  +        ap_get_server_name(r),
>>  +        ap_get_server_port(r),
>>  +        r->uri);
>>   
>>  -            /* Stat the file so that mod_dir knows it's there */
>>  -            apr_stat(&r->finfo, r->filename, APR_FINFO_TYPE, r->pool);
>>  +    if (uriEnv!=NULL && uriEnv->workerName != NULL) {
>>  +        ap_set_module_config( r->request_config, &jk2_module, uriEnv );
>>  +        r->handler=JK_HANDLER;
>>  +        workerEnv->globalEnv->releaseEnv( workerEnv->globalEnv, env );
>>  + 
>>  +        /* This could be a sub-request, possibly from mod_dir */
>>  +        if(r->main){
>>  +            ap_set_module_config( r->main->request_config, &jk2_module, uriEnv );
>>  +            r->main->handler=JK_HANDLER;
>>           }
>>   
>>           return OK;
>>       }
>>  +
>>  +    workerEnv->globalEnv->releaseEnv( workerEnv->globalEnv, env );
>>       return DECLINED;
>>   }
>>   
>>  @@ -897,7 +895,6 @@
>>       /* Force the mpm to run before us and set the scoreboard image */
>>       ap_hook_child_init(jk2_child_init, NULL, NULL, APR_HOOK_LAST);
>>       
>>  -    ap_hook_translate_name(jk2_translate, NULL, NULL, APR_HOOK_MIDDLE);
>>       ap_hook_map_to_storage(jk2_map_to_storage, NULL, NULL, APR_HOOK_MIDDLE);
>>   }
>>   
>>  
>>  
>>  
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>
>>
> 
> 


Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apach e2 mod_jk2.c

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Glenn Nielsen wrote:
> On Thu, Mar 04, 2004 at 05:49:21PM +0100, jean-frederic clere wrote:
> 
>>jean-frederic clere wrote:
>>
>>>jfclere@apache.org wrote:
>>>
>>>
>>>>jfclere     2004/03/03 09:55:32
>>>>
>>>> Modified:    jk/native2/server/apache2 mod_jk2.c
>>>> Log:
>>>> Remove jk2_translate... It is still not 100% OK:
>>>> - LocationMatch does not work.
>>>> - Some _not_found ends in Tomcat when using mod_dav.
>>>
>>>
>>>That is still not OK. I will go on later. Sorry :-(
>>
>>Now it looks better. The only thing I have removed is the logic for mod_dir
>>Tomcat will do it if needed.
> 
> 
> Does that mean that Tomcat would have to resovlve identification
> of the directory index file?

I do not see how the code I removed helps to do it.
I am able to see that the index.html.var is requested but it is not displayed.
(when mapping /examples/jsp/* for example).

> 
> It would be nice to keep this on the apache side when someone
> uses Alias or JkAutoAlias to serve static pages, fourwarding
> and DirectoryIndex files which are *.jsp to Tomcat of course.

By mapping "*.jsp" to Tomcat that works.

> 
> Glenn
> 
> 


Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apach e2 mod_jk2.c

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Henri Gomez wrote:
> jean-frederic clere wrote:
> 
>> Glenn Nielsen wrote:
>>
>>> On Thu, Mar 04, 2004 at 05:49:21PM +0100, jean-frederic clere wrote:
>>>
>>>
>>>> jean-frederic clere wrote:
>>>>
>>>>
>>>>> jfclere@apache.org wrote:
>>>>>
>>>>>
>>>>>
>>>>>> jfclere     2004/03/03 09:55:32
>>>>>>
>>>>>> Modified:    jk/native2/server/apache2 mod_jk2.c
>>>>>> Log:
>>>>>> Remove jk2_translate... It is still not 100% OK:
>>>>>> - LocationMatch does not work.
>>>>>> - Some _not_found ends in Tomcat when using mod_dav.
>>>>>
>>>>>
>>>>>
>>>>> That is still not OK. I will go on later. Sorry :-(
>>>>
>>>>
>>>> Now it looks better. The only thing I have removed is the logic for
>>>> mod_dir
>>>> Tomcat will do it if needed.
>>>
>>>
>>>
>>> Does that mean that Tomcat would have to resovlve identification
>>> of the directory index file?
>>
>>
>>
>> Yes.
>>
>>
>>> It would be nice to keep this on the apache side when someone
>>> uses Alias or JkAutoAlias to serve static pages, fourwarding
>>> and DirectoryIndex files which are *.jsp to Tomcat of course.
>>
>>
>>
>> That is easy to put back the logic ;-)
> 
> 
> Will we back port the jk2 modification to jk ?

After releasing jk2 ;-)

BTW: I am still not happy with PR 21546:

"JkSet uri:<domain>/*.jsp.group ajp13:<worker>"
If <domain> is "host/context" that will work if it is "host/" it won't because
"*.jsp" will be mapped by jk2_map_to_storage.

Ideas?

> 
> BTW, the jk2 2.0.4 should be delayed at least one week again but it's
> worth the wait...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> 


Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apach e2 mod_jk2.c

Posted by Henri Gomez <hg...@apache.org>.
jean-frederic clere wrote:

> Glenn Nielsen wrote:
> 
>>On Thu, Mar 04, 2004 at 05:49:21PM +0100, jean-frederic clere wrote:
>>
>>
>>>jean-frederic clere wrote:
>>>
>>>
>>>>jfclere@apache.org wrote:
>>>>
>>>>
>>>>
>>>>>jfclere     2004/03/03 09:55:32
>>>>>
>>>>>Modified:    jk/native2/server/apache2 mod_jk2.c
>>>>>Log:
>>>>>Remove jk2_translate... It is still not 100% OK:
>>>>>- LocationMatch does not work.
>>>>>- Some _not_found ends in Tomcat when using mod_dav.
>>>>
>>>>
>>>>That is still not OK. I will go on later. Sorry :-(
>>>
>>>Now it looks better. The only thing I have removed is the logic for mod_dir
>>>Tomcat will do it if needed.
>>
>>
>>Does that mean that Tomcat would have to resovlve identification
>>of the directory index file?
> 
> 
> Yes.
> 
> 
>>It would be nice to keep this on the apache side when someone
>>uses Alias or JkAutoAlias to serve static pages, fourwarding
>>and DirectoryIndex files which are *.jsp to Tomcat of course.
> 
> 
> That is easy to put back the logic ;-)

Will we back port the jk2 modification to jk ?

BTW, the jk2 2.0.4 should be delayed at least one week again but it's
worth the wait...


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apach e2 mod_jk2.c

Posted by jean-frederic clere <jf...@fujitsu-siemens.com>.
Glenn Nielsen wrote:
> On Thu, Mar 04, 2004 at 05:49:21PM +0100, jean-frederic clere wrote:
> 
>>jean-frederic clere wrote:
>>
>>>jfclere@apache.org wrote:
>>>
>>>
>>>>jfclere     2004/03/03 09:55:32
>>>>
>>>> Modified:    jk/native2/server/apache2 mod_jk2.c
>>>> Log:
>>>> Remove jk2_translate... It is still not 100% OK:
>>>> - LocationMatch does not work.
>>>> - Some _not_found ends in Tomcat when using mod_dav.
>>>
>>>
>>>That is still not OK. I will go on later. Sorry :-(
>>
>>Now it looks better. The only thing I have removed is the logic for mod_dir
>>Tomcat will do it if needed.
> 
> 
> Does that mean that Tomcat would have to resovlve identification
> of the directory index file?

Yes.

> 
> It would be nice to keep this on the apache side when someone
> uses Alias or JkAutoAlias to serve static pages, fourwarding
> and DirectoryIndex files which are *.jsp to Tomcat of course.

That is easy to put back the logic ;-)

> 
> Glenn
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> 


Re: cvs commit: jakarta-tomcat-connectors/jk/native2/server/apach e2 mod_jk2.c

Posted by Glenn Nielsen <gl...@mail.more.net>.
On Thu, Mar 04, 2004 at 05:49:21PM +0100, jean-frederic clere wrote:
> jean-frederic clere wrote:
> > jfclere@apache.org wrote:
> > 
> >>jfclere     2004/03/03 09:55:32
> >>
> >>  Modified:    jk/native2/server/apache2 mod_jk2.c
> >>  Log:
> >>  Remove jk2_translate... It is still not 100% OK:
> >>  - LocationMatch does not work.
> >>  - Some _not_found ends in Tomcat when using mod_dav.
> > 
> > 
> > That is still not OK. I will go on later. Sorry :-(
> 
> Now it looks better. The only thing I have removed is the logic for mod_dir
> Tomcat will do it if needed.

Does that mean that Tomcat would have to resovlve identification
of the directory index file?

It would be nice to keep this on the apache side when someone
uses Alias or JkAutoAlias to serve static pages, fourwarding
and DirectoryIndex files which are *.jsp to Tomcat of course.

Glenn


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org