oknet commented on pull request #7134:
URL: https://github.com/apache/trafficserver/pull/7134#issuecomment-679708907
@shinrich
`git blame 6da43e2b75efe23524bf14394a07bca3fc8bf957 P_UnixNet.h` shows that
this logic has been present from the beginning.
To enable `InactivityCop`, we do not define `INACTIVITY_TIMEOUT`.
```
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 450)
read_disable(NetHandler * nh, UnixNetVConnection * vc)
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 451) {
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 452) #ifdef
INACTIVITY_TIMEOUT
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 453) if
(vc->inactivity_timeout) {
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 454) if
(!vc->write.enabled) {
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 455)
vc->inactivity_timeout->cancel_action();
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 456)
vc->inactivity_timeout = NULL;
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 457) }
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 458) }
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 459) #else
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 460) if
(vc->next_inactivity_timeout_at)
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 461) if
(!vc->write.enabled)
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 462)
vc->next_inactivity_timeout_at = 0;
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 463) #endif
01a15380d5 (John Bradley Plevyak 2009-12-09 23:01:29 +0000 464)
vc->read.enabled = 0;
01a15380d5 (John Bradley Plevyak 2009-12-09 23:01:29 +0000 465)
nh->read_ready_list.remove(vc);
a5345da86f (George Paul 2010-02-24 18:48:42 +0000 466)
vc->ep.modify(-EVENTIO_READ);
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 467) }
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 468)
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 469) static
inline void
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 470)
write_disable(NetHandler * nh, UnixNetVConnection * vc)
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 471) {
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 472) #ifdef
INACTIVITY_TIMEOUT
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 473) if
(vc->inactivity_timeout) {
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 474) if
(!vc->read.enabled) {
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 475)
vc->inactivity_timeout->cancel_action();
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 476)
vc->inactivity_timeout = NULL;
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 477) }
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 478) }
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 479) #else
468058a255 (Mladen Turk 2010-05-13 07:09:39 +0000 480) if
(vc->next_inactivity_timeout_at)
01a15380d5 (John Bradley Plevyak 2009-12-09 23:01:29 +0000 481) if
(!vc->read.enabled)
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 482)
vc->next_inactivity_timeout_at = 0;
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 483) #endif
01a15380d5 (John Bradley Plevyak 2009-12-09 23:01:29 +0000 484)
vc->write.enabled = 0;
01a15380d5 (John Bradley Plevyak 2009-12-09 23:01:29 +0000 485)
nh->write_ready_list.remove(vc);
a5345da86f (George Paul 2010-02-24 18:48:42 +0000 486)
vc->ep.modify(-EVENTIO_WRITE);
a1651345d1 (Andrew Hsu 2009-10-29 23:01:48 +0000 487) }
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]