Barrier turn on/off - no Barrier pipeline
[openflowjava.git] / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / core / connection / OutboundQueueEntry.java
index a97a50e9b8d1fb1e3843bfeff61b00f03c9432ff..70900cad5497b30910a664baec6aeaa7b8e2dd77 100644 (file)
@@ -58,15 +58,21 @@ final class OutboundQueueEntry {
 
     OfHeader takeMessage() {
         final OfHeader ret = message;
-        checkCompletionNeed();
+        if (!barrier) {
+            checkCompletionNeed();
+        }
         message = null;
         return ret;
     }
 
     private void checkCompletionNeed() {
-        if (callback == null || PacketOutInput.class.isInstance(message)) {
+        if (callback == null || (message instanceof PacketOutInput)) {
             completed = true;
-            callback = null;
+            if (callback != null) {
+                callback.onSuccess(null);
+                callback = null;
+            }
+            committed = false;
         }
     }