Added buffer clearing on failed serialization (prevents from sending incomplete messages) 24/3824/1
authorMichal Polkorab <michal.polkorab@pantheon.sk>
Wed, 18 Dec 2013 15:04:32 +0000 (16:04 +0100)
committerMichal Polkorab <michal.polkorab@pantheon.sk>
Wed, 18 Dec 2013 15:04:39 +0000 (16:04 +0100)
Signed-off-by: Michal Polkorab <michal.polkorab@pantheon.sk>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFEncoder.java

index 3c77e64ea2db23d659c02dd704e07d16bfdbad4d..a62384178473422f9cbaf96825fab3e08485e010 100644 (file)
@@ -40,6 +40,7 @@ public class OFEncoder extends MessageToByteEncoder<OfHeader> {
         } catch(Exception e) {
             LOGGER.error("Message serialization failed");
             LOGGER.error(e.getMessage(), e);
+            out.clear();
             return;
         }
         if (out.readableBytes() > 0) {