pjfanning commented on PR #548: URL: https://github.com/apache/pekko-http/pull/548#issuecomment-2105189392
I brought back the change that was in #539 and found that HeaderDecompression only works with ByteArrayInputStream. The legacy code always converted the ByteString to ByteArrayInputStream. The PR539 code can return a SequenceInputStream for byte strings that are made up of multiple smaller byte strings. I tried the failing tests and the InputStreams have the same contents whether we force the use of ByteArrayInputStream or use the new ByteString.asInputStream code that can return ByteArrayInputStream or SequenceInputStream. I think the issue is in the hpack (Twitter lib). Its Decoder uses `available` calls to see if there are more bytes. I have found that `available` is not reliable in all InputStream implementations. Most of the time, you just call `read` and stop reading when you get a -1 result. https://github.com/twitter/hpack/blob/master/hpack/src/main/java/com/twitter/hpack/Decoder.java -- 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]
