Native reset when remote closes with data buffered

This commit is contained in:
M66B 2016-02-07 17:47:18 +01:00
parent 6383345bf7
commit cde04f9829
1 changed files with 17 additions and 11 deletions

View File

@ -1318,6 +1318,7 @@ void check_tcp_sockets(const struct arguments *args, fd_set *rfds, fd_set *wfds,
log_android(ANDROID_LOG_INFO, "recv empty state %s",
strstate(cur->state));
if (cur->forward == NULL) {
if (write_fin_ack(args, cur) >= 0) {
cur->local_seq++; // local FIN
@ -1332,6 +1333,11 @@ void check_tcp_sockets(const struct arguments *args, fd_set *rfds, fd_set *wfds,
log_android(ANDROID_LOG_INFO, "Half close state %s",
strstate(cur->state));
}
}
else {
// There was still data to send
write_rst(args, cur);
}
} else {
// Socket read data
log_android(ANDROID_LOG_DEBUG,