fix(proxy): adjust default proxy timeouts and keep-alive behavior to shorter, more consistent values
This commit is contained in:
@@ -298,7 +298,7 @@ impl RustProxyOptions {
|
||||
|
||||
/// Get the effective connection timeout in milliseconds.
|
||||
pub fn effective_connection_timeout(&self) -> u64 {
|
||||
self.connection_timeout.unwrap_or(30_000)
|
||||
self.connection_timeout.unwrap_or(60_000)
|
||||
}
|
||||
|
||||
/// Get the effective initial data timeout in milliseconds.
|
||||
@@ -308,12 +308,12 @@ impl RustProxyOptions {
|
||||
|
||||
/// Get the effective socket timeout in milliseconds.
|
||||
pub fn effective_socket_timeout(&self) -> u64 {
|
||||
self.socket_timeout.unwrap_or(3_600_000)
|
||||
self.socket_timeout.unwrap_or(60_000)
|
||||
}
|
||||
|
||||
/// Get the effective max connection lifetime in milliseconds.
|
||||
pub fn effective_max_connection_lifetime(&self) -> u64 {
|
||||
self.max_connection_lifetime.unwrap_or(86_400_000)
|
||||
self.max_connection_lifetime.unwrap_or(3_600_000)
|
||||
}
|
||||
|
||||
/// Get all unique ports that routes listen on.
|
||||
@@ -377,10 +377,10 @@ mod tests {
|
||||
#[test]
|
||||
fn test_default_timeouts() {
|
||||
let options = RustProxyOptions::default();
|
||||
assert_eq!(options.effective_connection_timeout(), 30_000);
|
||||
assert_eq!(options.effective_connection_timeout(), 60_000);
|
||||
assert_eq!(options.effective_initial_data_timeout(), 60_000);
|
||||
assert_eq!(options.effective_socket_timeout(), 3_600_000);
|
||||
assert_eq!(options.effective_max_connection_lifetime(), 86_400_000);
|
||||
assert_eq!(options.effective_socket_timeout(), 60_000);
|
||||
assert_eq!(options.effective_max_connection_lifetime(), 3_600_000);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -118,10 +118,10 @@ pub struct ConnectionConfig {
|
||||
impl Default for ConnectionConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
connection_timeout_ms: 30_000,
|
||||
connection_timeout_ms: 60_000,
|
||||
initial_data_timeout_ms: 60_000,
|
||||
socket_timeout_ms: 3_600_000,
|
||||
max_connection_lifetime_ms: 86_400_000,
|
||||
socket_timeout_ms: 60_000,
|
||||
max_connection_lifetime_ms: 3_600_000,
|
||||
graceful_shutdown_timeout_ms: 30_000,
|
||||
max_connections_per_ip: None,
|
||||
connection_rate_limit_per_minute: None,
|
||||
|
||||
Reference in New Issue
Block a user