Carsten Ziegeler wrote:

Carsten Ziegeler wrote:


After updating to the latest cvs I get an infinite loop in the
new portal demo:
http://localhost:8888/samples/portal/portal

I guess this is caused by the recent changes to the source
resolving.

Any clues?



It seems that the current implementation of the source resolver
is not very effective (thanks to Volker for the analysis :) ):
For each URI the absolutize() method is invoked, and this
uses the new regular expression to test the uri if it is
relative or not. The implementation of the regular expression uses a very deep
stack that depends on the size (length) of the uri. In the
portal we have very huge uris (many request parameters appended)
and therefore the stack gets very deep creating the exception.


Now I see two simple improvements: a) don't use the regexp
on request parameters, which means search for a '?' and invoke
the regexp only on the part before the '?'.
b) A quick test if the uri is already absolute. If the URI
is already absolute we don't need the regexp test.



What about using the two ;-)
1/ test if the URI is absolute. For this, you can use Excalibur's SourceUtil.getScheme() which performs a strict control on scheme syntax without using a regexp.
2/ if not, use the regexp only on the part before the '?' (BTW, if '?' is part of the URI, it should be encoded as %3F


Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }




Reply via email to