Re: patch to jk_uri_worker_map.c -> slightly more sophisticated string matching

2001-11-02 Thread Michael Jennings

Hi Costin & Larry,

I'll apply my change to jakarta-tomcat-connectors then send the diff as an
attachment.

-Mike


- Original Message -
From: <[EMAIL PROTECTED]>
To: "Tomcat Developers List" <[EMAIL PROTECTED]>
Sent: Friday, November 02, 2001 12:08 PM
Subject: Re: patch to jk_uri_worker_map.c -> slightly more sophisticated
string matching


> Mike,
>
> Thanks for the patch and your interest. One small problem: the development
> of jk moved to jakarta-tomcat-connectors. We should do only 'major' bug
> fixes in j-t/src/native.
>
> Of course, all rules have exceptions - but it is extremely painfull to
> merge and track 2 codebases.
>
> Costin
>
>
> On Fri, 2 Nov 2001, Michael Jennings wrote:
>
> > If anyone sees any glaring problems with the following modification to
> > mod_jk
> > please let me know.
> >
> > -Mike Jennings
> >
> > Index: jakarta-tomcat/src/native/jk/jk_uri_worker_map.c
> > ===
> > RCS file:
> > /home/cvspublic/jakarta-tomcat/src/native/jk/Attic/jk_uri_worker_map.c,v
> > retrieving revision 1.3.2.1
> > diff -r1.3.2.1 jk_uri_worker_map.c
> > 75,77c75,78
> > < #define MATCH_TYPE_EXACT(0)
> > < #define MATCH_TYPE_CONTEXT  (1)
> > < #define MATCH_TYPE_SUFFIX   (2)
> > ---
> > > #define MATCH_TYPE_EXACT(0)   /* match an exact pattern */
> > > #define MATCH_TYPE_CONTEXT  (1)   /* match all URIs in a given context
*/
> > > #define MATCH_TYPE_SUFFIX   (2)   /* match all URIs of the form *.ext
*/
> > > #define MATCH_TYPE_GENERAL_SUFFIX (3) /* match all URIs of the form
*ext
> > */
> > 231c232
> > <
> > ---
> > >
> > 236,237c237,238
> > < jk_log(l, JK_LOG_ERROR,
> > <
> > "jk_uri_worker_map_t::uri_worker_map_open, malloc failed\n");
> > ---
> > > jk_log(l, JK_LOG_ERROR,
> > >
> > "jk_uri_worker_map_t::uri_worker_map_open, malloc failed\n");
> > 244,245c245,246
> > <  * we need to have a '/' then a '*' and
the a
> > '.' or a
> > <  * '/' then a '*'
> > ---
> > >  * we need to have a '/' then a '*' and
the a
> > '.' or a
> > >  * '/' then a '*'
> > 247c248,252
> > < asterisk--;
> > ---
> > > asterisk--;  /* point to char before
asterisk
> > */
> > > /* asterisk[0]='/'
> > >asterisk[1]='*'
> > >asterisk[2]='.' or asterisk[2]='\0' or
> > asterisk[2]!='\0'
> > > */
> > 248a254
> > > asterisk[1] = '\0'; /* terminate the
uri
> > pattern at the asterisk */
> > 251c257
> > < asterisk[1] = asterisk[2] = '\0';
> > ---
> > > asterisk[2] = '\0';
> > 252a259,260
> > > /* uri-pattern will now contain
> > context only
> > >since asterisk[1]='\0' */
> > 256,258c264,276
> > < jk_log(l, JK_LOG_DEBUG,
> > <"Into
> > jk_uri_worker_map_t::uri_worker_map_open, suffix rule %s.%s=%s was
added\n",
> > <uri, asterisk + 3, worker);
> > ---
> > > jk_log(l, JK_LOG_DEBUG,
> > >"Into
> > jk_uri_worker_map_t::uri_worker_map_open, suffix rule %s.%s=%s was
added\n",
> > >uri, asterisk + 3, worker);
> > > j++;
> > > } else if ('\0' != asterisk[2]) {
> > > /* general suffix rule */
> > > uw_map->maps[j].worker_name =
worker;
> > > uw_map->maps[j].context = uri;
> >

RE: patch to jk_uri_worker_map.c -> slightly more sophisticated string matching

2001-11-02 Thread Larry Isaacs

Hi Michael,

FYI: Embedding the patch in the e-mail usually allows linewrap
to render the patch useless as far as applying it to a file.
It also makes it hard to read.  It is better to send the patch
as an attachment.

Larry

> -Original Message-
> From: Michael Jennings [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 02, 2001 2:13 PM
> To: Tomcat Developers List
> Subject: patch to jk_uri_worker_map.c -> slightly more sophisticated
> string matching
> 
> 
> If anyone sees any glaring problems with the following modification to
> mod_jk
> please let me know.
> 
> -Mike Jennings
> 
> Index: jakarta-tomcat/src/native/jk/jk_uri_worker_map.c
> ===
> RCS file:
> /home/cvspublic/jakarta-tomcat/src/native/jk/Attic/jk_uri_work
> er_map.c,v
> retrieving revision 1.3.2.1
> diff -r1.3.2.1 jk_uri_worker_map.c
> 75,77c75,78
> < #define MATCH_TYPE_EXACT(0)
> < #define MATCH_TYPE_CONTEXT  (1)
> < #define MATCH_TYPE_SUFFIX   (2)
> ---
> > #define MATCH_TYPE_EXACT(0)   /* match an exact pattern */
> > #define MATCH_TYPE_CONTEXT  (1)   /* match all URIs in a 
> given context */
> > #define MATCH_TYPE_SUFFIX   (2)   /* match all URIs of the 
> form *.ext */
> > #define MATCH_TYPE_GENERAL_SUFFIX (3) /* match all URIs of 
> the form *ext
> */
> 231c232
> <
> ---
> >
> 236,237c237,238
> < jk_log(l, JK_LOG_ERROR,
> <
> "jk_uri_worker_map_t::uri_worker_map_open, malloc failed\n");
> ---
> > jk_log(l, JK_LOG_ERROR,
> >
> "jk_uri_worker_map_t::uri_worker_map_open, malloc failed\n");
> 244,245c245,246
> <  * we need to have a '/' then a 
> '*' and the a
> '.' or a
> <  * '/' then a '*'
> ---
> >  * we need to have a '/' then a 
> '*' and the a
> '.' or a
> >  * '/' then a '*'
> 247c248,252
> < asterisk--;
> ---
> > asterisk--;  /* point to char 
> before asterisk
> */
> > /* asterisk[0]='/'
> >asterisk[1]='*'
> >asterisk[2]='.' or 
> asterisk[2]='\0' or
> asterisk[2]!='\0'
> > */
> 248a254
> > asterisk[1] = '\0'; /* 
> terminate the uri
> pattern at the asterisk */
> 251c257
> < asterisk[1] = 
> asterisk[2] = '\0';
> ---
> > asterisk[2] = '\0';
> 252a259,260
> > /* uri-pattern will now contain
> context only
> >since asterisk[1]='\0' */
> 256,258c264,276
> < jk_log(l, JK_LOG_DEBUG,
> <"Into
> jk_uri_worker_map_t::uri_worker_map_open, suffix rule 
> %s.%s=%s was added\n",
>  3, worker);
> ---
> > jk_log(l, JK_LOG_DEBUG,
> >"Into
> jk_uri_worker_map_t::uri_worker_map_open, suffix rule 
> %s.%s=%s was added\n",
> >uri, asterisk + 
> 3, worker);
> > j++;
> > } else if ('\0' != asterisk[2]) {
> > /* general suffix rule */
> > 
> uw_map->maps[j].worker_name = worker;
> > uw_map->maps[j].context = uri;
> > uw_map->maps[j].suffix  
> = asterisk +
> 2;
> > uw_map->maps[j].match_type =
> MATCH_TYPE_GENERAL_SUFFIX;
> > jk_log(l, JK_LOG_DEBUG,
> >"Into
> jk_uri_worker_map_t::uri_worker_map_open, general suffix rule 
> %s*%s=%s was
> added\n",
> >uri, asterisk + 
> 2, worker);
> 260c278,279
> < } else {
> ---
> > }
> >   else {
> 262d280
> < asterisk[1] = '\0';
> 267,269c285,287
> < jk_log(l, JK_LOG_DEBUG,
> <"Into
> jk_uri_worker_map_t::uri_worker_map_open, match rule %s=%s 
> was added\n",
>  ---
> > jk_log(l, JK_LOG_DEBUG,
> >"Into
> jk_uri_worker_map_t::uri_worker_map_open, match rule %s=%s 
> was added\n",
> >uri, worker);
> 273c291
> < /* not leagal !!! */
> ---
> >