tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Speed <paul.sp...@objectsciences.com>
Subject Re: [PATCH] Re: SSI Servlet has big problems
Date Mon, 01 Jul 2002 22:24:18 GMT


Dan Sandberg wrote:
> 
> Yes, let's merge them together.  How do I get to the code that you
> fixed?  Were the test cases in CVS?

It's all in CVS.  If you checkout the source code from some time in
December you should get it all back in util and util/ssi.  It looks
like my last check-in was on November 29th or so.  I too made some 
pretty significant changes.  It looks like my final test.xml
never made it in, but I'm attaching it here.  (Only the SSI parts
are relevant of course.)  All of the golden files look like they're
still there.

> 
> I'd say lets get all the test cases setup, and see where my code fails
> your tests.  Then we can use your code wherever functionality is missing.
> 

The motivation for my original changes was to fix the nesting of
.shtml files (ie: a .shtml file including another .shtml file) and
to add support for set, variable substitution, conditionals, etc..  
When I looked at the original version and saw it was such a mess, I 
did pertty much a complete rewrite.  Some of my changes are similar 
to yours, but I got rid of classes like SsiMediator and such.

All of this included fixing how variables were kept for includes
and such, as well as parsing fixes and the addition of some new
commands.  It's all pretty significant and may not naturally fit
some of your refactoring.  

To be honest, it might be easier to redo your changes against my
stuff than it would be to graft my stuff onto yours.  Even though
I know that's probably a real pain in the a**.  In it's current
state, I think the current fixed version has much less functionality 
than the previous fixed version.  Hopefully we can work something
out.

> I thought I had checked out the head revision.  Did I make a mistake
> with the cvs check out command?

Must have.  The fact that you even have an SsiMediator means you
were changing an older version.  Unfortunately, Bill didn't notice
this when he committed your stuff and probably just whole-sale 
nuked the older files.  Don't feel too bad about that, though. 
My original rewrite did something similar.  Only in my case, it
was only a small bug fix that was reverted.  Still a little 
disconcerting from my point of view.  Probably my own fault for
taking a two-month break from the lists.

And I had no idea I could have parlayed those patches into committer
access. :)
-Paul

