gaojieliu commented on code in PR #351:
URL:
https://github.com/apache/httpcomponents-core/pull/351#discussion_r904126821
##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/H2OnlyClientProtocolNegotiator.java:
##########
@@ -131,7 +134,10 @@ public void outputReady(final IOSession session) throws
IOException {
@Override
public void inputReady(final IOSession session, final ByteBuffer src)
throws IOException {
if (src != null) {
- throw new ProtocolNegotiationException("Unexpected input");
+ if (inBuf == null) {
+ inBuf = BufferedData.allocate(src.remaining());
+ }
+ inBuf.put(src);
Review Comment:
https://github.com/apache/httpcomponents-core/blob/master/httpcore5/src/main/java/org/apache/hc/core5/http/impl/nio/BufferedData.java#L75
`BufferedData` is an expandable buffer, so overflow shouldn't happen.
--
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]