fix(peer): wait for the transfer token before the download lookup
The listener looked the download up immediately after the PeerInit(F), but the 4-byte transfer token routinely arrives in a separate TCP segment, so every firewalled peer download failed with "Download info missing". Wait for the token within the handshake deadline and give up on the connection when it never arrives. Also quiets the dispatcher's unhandled-message-code log to debug; the server routinely sends codes the library doesn't implement. Fixes #41
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::message::{Message, handlers::Handlers};
|
||||
use std::sync::mpsc::Sender;
|
||||
|
||||
use crate::warn;
|
||||
use crate::debug;
|
||||
|
||||
pub struct MessageDispatcher<Op> {
|
||||
owner_name: String,
|
||||
@@ -30,7 +30,7 @@ impl<Op> MessageDispatcher<Op> {
|
||||
message.set_pointer(8);
|
||||
handler.handle(message, self.sender.clone());
|
||||
} else {
|
||||
warn!(
|
||||
debug!(
|
||||
"[{}:dispatcher] No handler found for message code: {code}",
|
||||
self.owner_name
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user