Skip to content

Commit b0417a3

Browse files
committed
Prevent error when no peers with udp
1 parent f478f3b commit b0417a3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/torrust_udp_tracker/handlers.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ pub async fn handle_announce(remote_addr: SocketAddr, announce_request: &Announc
8585
// get all peers excluding the client_addr
8686
let peers = match tracker.get_torrent_peers(&wrapped_announce_request.info_hash, &peer.peer_addr).await {
8787
Some(v) => v,
88-
None => { return Err(ServerError::NoPeersFound); }
88+
None => {
89+
// return Err(ServerError::NoPeersFound);
90+
let return_data: Vec<TorrentPeer> = Vec::new();
91+
return_data
92+
}
8993
};
9094

9195
Ok(Response::from(AnnounceResponse {

0 commit comments

Comments
 (0)