hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Truncated content-length delimited message bodies
Date Fri, 13 May 2011 09:48:07 GMT
On Fri, 2011-05-13 at 14:00 +0530, Asankha C. Perera wrote:
> Hi Oleg
> 
> Creating a native HttpCore test case will take some time as I will be 
> traveling from tomorrow ..  meanwhile I came across a somewhat hacky 
> solution to the issue and wanted to check how you feel about it.. I do 
> believe the real bug is in Java, and I guess we should file a bug :)
> 
> The solution would be to throw an IllegalStateException instead of a 
> ConnectionClosed, and requesting our user to handle the case by way of 
> Javadocs. I know this is not the most elegant way to solve this.. but a 
> Java fix could take a long time.. What do you think?
> 
> thanks
> asankha
> 

Asankha

I think I have a slightly less hacky work-around for the problem. How
about creating a custom version of ContentDecoderChannel that catches
ConnectionClosedException and re-throws it as a runtime exception of
some sort? This would enable your code to handle truncated messages and
would not require the hack to be applied to HttpCore? Would that work
for you?

I also believe we should release HttpCore 4.1.1 without a fix for the
problem and take more time to work out a proper solution in the 4.2
branch. Would that be acceptable?

Oleg


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


Mime
View raw message