mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 02:35:31 +00:00
http, http_private: rename request workers to swarm workers
This commit is contained in:
parent
fb2794643d
commit
c89406179b
12 changed files with 31 additions and 33 deletions
|
|
@ -1,2 +1,2 @@
|
|||
pub mod request;
|
||||
pub mod socket;
|
||||
pub mod swarm;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pub async fn announce(
|
|||
let request = AnnounceRequest::from_query_string(&query)
|
||||
.map_err(|_| FailureResponse::new("Malformed request"))?;
|
||||
|
||||
let request_worker_index = RequestWorkerIndex::from_info_hash(&config, request.info_hash);
|
||||
let swarm_worker_index = RequestWorkerIndex::from_info_hash(&config, request.info_hash);
|
||||
let opt_user_agent = opt_user_agent.map(|header| header.as_str().to_owned());
|
||||
|
||||
let source_addr = CanonicalSocketAddr::new(source_addr);
|
||||
|
|
@ -43,7 +43,7 @@ pub async fn announce(
|
|||
.await?;
|
||||
|
||||
let response_receiver = request_sender
|
||||
.send_to(request_worker_index, validated_request, source_addr)
|
||||
.send_to(swarm_worker_index, validated_request, source_addr)
|
||||
.await
|
||||
.map_err(|err| internal_error(format!("Sending request over channel failed: {:#}", err)))?;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use crate::config::Config;
|
|||
|
||||
use common::*;
|
||||
|
||||
pub fn run_request_worker(
|
||||
pub fn run_swarm_worker(
|
||||
_sentinel: PanicSentinel,
|
||||
config: Config,
|
||||
request_receiver: Receiver<ChannelAnnounceRequest>,
|
||||
Loading…
Add table
Add a link
Reference in a new issue