From ac0424c498ce63bbf4c06537055a287498a3d2e2 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 21 Jan 2018 09:57:36 +0100 Subject: [PATCH] Attempt to fix upload problems --- app/src/main/jni/netguard/tcp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/jni/netguard/tcp.c b/app/src/main/jni/netguard/tcp.c index 4fbbbedd..56c8d201 100644 --- a/app/src/main/jni/netguard/tcp.c +++ b/app/src/main/jni/netguard/tcp.c @@ -167,8 +167,11 @@ int monitor_tcp_session(const struct arguments *args, struct ng_session *s, int } uint32_t get_send_window(const struct tcp_session *cur) { - uint32_t behind = (compare_u32(cur->acked, cur->local_seq) <= 0 - ? cur->local_seq - cur->acked : cur->acked); + uint32_t behind; + if (cur->acked <= cur->local_seq) + behind = (cur->local_seq - cur->acked); + else + behind = (0x10000 + cur->local_seq - cur->acked); uint32_t window = (behind < cur->send_window ? cur->send_window - behind : 0); return window; }