mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: move comment on empty info hashes to network.rs
This commit is contained in:
parent
786642f486
commit
23c2eff6f3
2 changed files with 2 additions and 2 deletions
|
|
@ -282,8 +282,6 @@ pub fn handle_scrape_request(
|
||||||
&mut torrent_maps.ipv6
|
&mut torrent_maps.ipv6
|
||||||
};
|
};
|
||||||
|
|
||||||
// If request.info_hashes is empty, don't return scrape for all
|
|
||||||
// torrents, even though reference server does it. It is too expensive.
|
|
||||||
for info_hash in info_hashes.into_iter().take(num_to_take) {
|
for info_hash in info_hashes.into_iter().take(num_to_take) {
|
||||||
if let Some(torrent_data) = torrent_map.get(&info_hash) {
|
if let Some(torrent_data) = torrent_map.get(&info_hash) {
|
||||||
let stats = ScrapeStatistics {
|
let stats = ScrapeStatistics {
|
||||||
|
|
|
||||||
|
|
@ -305,6 +305,8 @@ impl Connection {
|
||||||
let info_hashes = if let Some(info_hashes) = info_hashes {
|
let info_hashes = if let Some(info_hashes) = info_hashes {
|
||||||
info_hashes
|
info_hashes
|
||||||
} else {
|
} else {
|
||||||
|
// If request.info_hashes is empty, don't return scrape for all
|
||||||
|
// torrents, even though reference server does it. It is too expensive.
|
||||||
let out_message = OutMessage::ErrorResponse(ErrorResponse {
|
let out_message = OutMessage::ErrorResponse(ErrorResponse {
|
||||||
action: Some(ErrorResponseAction::Scrape),
|
action: Some(ErrorResponseAction::Scrape),
|
||||||
failure_reason: "Full scrapes are not allowed".into(),
|
failure_reason: "Full scrapes are not allowed".into(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue