qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject [1/9] qpid-dispatch git commit: DISPATCH-847 - Fixed Coverity issue 181418 (Unreachable code removed)
Date Wed, 04 Oct 2017 14:48:45 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/master e69478a4e -> 3f5c3aa9c


DISPATCH-847 - Fixed Coverity issue 181418 (Unreachable code removed)


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

Branch: refs/heads/master
Commit: 9556f5871545bac99594d31acf0257cc24a9f809
Parents: e69478a
Author: Ted Ross <tross@redhat.com>
Authored: Wed Oct 4 09:39:05 2017 -0400
Committer: Ted Ross <tross@redhat.com>
Committed: Wed Oct 4 09:39:05 2017 -0400

----------------------------------------------------------------------
 src/router_core/transfer.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/9556f587/src/router_core/transfer.c
----------------------------------------------------------------------
diff --git a/src/router_core/transfer.c b/src/router_core/transfer.c
index ac8044d..e4cbaae 100644
--- a/src/router_core/transfer.c
+++ b/src/router_core/transfer.c
@@ -129,16 +129,16 @@ qdr_delivery_t *qdr_deliver_continue(qdr_delivery_t *in_dlv)
 
 int qdr_link_process_deliveries(qdr_core_t *core, qdr_link_t *link, int credit)
 {
+    printf("qdr_link_process_deliveries - credit: %d\n", credit);
     qdr_connection_t *conn = link->conn;
     qdr_delivery_t   *dlv;
-    bool              drained = false;
     int               offer   = -1;
     bool              settled = false;
     bool              send_complete = false;
     int               num_deliveries_completed = 0;
 
     if (link->link_direction == QD_OUTGOING) {
-        while (credit > 0 && !drained) {
+        while (credit > 0) {
             sys_mutex_lock(conn->work_lock);
             dlv = DEQ_HEAD(link->undelivered);
             sys_mutex_unlock(conn->work_lock);
@@ -176,27 +176,27 @@ int qdr_link_process_deliveries(qdr_core_t *core, qdr_link_t *link,
int credit)
                     //
                     // The message is still being received/sent.
                     // 1. We cannot remove the delivery from the undelivered list.
-                    // This delivery needs to stay at the head of the undelivered list until
the entire message has been sent out i.e other deliveries in the
-                    // undelivered list have to wait before this entire large delivery is
sent out
+                    //    This delivery needs to stay at the head of the undelivered list
until the entire message
+                    //    has been sent out i.e other deliveries in the undelivered list
have to wait before this
+                    //    entire large delivery is sent out
                     // 2. We need to call deliver_handler so any newly arrived bytes can
be pushed out
-                    // 3. We need to break out of this loop otherwise a thread will keep
spinning in here until the entire message has been sent out.
+                    // 3. We need to break out of this loop otherwise a thread will keep
spinning in here until
+                    //    the entire message has been sent out.
                     //
                     sys_mutex_unlock(conn->work_lock);
 
                     //
-                    // Note here that we are not incrementing num_deliveries_processed. Since
this delivery is still coming in or still being sent out,
-                    // we cannot consider this delivery as fully processed.
+                    // Note here that we are not incrementing num_deliveries_processed. Since
this delivery is
+                    // still coming in or still being sent out, we cannot consider this delivery
as fully processed.
                     //
                     return num_deliveries_completed;
                 }
                 sys_mutex_unlock(conn->work_lock);
-
-            }
+            } else
+                break;
         }
 
-        if (drained)
-            core->drained_handler(core->user_context, link);
-        else if (offer != -1)
+        if (offer != -1)
             core->offer_handler(core->user_context, link, offer);
     }
 


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


Mime
View raw message