Migrate to Actix 0.13 APIs, Tokio 1.x, and fix non-UTF-8 messages being dropped silently #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates dependencies (see Cargo.toml) and resolves an issue where
LinesCodec
's decoder would return an error for non-UTF-8 message payloads, and Actix would silently drop the message in response. It is not backwards-compatible with the currently release version 0.4 due to Actix and Tokio being backwards-incompatible.The following and comparable messages where stations used a name encoded with CP 1252 would be dropped:
The cause was that ü encodes to 0xFC under CP 1252, which results in Rust's
str::from_utf8
to fail validation inLinesCodec
, and old Actix versions would silently discard the error without stopping the affected actor. I noticed this because new Actix versions actually do stop the actor. This PR also adds code to log other I/O errors before the actor is stopped.Steps to reproduce: Run
cargo run --example connect | grep 'Name='
on this branch vs. master, and observe that after a few minutesWind:Fürst-Süd
has several status lines in the output of this branch, versus none in master.