qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [29/38] qpid-proton git commit: PROTON-1403: C libuv proactor was not delivering interrupts correctly
Date Thu, 23 Feb 2017 22:51:36 GMT
PROTON-1403: C libuv proactor was not delivering interrupts correctly


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

Branch: refs/heads/go1
Commit: 6b6dd86990be06ec10d0abc94a55b63b565287c6
Parents: 31a3c99
Author: Alan Conway <aconway@redhat.com>
Authored: Mon Feb 20 13:29:40 2017 -0500
Committer: Alan Conway <aconway@redhat.com>
Committed: Mon Feb 20 15:12:34 2017 -0500

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


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6b6dd869/proton-c/src/proactor/libuv.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proactor/libuv.c b/proton-c/src/proactor/libuv.c
index d2badbe..c7322cd 100644
--- a/proton-c/src/proactor/libuv.c
+++ b/proton-c/src/proactor/libuv.c
@@ -71,7 +71,6 @@
   of the uv_tcp_t handle, and executed in an on_close() handler when it is safe.
 */
 
-const char *COND_NAME = "proactor";
 const char *AMQP_PORT = "5672";
 const char *AMQP_PORT_NAME = "amqp";
 const char *AMQPS_PORT = "5671";
@@ -356,7 +355,7 @@ int pconnection_error(pconnection_t *pc, int err, const char* what) {
   if (err) {
     pn_connection_driver_t *driver = &pc->driver;
     pn_connection_driver_bind(driver); /* Bind so errors will be reported */
-    pn_connection_driver_errorf(driver, COND_NAME, "%s %s:%s: %s",
+    pn_connection_driver_errorf(driver, uv_err_name(err), "%s %s:%s: %s",
                                 what, fixstr(pc->psocket.host), fixstr(pc->psocket.port),
                                 uv_strerror(err));
     pn_connection_driver_close(driver);
@@ -629,7 +628,7 @@ static void listener_to_worker(pn_listener_t *l) {
     to_worker(&l->psocket);
   } else if (l->err) {
     if (l->err != UV_EOF) {
-      pn_condition_format(l->condition, COND_NAME, "%s %s:%s: %s",
+      pn_condition_format(l->condition, uv_err_name(l->err), "%s %s:%s: %s",
                           l->what, fixstr(l->psocket.host), fixstr(l->psocket.port),
                           uv_strerror(l->err));
     }
@@ -721,9 +720,9 @@ void pn_proactor_done(pn_proactor_t *p, pn_event_batch_t *batch) {
     uv_mutex_lock(&p->lock);
     p->batch_working = false;
     uv_mutex_unlock(&p->lock);
+    uv_async_send(&p->async); /* Wake leader */
     return;
   }
-  uv_async_send(&p->async); /* Wake leader */
 }
 
 /* Process the leader_q, in the leader thread */
@@ -802,7 +801,7 @@ void pn_proactor_interrupt(pn_proactor_t *p) {
   uv_mutex_lock(&p->lock);
   ++p->interrupt;
   uv_mutex_unlock(&p->lock);
-  uv_async_send(&p->async);   /* Interrupt the UV loop */
+  uv_async_send(&p->async);   /* Wake the UV loop */
 }
 
 void pn_proactor_set_timeout(pn_proactor_t *p, pn_millis_t t) {
@@ -810,7 +809,7 @@ void pn_proactor_set_timeout(pn_proactor_t *p, pn_millis_t t) {
   p->timeout = t;
   p->timeout_request = true;
   uv_mutex_unlock(&p->lock);
-  uv_async_send(&p->async);   /* Interrupt the UV loop */
+  uv_async_send(&p->async);   /* Wake the UV loop */
 }
 
 int pn_proactor_connect(pn_proactor_t *p, pn_connection_t *c, const char *host, const char
*port) {


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


Mime
View raw message