jira-importer opened a new issue, #1317:
URL: https://github.com/apache/httpcomponents-core/issues/1317

   **[Sajinie 
Kavindya](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER293031)**
 opened 
**[HTTPCORE-718](https://issues.apache.org/jira/browse/HTTPCORE-718?redirect=false)**
 and commented
   
   We recently migrated to httpcore-nio 4.4.15 and we have been encountering 
some issues when connecting to an HTTPS Backend that sends chunked responses. 
The backend behaves in such a manner that when it sends the response, it 
immediately closes the connection after completion. 
   
   We have attached a reproducer to this ticket and the behavior is as below.
   
   When httpcore-nio 4.4.15 is used, the client gets the error:
   
   ```java
   org.apache.http.ConnectionClosedException: Connection closed unexpectedly
   ```
   
   But, when httpcore-nio 4.4.5 is used, the client receives the complete 
response, which was sent from the backend.
   
   We further checked on the following versions and the observations are as 
below. 
   * httpcore-nio 4.4.10 - receives the complete response
   * httpcore-nio 4.4.11 - receives org.apache.http.ConnectionClosedException
   
   In order to replicate the issue, we did a few changes to the 
consumeContent(final ContentDecoder decoder) method inside the 
SimpleInputBuffer class. You may find the changes in the attached source code.
   
   In order to test the behavior, please run the Main class: 
“{**}TestChunkedBackend{**}”.
   
   Tested environment:
   * Java version: 11.0.15.1
   * OS: macOS Monterey (Version 12.12.1) 
   
   A similar issue can be found here 
[https://issues.apache.org/jira/browse/HTTPCORE-706](http://example.com)
   
   Thanks & Regards,
   Sajinie
   
    
   
   
   ---
   
   **Affects:** 4.4.15
   
   **Attachments:**
   - 
[HttpNIOTestClient_new.zip](https://issues.apache.org/jira/secure/attachment/13047550/HttpNIOTestClient_new.zip)
 (_167.38 kB_)
   - 
[HttpNIOTestClient.zip](https://issues.apache.org/jira/secure/attachment/13047189/HttpNIOTestClient.zip)
 (_186.40 kB_)
   - 
[HttpNIOTestClient-1.zip](https://issues.apache.org/jira/secure/attachment/13046934/HttpNIOTestClient-1.zip)
 (_174.08 kB_)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to