1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-31 03:41:20 +00:00

Attempt to fix upload problems

This commit is contained in:
M66B 2018-01-21 09:57:36 +01:00
parent 301e07652f
commit ac0424c498

View file

@ -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 get_send_window(const struct tcp_session *cur) {
uint32_t behind = (compare_u32(cur->acked, cur->local_seq) <= 0 uint32_t behind;
? cur->local_seq - cur->acked : cur->acked); 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); uint32_t window = (behind < cur->send_window ? cur->send_window - behind : 0);
return window; return window;
} }