cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: invalid content length
Date Fri, 28 May 2004 10:37:57 GMT
I'm no longer the only one having problem with the issues mentioned 
below: http://marc.theaimsgroup.com/?t=108558448300001&r=1&w=4.

What's interesting about this case is the correct recognition of an 
internal request in PipelineUtil.processPipelineToDOM(), but not for the 
older cocoon.processPipelineTo(). Shouldn't this give hints on the root 
of the problem?

Joerg

On 21.05.2004 21:36, Joerg Heinicke wrote:

> On 18.05.2004 23:56, Joerg Heinicke wrote:
> 
>> Can anybody tell me what can cause the invalid content length? The
>> first one is html serializer, the latter ones text serializer.
> 
> 
> Found at least the reason: A stylesheet is imported via cocoon:/ and in
> this pipeline the stylesheet is *read* from disk, the ResourceReader 
> also sets the content-length header, the 919 bytes are the length of the 
> stylesheet.
> 
>> 23:45:18.000 WARN!! Invalid length: Content-Length=919 written=186
>> for
>> http://127.0.0.1:8888/xfaces/css/html/mozilla/skin/simple/step80-pages/simple/html/common/css.css

>>
> 
> 
> Now the question how to fix it. Referencing the stylesheet in the same 
> way directly from the sitemap would result in a ProcessingException:
> "Streaming of an internal pipeline is not possible with a reader." 
> (AbstractProcessingPipeline, line 678).
> 
> 1st issue: That this exception is not thrown when the stylesheet is 
> imported by another stylesheet via cocoon:/ is 1.) somewhat inconsistent 
> and 2.) hints on a bigger problem (why is this internal request not 
> recognized as an internal request?).
> 
> On the one hand we could for simplification throw an exception for this 
> case too - however this case will be recognized as internal request. On 
> the other hand there is no need for it as transformers don't need to be 
> streamed - otherwise it would not work using the reader as it did. This 
> would allow to write partly shorter sitemaps, but I don't know if it's 
> worth the effort to recognize internal requests sent by transformer steps.
> 
> 2nd issue: Letting the reader set the headers "unasked" does not sound 
> like IoC. The SitemapOutputComponent has a method 
> shouldSetContentLength(), the AbstractReader implements it by returning 
> false, but the ResourceReader sets it? Thinking in code smells [1] this 
> stinks :)
> 
> WDYT?
> 
> Joerg
> 
> [1] http://c2.com/cgi/wiki?CodeSmell

Mime
View raw message