AlreadyReading flag not used correctly 55/32855/1
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Fri, 15 Jan 2016 20:50:23 +0000 (21:50 +0100)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Fri, 15 Jan 2016 21:13:41 +0000 (21:13 +0000)
 - alreadyReading field is set correctly in channelRead() to signal that
   reading occurs and that any tries to flush are not needed, as a flush
   is always scheduled after the reading is done
 - alreadyReading flag was not set back to false, which
   might cause unnecessary checks for flush being scheduled

Change-Id: Icafdf282390340b176cbe4d9702c84558af8b412
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
(cherry picked from commit 1de9685954275657b096f2e4f325f247028cb7e8)

openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/AbstractOutboundQueueManager.java

index 520d145d87523872d422597c096e24487fdbf164..8febb15865f5ffbe024ff84e4cee44b04e91ae80 100644 (file)
@@ -143,10 +143,11 @@ abstract class AbstractOutboundQueueManager<T extends OutboundQueueHandler, O ex
         // we'll steal its work. Note that more work may accumulate in the time window
         // between now and when the task will run, so it may not be a no-op after all.
         //
-        // The reason for this is to will the output buffer before we go into selection
+        // The reason for this is to fill the output buffer before we go into selection
         // phase. This will make sure the pipe is full (in which case our next wake up
         // will be the queue becoming writable).
         writeAndFlush();
+        alreadyReading = false;
     }
 
     @Override