mirror of
https://passt.top/passt
synced 2024-12-22 13:45:32 +00:00
pasta, tcp: Mask EPOLLIN and EPOLLRDHUP after sending FIN
Now that we dropped EPOLLET, we'll keep getting EPOLLRDHUP, and possibly EPOLLIN, even if there's nothing to read anymore. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
492b58d64b
commit
62bace390b
16
tcp.c
16
tcp.c
@ -2735,8 +2735,14 @@ eintr:
|
||||
if (move_from == conn->from &&
|
||||
conn->from_read == conn->from_written) {
|
||||
if (!conn->from_fin_sent) {
|
||||
shutdown(move_to, SHUT_WR);
|
||||
shutdown(conn->to, SHUT_WR);
|
||||
conn->from_fin_sent = 1;
|
||||
|
||||
ev.events = 0;
|
||||
ref.s = move_from;
|
||||
ev.data.u64 = ref.u64,
|
||||
epoll_ctl(c->epollfd, EPOLL_CTL_MOD,
|
||||
move_from, &ev);
|
||||
}
|
||||
|
||||
if (conn->to_fin_sent)
|
||||
@ -2744,8 +2750,14 @@ eintr:
|
||||
} else if (move_from == conn->to &&
|
||||
conn->to_read == conn->to_written) {
|
||||
if (!conn->to_fin_sent) {
|
||||
shutdown(move_to, SHUT_WR);
|
||||
shutdown(conn->from, SHUT_WR);
|
||||
conn->to_fin_sent = 1;
|
||||
|
||||
ev.events = 0;
|
||||
ref.s = move_from;
|
||||
ev.data.u64 = ref.u64,
|
||||
epoll_ctl(c->epollfd, EPOLL_CTL_MOD,
|
||||
move_from, &ev);
|
||||
}
|
||||
|
||||
if (conn->from_fin_sent)
|
||||
|
Loading…
Reference in New Issue
Block a user