Fix: add missing goto pending if data is inflight
authorDavid Goulet <dgoulet@efficios.com>
Tue, 18 Dec 2012 17:09:09 +0000 (12:09 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 18 Dec 2012 17:09:09 +0000 (12:09 -0500)
There was only a detection for data NOT inflight and for data inflight,
if a relayd was found, was simply exiting the loop and return no data
pending.

Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c

index 0df073523e5361e09050c7b8dcd8f47bfdd09e2a..1de9cbadbd053749baa81d1a800975dd2bb22a8b 100644 (file)
@@ -3028,10 +3028,12 @@ int consumer_data_pending(uint64_t id)
                ret = relayd_end_data_pending(&relayd->control_sock,
                                relayd->relayd_session_id, &is_data_inflight);
                pthread_mutex_unlock(&relayd->ctrl_sock_mutex);
-               if (ret < 0 || !is_data_inflight) {
-                       /* On error or if NO data inflight, no data is pending. */
+               if (ret < 0) {
                        goto data_not_pending;
                }
+               if (is_data_inflight) {
+                       goto data_pending;
+               }
        }
 
        /*
This page took 0.027656 seconds and 4 git commands to generate.