jira-importer opened a new issue, #1179: URL: https://github.com/apache/httpcomponents-core/issues/1179
**[Carter Kozak](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ckozak)** opened **[HTTPCORE-646](https://issues.apache.org/jira/browse/HTTPCORE-646?redirect=false)** and commented I profiled a service using hc5 to read chunked responses which are parsed using jackson directly from the entity stream. I've found that a new 4 KiB buffer is created to drain remaining bytes every time close is called, despite the read never producing any data because the next read discovers the terminating chunk. This scenario is likely any time that self-terminating data is parsed, the consumer is able to stop reading prior to receiving an end-of-stream. It's likely that sufficient data already exists in the SessionInputBuffer to avoid unnecessary buffers. To solve this issue it may be enough to attempt a single-byte read prior to using the buffer, or an efficient `InputStream.skip(long)` could be implemented. A globally shared buffer would solve this, however there may be security concerns using a static buffer to dump trailing contents which may include sensitive data, accessible elsewhere in the jvm. --- **Affects:** 5.0.1 -- 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]
