GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — Handle non-positive skip lengths in ByteBufInputStream by cuishuang · Pull Request #17388 · netty/netty Conversation
|
|
@cuishuang I think the change is not a bad idea... That said the current behavior is also fine so your commit message is a bit misleading. Can you adjust it ? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9fe0677 to
6cd4cdb
Compare
Thanks for pointing this out. I agree that the current behavior is allowed for an InputStream subclass, so I updated the commit message and PR description to describe this as aligning ByteBufInputStream with the default InputStream behavior rather than fixing a contract violation. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
✅ All tests passed ✅🏷️ Commit: 6cd4cdb Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@cuishuang did you sign our icla yet? https://netty.io/s/icla |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Auto-port PR for 5.0: #17409 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Auto-port PR for 4.1: #17410 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…#17410) Auto-port of #17388 to 4.1 Cherry-picked commit: 87eb426 --- Motivation: ByteBufInputStream currently delegates non-positive skip values to ByteBuf.skipBytes(). This means negative values result in an IllegalArgumentException. While subclasses of InputStream may handle negative values differently, InputStream's default implementation returns 0 without skipping any bytes. Making ByteBufInputStream behave the same way provides more consistent stream behavior. Modification: Return 0 immediately from ByteBufInputStream.skip(long) and skipBytes(int) when the requested length is non-positive. Result: ByteBufInputStream now handles non-positive skip lengths consistently with InputStream's default behavior. Co-authored-by: cui fliter <[email protected]>
…#17409) Auto-port of #17388 to 5.0 Cherry-picked commit: 87eb426 --- Motivation: ByteBufInputStream currently delegates non-positive skip values to ByteBuf.skipBytes(). This means negative values result in an IllegalArgumentException. While subclasses of InputStream may handle negative values differently, InputStream's default implementation returns 0 without skipping any bytes. Making ByteBufInputStream behave the same way provides more consistent stream behavior. Modification: Return 0 immediately from ByteBufInputStream.skip(long) and skipBytes(int) when the requested length is non-positive. Result: ByteBufInputStream now handles non-positive skip lengths consistently with InputStream's default behavior. Co-authored-by: cui fliter <[email protected]>
…netty#17410) Auto-port of netty#17388 to 4.1 Cherry-picked commit: 87eb426 --- Motivation: ByteBufInputStream currently delegates non-positive skip values to ByteBuf.skipBytes(). This means negative values result in an IllegalArgumentException. While subclasses of InputStream may handle negative values differently, InputStream's default implementation returns 0 without skipping any bytes. Making ByteBufInputStream behave the same way provides more consistent stream behavior. Modification: Return 0 immediately from ByteBufInputStream.skip(long) and skipBytes(int) when the requested length is non-positive. Result: ByteBufInputStream now handles non-positive skip lengths consistently with InputStream's default behavior. Co-authored-by: cui fliter <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.