You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/03/07 01:36:24 UTC

qpid-proton git commit: PROTON-4103: libuv.c fix the write race for real

Repository: qpid-proton
Updated Branches:
  refs/heads/master ee29b0918 -> d5c11f3a9


PROTON-4103: libuv.c fix the write race for real


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d5c11f3a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d5c11f3a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d5c11f3a

Branch: refs/heads/master
Commit: d5c11f3a9338aa4b3db345cd3ea64260cbe6248a
Parents: ee29b09
Author: Alan Conway <ac...@redhat.com>
Authored: Mon Mar 6 20:33:32 2017 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Mon Mar 6 20:33:32 2017 -0500

----------------------------------------------------------------------
 proton-c/src/proactor/libuv.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d5c11f3a/proton-c/src/proactor/libuv.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proactor/libuv.c b/proton-c/src/proactor/libuv.c
index 678b683..102fcdd 100644
--- a/proton-c/src/proactor/libuv.c
+++ b/proton-c/src/proactor/libuv.c
@@ -640,6 +640,10 @@ static bool check_wake(pconnection_t *pc) {
 /* Process a pconnection, return true if it has events for a worker thread */
 static bool leader_process_pconnection(pconnection_t *pc) {
   /* Important to do the following steps in order */
+  if (pc->writing) {
+    /* We can't do anything while a write request is pending */
+    return false;
+  }
   if (pc->psocket.tcp.data == NULL) {
     /* Start the connection if not already connected */
     leader_connect(pc);
@@ -664,7 +668,7 @@ static bool leader_process_pconnection(pconnection_t *pc) {
         what = "connection timer start";
         err = uv_timer_start(&pc->timer, on_tick, next_tick, 0);
       }
-      if (!err && !pc->writing) {
+      if (!err) {
         what = "write";
         if (wbuf.size > 0) {
           uv_buf_t buf = uv_buf_init((char*)wbuf.start, wbuf.size);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org