Prevent sockets from lingering to long

This commit is contained in:
M66B 2017-11-10 07:49:27 +01:00
parent b64887dbfa
commit 7b7d5caf3c
2 changed files with 5 additions and 4 deletions

View File

@ -51,13 +51,13 @@
#define UDP_TIMEOUT_ANY 300 // seconds
#define UDP_KEEP_TIMEOUT 60 // seconds
#define TCP_INIT_TIMEOUT 30 // seconds ~net.inet.tcp.keepinit
#define TCP_INIT_TIMEOUT 20 // seconds ~net.inet.tcp.keepinit
#define TCP_IDLE_TIMEOUT 3600 // seconds ~net.inet.tcp.keepidle
#define TCP_CLOSE_TIMEOUT 30 // seconds
#define TCP_CLOSE_TIMEOUT 20 // seconds
#define TCP_KEEP_TIMEOUT 300 // seconds
// https://en.wikipedia.org/wiki/Maximum_segment_lifetime
#define SESSION_MAX 512 // number
#define SESSION_MAX 256 // number
#define SESSION_LIMIT 30 // percent
#define UID_MAX_AGE 30000 // milliseconds

View File

@ -816,7 +816,8 @@ jboolean handle_tcp(const struct arguments *args,
log_android(ANDROID_LOG_DEBUG, "%s handling", session);
cur->tcp.time = time(NULL);
if (!tcphdr->syn)
cur->tcp.time = time(NULL);
cur->tcp.send_window = ntohs(tcphdr->window) << cur->tcp.send_scale;
// Do not change the order of the conditions