mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
If the user has closed the socket then drop a persisting connection
after a much reduced timeout. Typically web servers close their sockets quickly under the assumption that the TCP connections goes away as well. That is not entirely true however. If the peer closed the window we're going to wait for a long time with lots of data in the send buffer. MFC after: 2 weeks
This commit is contained in:
parent
09440655fe
commit
322181c98e
1 changed files with 10 additions and 0 deletions
|
|
@ -447,6 +447,16 @@ tcp_timer_persist(void *xtp)
|
|||
tp = tcp_drop(tp, ETIMEDOUT);
|
||||
goto out;
|
||||
}
|
||||
/*
|
||||
* If the user has closed the socket then drop a persisting
|
||||
* connection after a much reduced timeout.
|
||||
*/
|
||||
if (tp->t_state > TCPS_CLOSE_WAIT &&
|
||||
(ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) {
|
||||
TCPSTAT_INC(tcps_persistdrop);
|
||||
tp = tcp_drop(tp, ETIMEDOUT);
|
||||
goto out;
|
||||
}
|
||||
tcp_setpersist(tp);
|
||||
tp->t_flags |= TF_FORCEDATA;
|
||||
(void) tcp_output(tp);
|
||||
|
|
|
|||
Loading…
Reference in a new issue