You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2017/11/07 02:14:19 UTC

[trafficserver] branch master updated: bug fix: timeout argument not being used

This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new f4a2a27  bug fix: timeout argument not being used
f4a2a27 is described below

commit f4a2a27c12d12ba2cf34350382dfa00410ab07fd
Author: Fei Deng <du...@gmail.com>
AuthorDate: Mon Nov 6 11:06:31 2017 -0600

    bug fix: timeout argument not being used
---
 iocore/net/P_UnixNet.h |  3 ++-
 iocore/net/UnixNet.cc  | 15 ++++++++++-----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/iocore/net/P_UnixNet.h b/iocore/net/P_UnixNet.h
index aca4292..07ebcd1 100644
--- a/iocore/net/P_UnixNet.h
+++ b/iocore/net/P_UnixNet.h
@@ -159,7 +159,8 @@ struct PollCont : public Continuation {
   PollCont(Ptr<ProxyMutex> &m, int pt = net_config_poll_timeout);
   PollCont(Ptr<ProxyMutex> &m, NetHandler *nh, int pt = net_config_poll_timeout);
   ~PollCont();
-  int pollEvent(int event, Event *e);
+  int pollEvent(int, Event *);
+  void do_poll(ink_hrtime timeout);
 };
 
 /**
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index 07b101f..2b7476d 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -124,11 +124,15 @@ PollCont::~PollCont()
 // and stores the resultant events in ePoll_Triggered_Events
 //
 int
-PollCont::pollEvent(int event, Event *e)
+PollCont::pollEvent(int, Event *)
 {
-  (void)event;
-  (void)e;
+  this->do_poll(-1);
+  return EVENT_CONT;
+}
 
+void
+PollCont::do_poll(ink_hrtime timeout)
+{
   if (likely(net_handler)) {
     /* checking to see whether there are connections on the ready_queue (either read or write) that need processing [ebalsa] */
     if (likely(!net_handler->read_ready_list.empty() || !net_handler->write_ready_list.empty() ||
@@ -137,6 +141,8 @@ PollCont::pollEvent(int event, Event *e)
                net_handler->write_ready_list.empty(), net_handler->read_enable_list.empty(),
                net_handler->write_enable_list.empty());
       poll_timeout = 0; // poll immediately returns -- we have triggered stuff to process right now
+    } else if (timeout >= 0) {
+      poll_timeout = ink_hrtime_to_msec(timeout);
     } else {
       poll_timeout = net_config_poll_timeout;
     }
@@ -185,7 +191,6 @@ PollCont::pollEvent(int event, Event *e)
 #else
 #error port me
 #endif
-  return EVENT_CONT;
 }
 
 static void
@@ -472,7 +477,7 @@ NetHandler::waitForActivity(ink_hrtime timeout)
 
   // Polling event by PollCont
   PollCont *p = get_PollCont(this->thread);
-  p->handleEvent(EVENT_NONE, nullptr);
+  p->do_poll(timeout);
 
   // Get & Process polling result
   PollDescriptor *pd     = get_PollDescriptor(this->thread);

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].