dependabot[bot] on npm_and_yarn
Bump node-sass from 4.11.0 to 7… (compare)
kurnevsky on dht_state
refactor(dht): introduce a sing… (compare)
kurnevsky on dht_state
refactor(dht): introduce a sing… (compare)
kurnevsky on rust2021
unrecoverable error
?
Nom5.0 has a concept of
unrecoverable error
, it means that nom can’t continue parsing, so terminating process or thread is needed.
Why terminate process? We can clear our buffer and start parsing again when new data will come from the socket
When I try to run the example I get this:
[2019-06-12T07:42:27Z ERROR tox::toxcore::dht::server_ext] Failed to handle packet: HandlePacketError { ctx: HandleDataResponseError { ctx: HandleDhtPkAnnounceError { ctx: stack backtrace:
...
toxcore/onion/client/mod.rs:515
...
Invalid no_reply }
Failed to handle DHT PublicKey announce }
Handling OnionClient packet failed }
Is this normal?
I am not sure why, but now I get
Processing ended with error: Custom { kind: Other, error: Compat { error: EncodeError { ctx: Os { code: 65, kind: Other, message: "No route to host" }
the only part in the stacktrace that hints to tox is:
11: <tox::toxcore::dht::codec::EncodeError as core::convert::From<std::io::error::Error>>::from::h5f8353515d42ff73 (0x1053cdd2f)
at /Users/inosms/Desktop/tox/src/toxcore/dht/codec.rs:104
any hints?
#[derive(Debug, Clone, PartialEq)]
pub enum Err<E> {
Incomplete(Needed),
Error(E),
Failure(E),
}
#[derive(Clone, Debug, PartialEq, Fail)]
pub enum GetPayloadErrorKind {
/// Error indicates that received payload of encrypted packet can't be decrypted
#[fail(display = "Decrypt payload error")]
Decrypt,
/// Error indicates that decrypted payload of packet can't be parsed
#[fail(display = "Deserialize payload error: {:?}, data: {:?}", error, payload)]
Deserialize {
/// Parsing error
error: nom::Err<(&[u8], ErrorKind)>,
/// Received payload of packet
payload: Vec<u8>,
}
}
error[E0106]: missing lifetime specifier
--> src/toxcore/dht/packet/errors.rs:64:30
|
64 | error: Box<nom::Err<(&[u8], ErrorKind)>>,
| ^ expected lifetime parameter
Fail
requires static but can’t give static.
error[E0597]: `decrypted` does not live long enough
--> src/toxcore/dht/packet/ping_request.rs:93:46
|
93 | match PingRequestPayload::from_bytes(&decrypted) {
| -------------------------------^^^^^^^^^^-
| | |
| | borrowed value does not live long enough
| argument requires that `decrypted` is borrowed for `'static`
…