Good evening Henri,
Thanks for taking the patch.

The pseudo-code (now below) is mostly an 'analysis' of what I would expect
JkUriSet to do based on understanding of the process. From this it is mostly
a check list of what to expect to find when looking at what the code
actually does. In looking at the uri records the current process creates, I
noticed the 'name' and 'uri' now lacks the added numbers, yet when I tried
the get= command I couldn't retrieve the object;  a dmp= showed the uri
records still get an object name that has a number added on, which is a
little confusing.

As mentioned previously, it's my understanding the uri records are meant to
aim a url at a designated worker, and if the uri record is first created in
workers2.properties then the 'comment' in the mod_jk2.c source that "all
entries passed in [via jkuriset] are unique" clearly _may_ not apply. In
that sense the uri objects are much like database records with a primary key
that includes the host, port and context... [uri:/examples/*] says to use
the 'default' host and port, and if the <Location> block isn't inside a
virtual host directive, then <Location /examples/*> effectively means the
same thing, so there really isn't a need to create an extra uri object....

As I said, it's mostly meant as a checklist, and is only valid if I
understand the requirements. While I would like to be able to code a patch
for this, my C skills are such that I limited my pseudo-code to use enough
to make it easier to understand.... it doesn't necessarily make it right.

Thanks for the time.
Norm

> NormW wrote:
>
> > Good afternoon Henri.
> > In visualising the process of JkUriSet, arrived at the following in
> > pseudo-code. Shame I can't translate it to C otherwise I would offer a
diff.
> > :-)
> > Regards,
> > Norm
> >
> > JkUriSet property, value
> >     /* Only allow inside a Location block */
> >     if (!<location> block) {
> >          log "error, JkUriSet not allowed here"
> >          return CONFIG_ERROR
> >     }
> >     /* 2 Parameters - property and value */
> >     if (!property or !value) {
> >          log "error, missing parameter(s) - property and value"
> >          return CONFIG_ERROR
> >     }
> >     /* The property must be in the setAttrInfo list */
> >     if(!property in setAttrInfo() ) {
> >          log "error, property not settable-", property
> >          return CONFIG_ERROR
> >     }
> >     /* Create uri name using host, port, location */
> >      ...... ()
> >     if(!valid name) {
> >          log "error, missing or invalid data - ", host,port,context
> >          return CONFIG_ERROR
> >     }
> >     /* Check for existing uri object - update it or create a new one */
> >     if(exist uri name) {
> >         point to it;
> >         log "warning, using existing uri object - ", name
> >     } else {
> >         status = create_uri()
> >         if(status !=OK) {
> >             log "emerg, create uri object failed - ", status
> >             return CONFIG_ERROR
> >         }
> >         set uri object
> > (name,host,port,context,match_type,timing,disabled,debug)
> >         if(default_worker != NULL) {
> >             set group = default_worker
> >         }
> >     }
> >     /* Set passed property value but first set if it is set already */
> >     if (getAttr(property) != NULL) {
> >           log "warning, updating existing uri object property - ",
> > property,value
> >     }
> >     if(setAttr(property, value)!=OK) {
> >          log "error, setting property failed - ", property,value
> >          return CONFIG_ERROR
> >     }
> >     return OK.
>
> Thanks to send a diff to latest code so I could commit it.
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to