Skip to content

ByteArrayLengthHeaderSerializer headerSize Enhancement #2780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ehudtavor opened this issue Mar 4, 2019 · 1 comment
Closed

ByteArrayLengthHeaderSerializer headerSize Enhancement #2780

ehudtavor opened this issue Mar 4, 2019 · 1 comment

Comments

@ehudtavor
Copy link

Affects Version(s): 5.X


Enhancement

ByteArrayLengthHeaderSerializer maintains headerSize, but it seems an inclusive/exclusive indicator is missing.

Some TCP clients would set the payload size - in the headerSize - inclusive the header size, while other TCP clients would set the payload size exclusive the header size.

ByteArrayLengthHeaderSerializer current implementation assumes exclusive mode, which results with wrong serialization/deserialization if the client uses inclusive mode.

Example:
TCP client sends a stream of 108 bytes, with headerSize = 2. Spring assumes that headerSize value would be 106, while our TCP client (3rd party, we cant control) sends headerSize value set to 108. As a result Spring applies wrong ser/des.

Thanks !

@ehudtavor
Copy link
Author

thanks ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants