From 56421a954fb0c982a3fba820fec798bd16df1526 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 7 Feb 2016 10:06:57 +0100 Subject: [PATCH] Fixed FIN with buffered data Fixes #293 --- app/src/main/jni/netguard/netguard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/jni/netguard/netguard.c b/app/src/main/jni/netguard/netguard.c index bb6614ff..d137fde2 100644 --- a/app/src/main/jni/netguard/netguard.c +++ b/app/src/main/jni/netguard/netguard.c @@ -2454,11 +2454,11 @@ jboolean handle_tcp(const struct arguments *args, } else { struct segment *s = cur->forward; - while (s != NULL && compare_u16(s->seq, seq) < 0) { + while (s != NULL && compare_u16(s->seq + s->len, seq) < 0) { s = s->next; } - if (s != NULL && s->seq == seq) - s->confirm = 1; // FIN + if (s != NULL && s->seq + s->len == seq) + s->confirm += 1; // FIN else { log_android(ANDROID_LOG_ERROR, "%s no segment for FIN confirm", session);