[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676650#action_12676650
 ] 

Adam Bryzak commented on HTTPCLIENT-829:
----------------------------------------

When getting a SocketTimeoutException, the connection is still valid. In my 
project, I'm using the timeout as an opportunity to check if the connection 
should be terminated (for potentially various reasons such as how many active 
connections there are, how long the connection has been invalid or even if the 
service should no longer be running). The code for ChunkedInputStream in 4.0 
looked to be similar or the same as in 3.1 which is what led me to believe it 
would still be a problem in it. The main issue is that it doesn't track all 
state as it's reading.

> ChunkedInputStream does not handle sockets with timeouts
> --------------------------------------------------------
>
>                 Key: HTTPCLIENT-829
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-829
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 3.1 Final
>            Reporter: Adam Bryzak
>         Attachments: HTTPCLIENT-829.patch
>
>
> ChunkedInputStream does not handle socket timeouts when reading data. If a 
> socket timeout is received after finishing reading a chunk (including it's 
> CRLF combination) and before reading the next chunk's length, the next call 
> to read will attempt to re-read the CRLF, causing an IOException with the 
> message "CRLF expected at end of chunk" to be thrown. I have only tested this 
> with 3.0 but it doesn't appear to be fixed in 3.1 or any 4.0 from looking at 
> the code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to