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

fix: Don't report an error on benign end of stream #321

Merged
merged 1 commit into from
Sep 7, 2021
Merged

fix: Don't report an error on benign end of stream #321

merged 1 commit into from
Sep 7, 2021

Conversation

connec
Copy link
Contributor

@connec connec commented Sep 7, 2021

  • 47dc629 fix: Don't report an error on benign end of stream

    The implementation of reading multiple messages from a stream involved
    looping until an error was encountered, and this error would then be
    logged. We typically send just a single message per stream, so this
    implementation meant we would log a serializatione error after reading
    every message.

    This commit updates WireMsg::read_from_stream to return an Option,
    and None is now used to break the loop. No public APIs have changed –
    APIs that must return a message will still return a serialization error
    if the stream ends (though the error message has changed, but this is
    judged to be outside the stable API).

The implementation of reading multiple messages from a stream involved
looping until an error was encountered, and this error would then be
logged. We typically send just a single message per stream, so this
implementation meant we would log a serializatione error after reading
every message.

This commit updates `WireMsg::read_from_stream` to return an `Option`,
and `None` is now used to break the loop. No public APIs have changed –
APIs that must return a message will still return a serialization error
if the stream ends (though the error message has changed, but this is
judged to be outside the stable API).
@connec connec requested a review from a team as a code owner September 7, 2021 11:40
@oetyng oetyng merged commit d1b4e22 into maidsafe:master Sep 7, 2021
@connec connec deleted the no-msg-no-problem branch September 7, 2021 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants