mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
aquatic_ws: mio: replace native_tls with rustls, rewrite connection state logic completely (#38)
* ws: mio: use rustls, rewrite Connection logic * ws: mio: improve poll register/deregister handling * ws: mio: work on type-level poll registry safety * ws: mio: use stronger poll registry type-level guarantees * ws: mio: fix stream reading * ws: clean up, run fmt * ws: mio: don't require registered connection for writing, improve docs * ws: mio: add Connection::get_meta(), make Connection::meta private * ws: mio: add ConnectionMap struct; remove utils.rs * ws: mio: move token counter into ConnectionMap, improve docs * ws: mio: connection: move Connection struct above state structs * Update TODO * ws: fix build errors * ws: upgrade to tungstenite 0.16 * ws load test: don't panic on Close message; print shorter errors * ws: fix socket worker bugs, add log statements * ws: mio: wait for write availability if would block for ws messages * Update README * ws: mio: limit channels & queues; read 1 message only; other fixes * ws: mio: send local responses each event; decrease channel size * Update TODO * ws: mio: limit ws send queue, fixing memory leak; limit pending messages Also change some log output levels and run rustfmt * Update TODO * Update TODO
This commit is contained in:
parent
222fac0e09
commit
67c4c02bbd
13 changed files with 893 additions and 776 deletions
|
|
@ -1,5 +1,4 @@
|
|||
use std::net::SocketAddr;
|
||||
#[cfg(feature = "with-glommio")]
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(feature = "cpu-pinning")]
|
||||
|
|
@ -48,17 +47,9 @@ pub struct NetworkConfig {
|
|||
pub websocket_max_message_size: usize,
|
||||
pub websocket_max_frame_size: usize,
|
||||
|
||||
#[cfg(feature = "with-glommio")]
|
||||
pub tls_certificate_path: PathBuf,
|
||||
#[cfg(feature = "with-glommio")]
|
||||
pub tls_private_key_path: PathBuf,
|
||||
|
||||
#[cfg(feature = "with-mio")]
|
||||
pub use_tls: bool,
|
||||
#[cfg(feature = "with-mio")]
|
||||
pub tls_pkcs12_path: String,
|
||||
#[cfg(feature = "with-mio")]
|
||||
pub tls_pkcs12_password: String,
|
||||
#[cfg(feature = "with-mio")]
|
||||
pub poll_event_capacity: usize,
|
||||
#[cfg(feature = "with-mio")]
|
||||
|
|
@ -143,17 +134,9 @@ impl Default for NetworkConfig {
|
|||
websocket_max_message_size: 64 * 1024,
|
||||
websocket_max_frame_size: 16 * 1024,
|
||||
|
||||
#[cfg(feature = "with-glommio")]
|
||||
tls_certificate_path: "".into(),
|
||||
#[cfg(feature = "with-glommio")]
|
||||
tls_private_key_path: "".into(),
|
||||
|
||||
#[cfg(feature = "with-mio")]
|
||||
use_tls: false,
|
||||
#[cfg(feature = "with-mio")]
|
||||
tls_pkcs12_path: "".into(),
|
||||
#[cfg(feature = "with-mio")]
|
||||
tls_pkcs12_password: "".into(),
|
||||
#[cfg(feature = "with-mio")]
|
||||
poll_event_capacity: 4096,
|
||||
#[cfg(feature = "with-mio")]
|
||||
|
|
@ -176,7 +159,7 @@ impl Default for ProtocolConfig {
|
|||
impl Default for HandlerConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
max_requests_per_iter: 10000,
|
||||
max_requests_per_iter: 256,
|
||||
channel_recv_timeout_microseconds: 200,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue