http: move network.rs and handlers.rs to new workers dir, rename

This commit is contained in:
Joakim Frostegård 2021-11-27 18:26:57 +01:00
parent 4071d4d874
commit 1e77745a84
4 changed files with 6 additions and 7 deletions

View file

@ -15,9 +15,8 @@ use std::{
use crate::config::Config;
mod common;
mod workers;
pub mod config;
mod handlers;
mod network;
pub const APP_NAME: &str = "aquatic_http: HTTP/TLS BitTorrent tracker";
@ -86,7 +85,7 @@ pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
WorkerIndex::SocketWorker(i),
);
network::run_socket_worker(
workers::socket::run_socket_worker(
config,
state,
tls_config,
@ -116,7 +115,7 @@ pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
WorkerIndex::RequestWorker(i),
);
handlers::run_request_worker(config, state, request_mesh_builder, response_mesh_builder)
workers::request::run_request_worker(config, state, request_mesh_builder, response_mesh_builder)
.await
});

View file

@ -0,0 +1,2 @@
pub mod request;
pub mod socket;

View file

@ -24,11 +24,9 @@ use glommio::timer::TimerActionRepeat;
use glommio::{enclose, prelude::*};
use slab::Slab;
use crate::common::num_digits_in_usize;
use crate::common::*;
use crate::config::Config;
use super::common::*;
const INTERMEDIATE_BUFFER_SIZE: usize = 1024;
const MAX_REQUEST_SIZE: usize = 2048;