You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ok...@apache.org on 2017/08/28 02:23:00 UTC

[trafficserver] branch master updated: Correctly Handle EVENT_NONE in UnixNetVConnection::acceptEvent

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

oknet 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 a32f7ed  Correctly Handle EVENT_NONE in UnixNetVConnection::acceptEvent
a32f7ed is described below

commit a32f7ed3e49f595633f59cc44481f42af01f7a58
Author: Oknet Xu <xu...@skyguard.com.cn>
AuthorDate: Tue Aug 22 15:03:39 2017 +0800

    Correctly Handle EVENT_NONE in UnixNetVConnection::acceptEvent
---
 iocore/net/UnixNetVConnection.cc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index c974667..81c707c 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -1119,12 +1119,12 @@ UnixNetVConnection::startEvent(int /* event ATS_UNUSED */, Event *e)
 int
 UnixNetVConnection::acceptEvent(int event, Event *e)
 {
-  thread = e->ethread;
+  EThread *t = (e == nullptr) ? this_ethread() : e->ethread;
 
-  MUTEX_TRY_LOCK(lock, get_NetHandler(thread)->mutex, e->ethread);
+  MUTEX_TRY_LOCK(lock, get_NetHandler(t)->mutex, t);
   if (!lock.is_locked()) {
     if (event == EVENT_NONE) {
-      thread->schedule_in(this, HRTIME_MSECONDS(net_retry_delay));
+      t->schedule_in(this, HRTIME_MSECONDS(net_retry_delay));
       return EVENT_DONE;
     } else {
       e->schedule_in(HRTIME_MSECONDS(net_retry_delay));
@@ -1132,6 +1132,8 @@ UnixNetVConnection::acceptEvent(int event, Event *e)
     }
   }
 
+  thread = t;
+
   if (action_.cancelled) {
     free(thread);
     return EVENT_DONE;

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