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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to