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/04/25 23:25:26 UTC

[3/3] qpid-proton git commit: PROTON-1469: c libuv proactor on_write called after transport close

PROTON-1469: c libuv proactor on_write called after transport close

on_write() checks that the transport is not write-closed before calling
write_done.


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

Branch: refs/heads/master
Commit: c8f9a2ec895b392b41888ea8959a0a98ca7c03e3
Parents: 5eaf666
Author: Alan Conway <ac...@redhat.com>
Authored: Tue Apr 25 16:28:11 2017 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Tue Apr 25 19:25:02 2017 -0400

----------------------------------------------------------------------
 proton-c/src/core/connection_driver.c | 3 +--
 proton-c/src/proactor/libuv.c         | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c8f9a2ec/proton-c/src/core/connection_driver.c
----------------------------------------------------------------------
diff --git a/proton-c/src/core/connection_driver.c b/proton-c/src/core/connection_driver.c
index f944a68..0c520da 100644
--- a/proton-c/src/core/connection_driver.c
+++ b/proton-c/src/core/connection_driver.c
@@ -111,8 +111,7 @@ pn_bytes_t pn_connection_driver_write_buffer(pn_connection_driver_t *d) {
 }
 
 void pn_connection_driver_write_done(pn_connection_driver_t *d, size_t n) {
-  if (n > 0)
-    pn_transport_pop(d->transport, n);
+  pn_transport_pop(d->transport, n);
 }
 
 bool pn_connection_driver_write_closed(pn_connection_driver_t *d) {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c8f9a2ec/proton-c/src/proactor/libuv.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proactor/libuv.c b/proton-c/src/proactor/libuv.c
index 66b0866..3631e8b 100644
--- a/proton-c/src/proactor/libuv.c
+++ b/proton-c/src/proactor/libuv.c
@@ -742,7 +742,7 @@ static void on_write(uv_write_t* write, int err) {
   pc->writing = 0;
   if (err) {
     pconnection_error(pc, err, "on write to");
-  } else {
+  } else if (!pn_connection_driver_write_closed(&pc->driver)) {
     pn_connection_driver_write_done(&pc->driver, size);
   }
   work_notify(&pc->work);


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