This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 47724ce Do not lose original inactivity timeout on disable (#7134)
47724ce is described below
commit 47724ce4125a9a95585d2b5014be298c7f154e83
Author: Susan Hinrichs <[email protected]>
AuthorDate: Mon Sep 14 12:05:09 2020 -0500
Do not lose original inactivity timeout on disable (#7134)
(cherry picked from commit a4e203da740abe9b10661576d54476d5d8700c90)
---
iocore/net/P_UnixNet.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/iocore/net/P_UnixNet.h b/iocore/net/P_UnixNet.h
index 2c74a3e..cd87219 100644
--- a/iocore/net/P_UnixNet.h
+++ b/iocore/net/P_UnixNet.h
@@ -548,7 +548,9 @@ static inline void
read_disable(NetHandler *nh, NetEvent *ne)
{
if (!ne->write.enabled) {
- ne->set_inactivity_timeout(0);
+ // Clear the next scheduled inactivity time, but don't clear
inactivity_timeout_in,
+ // so the current timeout is used when the NetEvent is reenabled and not
the default inactivity timeout
+ ne->next_inactivity_timeout_at = 0;
Debug("socket", "read_disable updating inactivity_at %" PRId64 ",
NetEvent=%p", ne->next_inactivity_timeout_at, ne);
}
ne->read.enabled = 0;
@@ -569,7 +571,9 @@ static inline void
write_disable(NetHandler *nh, NetEvent *ne)
{
if (!ne->read.enabled) {
- ne->set_inactivity_timeout(0);
+ // Clear the next scheduled inactivity time, but don't clear
inactivity_timeout_in,
+ // so the current timeout is used when the NetEvent is reenabled and not
the default inactivity timeout
+ ne->next_inactivity_timeout_at = 0;
Debug("socket", "write_disable updating inactivity_at %" PRId64 ",
NetEvent=%p", ne->next_inactivity_timeout_at, ne);
}
ne->write.enabled = 0;