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

net: log mud receiver stream read errors #969

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

cpu
Copy link
Member

@cpu cpu commented Jan 1, 2024

Previously the MudReceiver logic that could potentially read an Error result from self.connection.read(&mut data) only used the Ok result. If there was an error, data is set to the empty vec and a higher layer treats the empty data as an EOF initiated disconnect. The error is dropped.

This commit breaks out the result handling to log a read error with error!, and otherwise maintains the existing behaviour: returning an empty vec.

Previously the `MudReceiver` logic that could potentially read an
`Error` result from `self.connection.read(&mut data)` only used the `Ok`
result. If there was an error, `data` is set to the empty vec and
a higher layer treats the empty data as an EOF initiated disconnect.

This commit breaks out the result handling to log a read error with
`error!`, and otherwise maintains the existing behaviour: returning an
empty vec.
@coveralls
Copy link

Coverage Status

coverage: 76.036% (+0.1%) from 75.914%
when pulling 716a8a6 on cpu:cpu-log-stream-read-errs
into 6d8ae7c on Blightmud:dev.

@LiquidityC LiquidityC merged commit b144745 into Blightmud:dev Jan 1, 2024
17 checks passed
@cpu cpu deleted the cpu-log-stream-read-errs branch January 1, 2024 12:52
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.

3 participants