mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: add ErrorResponse, send it when info hash is not allowed
This commit is contained in:
parent
28cc6c261a
commit
1d5eb0dff9
5 changed files with 43 additions and 4 deletions
|
|
@ -104,10 +104,14 @@ pub fn handle_announce_requests(
|
|||
.allows(config.access_list.mode, &request.info_hash.0);
|
||||
|
||||
if !info_hash_allowed {
|
||||
// let response = OutMessage::ErrorResponse();
|
||||
let response = OutMessage::ErrorResponse(ErrorResponse {
|
||||
failure_reason: "Info hash not allowed".into(),
|
||||
action: Some(ErrorResponseAction::Announce),
|
||||
info_hash: Some(request.info_hash),
|
||||
});
|
||||
|
||||
// out_message_sender.send(request_sender_meta, response);
|
||||
// wake_socket_workers[request_sender_meta.worker_index] = true;
|
||||
out_message_sender.send(request_sender_meta, response);
|
||||
wake_socket_workers[request_sender_meta.worker_index] = true;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue