summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp/snd.go
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@google.com>2018-09-05 11:47:21 -0700
committerShentubot <shentubot@google.com>2018-09-05 11:48:23 -0700
commitbc5e18c9d1004ee324a794446416a6b108999b9c (patch)
treec17a369779942637d7a13f97c84901776f2e0877 /pkg/tcpip/transport/tcp/snd.go
parent2b8dae0bc5594f7088dd028268efaedbb5a72507 (diff)
Implement TCP keepalives
PiperOrigin-RevId: 211670620 Change-Id: Ia8a3d8ae53a7fece1dee08ee9c74964bd7f71bb7
Diffstat (limited to 'pkg/tcpip/transport/tcp/snd.go')
-rw-r--r--pkg/tcpip/transport/tcp/snd.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/tcpip/transport/tcp/snd.go b/pkg/tcpip/transport/tcp/snd.go
index 096ea9cd4..e4fa89912 100644
--- a/pkg/tcpip/transport/tcp/snd.go
+++ b/pkg/tcpip/transport/tcp/snd.go
@@ -435,6 +435,10 @@ func (s *sender) sendData() {
if !s.resendTimer.enabled() && s.sndUna != s.sndNxt {
s.resendTimer.enable(s.rto)
}
+ // If we have no more pending data, start the keepalive timer.
+ if s.sndUna == s.sndNxt {
+ s.ep.resetKeepaliveTimer(false)
+ }
}
func (s *sender) enterFastRecovery() {