Skip to content
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

Framing + Decoded length mismatch #267

Closed
luben opened this issue May 15, 2019 · 1 comment
Closed

Framing + Decoded length mismatch #267

luben opened this issue May 15, 2019 · 1 comment

Comments

@luben
Copy link
Contributor

@luben luben commented May 15, 2019

I will start explaining my use case:

  1. Networking service build on top of tokio.
  2. We communicate using bincode between 2 processes running the same binary.
  3. We frame each message using length delimited framing.

If the prepended length is bigger than the serialized message we are able to deserialize the message and eventually fail on the next message.

Is there a way to configure bincode to fail if supplied a buffer that is bigger that the deserialized message?

It is not a blocker but I feel this is the right thing to do:

  • deserialize does not tell how much of the buffer was consumed so there is no way to discard/split the message and continue in the buffer. So the next message will most likely be corrupted. So why not error early?
  • if there is backward compatibility concerns, it could be an option of Config
@luben
Copy link
Contributor Author

@luben luben commented May 31, 2019

closing as duplicate of #193

@luben luben closed this May 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.