From 558aa3f246eb277f7316b34eb0e7c2aff1329c07 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Thu, 30 Nov 2023 16:52:03 +0000 Subject: [PATCH] Fix accidentally removed line - sending nodes on getPeersRequest --- crates/dht/src/dht.rs | 2 ++ crates/librqbit/webui/src/index.tsx | 9 ++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/dht/src/dht.rs b/crates/dht/src/dht.rs index 465555f..5f91aea 100644 --- a/crates/dht/src/dht.rs +++ b/crates/dht/src/dht.rs @@ -662,6 +662,7 @@ impl DhtState { } MessageKind::GetPeersRequest(req) => { // TODO: respond with peer info, for now sending an empty response. + let compact_node_info = generate_compact_nodes(req.info_hash); self.routing_table.write().mark_last_query(&req.id); let message = Message { transaction_id: msg.transaction_id, @@ -669,6 +670,7 @@ impl DhtState { ip: None, kind: MessageKind::Response(bprotocol::Response { id: self.id, + nodes: Some(compact_node_info), ..Default::default() }), }; diff --git a/crates/librqbit/webui/src/index.tsx b/crates/librqbit/webui/src/index.tsx index cdafa9e..54e6df4 100644 --- a/crates/librqbit/webui/src/index.tsx +++ b/crates/librqbit/webui/src/index.tsx @@ -505,11 +505,10 @@ const FileSelectionModal = (props: { const handleUpload = async () => { setUploading(true); - API.uploadTorrent(data, { selectedFiles, unpopularTorrent }).then( - () => { - onHide(); - ctx.refreshTorrents(); - }, + API.uploadTorrent(data, { selectedFiles, unpopularTorrent }).then(() => { + onHide(); + ctx.refreshTorrents(); + }, (e) => { setUploadError({ text: 'Error starting torrent', details: e }); }