> 
> -Dan
> 
> Paul Speed wrote:
> 
> >(Resending from my older address in hopes that it will help avoid
> > some confusion.)
> >
> >Hmmm...
> >
> >This is what I get for ignoring the list for a while. ;)
> >
> >Note: I completely rewrote the SSI support in 4.x HEAD and had Bip
> >apply the patches (Amy also did some patching) for exactly the same
> >reasons you originally mention.  I did this around Oct/Nov 2001.  On
> >most of the 4.0 bug reports for SSI (which I agree was a bad
> >implementation on that branch) I commented that my changes should
> >probably have been back-ported from head.
> >
> >I even had test cases for all of the SSI commands, including the
> >conditionals which I added support for.
> >
> >My only guess is that you were looking at an older version when finding
> >the problem.  My rewrite solved all of these problems and was
> >completely compatible with all mod_include commands except for the
> >regex stuff.
> >
> >Of course, now it seems that my version has been completely blown
> >away.  Which is unfortunate since that means we lose conditionals...
> >and possibly some of the more esoteric nesting behavior that I copied
> >from Apache (I haven't tested this yet.)
> >
> >It's too bad that SSI on head was blown away for changes to an older
> >version.  Any chance we can nicely merge the two good versions into
> >one more good version?
> >
> >-Paul Speed
> >
> >Dan Sandberg wrote:
> >
> >
> >>Hi everyone.
> >>
> >>Here are more changes to the SSI code.
> >>
> >>I have a test case ( comparing SSI behavior to Apache by using .shtml
> >>files in different tomcat webapps / apache directories ) which I have
> >>not included because I'm not sure where to put manual test cases like
> >>this.  If there is an apprioriate place for these kinds of things,
> >>please let me know.
> >>
> >>I also have not yet updated package.html in the o.a.c.ssi directory.  I
> >>will do this when I come back from a weekend trip.
> >>
> >>Here are the instructions for installing the new code, using the
> >>jakarta-tomcat-4.0 dir as the base dir.
> >>
> >>delete files in ( and dir ) :
> >>catalina/src/share/org/apache/catalina/util/ssi
> >>delete file:
> >>catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java
> >>unjar the jar
> >>-this puts SSIServlet.java into
> >>catalina/src/share/org/apache/catalina/servlets
> >>-this puts the rest of the files in
> >>catalina/src/share/org/apache/catalina/ssi
> >>
> >>Since the name of the SSI servlet class changes, and since I added some
> >>notes to it, patch web.xml according to the included patch.
> >>
> >>Since I'm planning on maintaining this for a while, commit access might
> >>be a good idea, as it makes things easier for everyone.
> >>
> >>Thanks & have a great weekend!
> >>
> >>-Dan
> >>
> >>Index: web.xml
> >>===================================================================
> >>RCS file: /home/cvspublic/jakarta-tomcat-4.0/catalina/src/conf/web.xml,v
> >>retrieving revision 1.34
> >>diff -r1.34 web.xml
> >>150d149
> >><
> >>157a157
> >> >   <!--                       This will generally SLOW-DOWN
> >>processing.      -->
> >>169c169,170
> >><   <!--                       the server root?  (0=false, 1=true)
> >>[0]        -->
> >>---
> >> >   <!--                       the server root? See note
> >>below.               -->
> >> >   <!--                       (0=false, 1=true)
> >>[0]                          -->
> >>171,174c172,177
> >><   <!--
> >>ignoreUnsupportedDirective                                         -->
> >><   <!--                       Should unknown or misspelled Ssi
> >>directives    -->
> >><   <!--                       be ignored and no errors
> >>shown?                -->
> >><   <!--                       (0=false, 1=true)
> >>[1]                          -->
> >>---
> >> >   <!-- NOTE     : If you set isVirtualWebappRelative to 1
> >>(true),           -->
> >> >   <!--            you probably want to set crossContext=true on
> >>the         -->
> >> >   <!--            context that contains the server-side include
> >>files       -->
> >> >   <!--            because otherwise the default security will
> >>prevent       -->
> >> >   <!--            access to other contexts.  The file to change
> >>is          -->
> >> >   <!--
> >>server.xml.                                               -->
> >>181,207c184,204
> >><     <servlet>
> >><         <servlet-name>ssi</servlet-name>
> >><         <servlet-class>
> >><           org.apache.catalina.servlets.SsiInvokerServlet
> >><         </servlet-class>
> >><         <init-param>
> >><           <param-name>buffered</param-name>
> >><           <param-value>1</param-value>
> >><         </init-param>
> >><         <init-param>
> >><           <param-name>debug</param-name>
> >><           <param-value>0</param-value>
> >><         </init-param>
> >><         <init-param>
> >><           <param-name>expires</param-name>
> >><           <param-value>666</param-value>
> >><         </init-param>
> >><         <init-param>
> >><           <param-name>isVirtualWebappRelative</param-name>
> >><           <param-value>0</param-value>
> >><         </init-param>
> >><         <init-param>
> >><           <param-name>ignoreUnsupportedDirective</param-name>
> >><           <param-value>1</param-value>
> >><         </init-param>
> >><         <load-on-startup>4</load-on-startup>
> >><     </servlet>
> >>---
> >> >   <servlet>
> >> >     <servlet-name>ssi</servlet-name>
> >> >
> >><servlet-class>org.apache.catalina.servlets.SSIServlet</servlet-class>
> >> >     <init-param>
> >> >       <param-name>buffered</param-name>
> >> >       <param-value>0</param-value>
> >> >     </init-param>
> >> >     <init-param>
> >> >       <param-name>debug</param-name>
> >> >       <param-value>0</param-value>
> >> >     </init-param>
> >> >     <init-param>
> >> >       <param-name>expires</param-name>
> >> >       <param-value>666</param-value>
> >> >     </init-param>
> >> >     <init-param>
> >> >       <param-name>isVirtualWebappRelative</param-name>
> >> >       <param-value>0</param-value>
> >> >     </init-param>
> >> >     <load-on-startup>4</load-on-startup>
> >> >   </servlet>
> >>209d205
> >><
> >>
> >>  ------------------------------------------------------------------------
> >>                     Name: ssi.jar
> >>   ssi.jar           Type: Java Archive (application/java-archive)
> >>                 Encoding: base64
> >>          Download Status: Not downloaded with message
> >>
> >>  ------------------------------------------------------------------------
> >>--
> >>To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> >>For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> >>
> >>
> >
> >--
> >To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
> >
> >
> >
> >
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>
Mime
View raw message