cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16903] New: - No caching if serializer buffer-size < content length
Date Sat, 08 Feb 2003 15:05:09 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16903>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16903

No caching if serializer buffer-size < content length

           Summary: No caching if serializer buffer-size < content length
           Product: Cocoon 2
           Version: 2.0
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: core
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: unico@hippo.nl


If the content length of a pipeline result is smaller than the buffer size set 
in the serializer (wich defaults to 8192 bytes) the CachedStreamObject will be 
constructed with 0 bytes, and therefore not useable by subsequent requests.

The reason for this is the use of the CachingOutputStream object in 
CachingStreamPipeline. This stream is used to wrap the original outputstream in 
order that all bytes written to it can be retrieved later by calling its 
getContent() method.

Now, in the case that the buffer-size in the AbstractTextSerializer the 
pipeline is using is smaller than the size of the stream in the pipeline, the 
call to getContent() will return an empty array of bytes because nothing has 
actually been written yet.

I have not discovered the reason why, it seems, that either 0 bytes have been 
written at the time of calling getContent() or everything has been written, 
when at first sight one would expect to see also partially written content to 
be returned.

An easy work around would involve getting the buffered contents in the 
CachingOutputStream on a subsequent request. I'll look into this when and if I 
have the time and try to come up with a patch for that.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message