wiomoc / whatsappweb-rs

WhatsApp Web client for Rust
MIT License
121 stars 37 forks source link

Node has invalid binary format #6

Closed anmay closed 5 years ago

anmay commented 6 years ago

I am facing below issue, Please check it.

2018-07-13 20:52:53 INFO  [presence] new state: Connected
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Msg("Node has invalid binary format"), State { next_error: Some(Error(Msg("Couldn\'t read node content (list), node decription: response"), State { next_error: Some(Error(Msg("Couldn\'t read list item: 529, size: 4354"), State { next_error: Some(Error(Io(Custom { kind: UnexpectedEof, error: StringError("failed to fill whole buffer") }), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })), backtrace: InternalBacktrace { backtrace: None } })), backtrace: InternalBacktrace { backtrace: None } })), backtrace: InternalBacktrace { backtrace: None } })', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Any', libcore/result.rs:945:5
edantie commented 6 years ago

The problem is in node_wire.rs, line 414 for some reason tag may be a LIST_16 Hope that help...

wiomoc commented 6 years ago

@anmay @edantie The problem is caused by the wrong endian in https://github.com/wiomoc/whatsappweb-rs/blob/c4ceba4b106ce86c9944e49023f9233219b25080/src/node_wire.rs#L122

wiomoc commented 6 years ago

Should be fixed on master

edantie commented 6 years ago

Working for me!