hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Truncated content-length delimited message bodies; was Re: Calling of NHttpRequestExecutionHandler.finalizeContext()
Date Wed, 11 May 2011 19:33:20 GMT
On Wed, 2011-05-11 at 21:48 +0530, Asankha C. Perera wrote:
> Hi Oleg
> 
> Thanks for the explanation.. I guess EventListener interface may 
> increasingly be used for protocol handling, and so we could just make it 
> clear in the documentation. I will update the Javadocs with this 
> information.
> 
> On a slightly different - but related note, if the remote party was to 
> close the connection abruptly while writing its response entity, and if 
> length delimited encoding was used, it seems like we accept the partial 
> response as a successfully received full response, instead of a socket 
> close. I am trying this with a ESB level unit test and a raw TCP socket 
> server ..
> 
> I believe this is caused by the following completion check in read() and 
> transfer():
>          if (bytesRead == -1) {
>              this.completed = true;
>              return -1;
>          }
> 
> Do you think we should also check if the expected length was received?
> 

I think we should. What is worse, the current behavior of the
content-length delimited decoder is inconsistent with that of the chunk
decoder that correctly throws an I/O exception if a truncated chunk is
encountered.

The same problem exists with the blocking the content-length delimited
input stream.

Shall we call off the release because of this issue?

Oleg 



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


Mime
View raw message