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]
|
||||
|
||||
Reference in New Issue
Block a user