Code Review
/
openflowjava.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Bug 1935 - Double fireConnectionReady notification
[openflowjava.git]
/
openflow-protocol-impl
/
src
/
main
/
java
/
org
/
opendaylight
/
openflowjava
/
protocol
/
impl
/
core
/
OFFrameDecoder.java
diff --git
a/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java
b/openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java
index 88b11a6a778cbc053b68d7df67f78e8702444f8c..9aa9863a660d8a4588618c293ee5ee270cbda7c3 100644
(file)
--- a/
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java
+++ b/
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/OFFrameDecoder.java
@@
-31,14
+31,19
@@
public class OFFrameDecoder extends ByteToMessageDecoder {
private static final byte LENGTH_INDEX_IN_HEADER = 2;
private static final Logger LOGGER = LoggerFactory.getLogger(OFFrameDecoder.class);
private ConnectionFacade connectionFacade;
private static final byte LENGTH_INDEX_IN_HEADER = 2;
private static final Logger LOGGER = LoggerFactory.getLogger(OFFrameDecoder.class);
private ConnectionFacade connectionFacade;
- private boolean
started
= false;
+ private boolean
firstTlsPass
= false;
/**
* Constructor of class.
/**
* Constructor of class.
- * @param connectionFacade
+ * @param connectionFacade ConnectionFacade that will be notified
+ * with ConnectionReadyNotification after TLS has been successfully set up.
+ * @param tlsPresent true is TLS is required, false otherwise
*/
*/
- public OFFrameDecoder(ConnectionFacade connectionFacade) {
+ public OFFrameDecoder(ConnectionFacade connectionFacade
, boolean tlsPresent
) {
LOGGER.trace("Creating OFFrameDecoder");
LOGGER.trace("Creating OFFrameDecoder");
+ if (tlsPresent) {
+ firstTlsPass = true;
+ }
this.connectionFacade = connectionFacade;
}
this.connectionFacade = connectionFacade;
}
@@
-55,9
+60,9
@@
public class OFFrameDecoder extends ByteToMessageDecoder {
@Override
protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) throws Exception {
@Override
protected void decode(ChannelHandlerContext chc, ByteBuf bb, List<Object> list) throws Exception {
- if (
!started
) {
+ if (
firstTlsPass
) {
connectionFacade.fireConnectionReadyNotification();
connectionFacade.fireConnectionReadyNotification();
-
started = tru
e;
+
firstTlsPass = fals
e;
}
int readableBytes = bb.readableBytes();
if (readableBytes < LENGTH_OF_HEADER) {
}
int readableBytes = bb.readableBytes();
if (readableBytes < LENGTH_OF_HEADER) {