summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
815f175)
Once we transition to FAILED state, we should not process any other
messages, as we just waiting for close() to complete.
JIRA: NETCONF-905
Change-Id: Id7d7f657e50bb7c7ad25c1445fa0b69e1e57cdb9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
- protected final synchronized boolean ifNegotiatedAlready() {
+ protected final boolean ifNegotiatedAlready() {
// Indicates whether negotiation already started
// Indicates whether negotiation already started
- return this.state != State.IDLE;
+ return state() != State.IDLE;
+ }
+
+ private synchronized State state() {
+ return state;
}
private static @Nullable SslHandler getSslHandler(final Channel channel) {
}
private static @Nullable SslHandler getSslHandler(final Channel channel) {
@Override
@SuppressWarnings("checkstyle:illegalCatch")
public final void channelRead(final ChannelHandlerContext ctx, final Object msg) {
@Override
@SuppressWarnings("checkstyle:illegalCatch")
public final void channelRead(final ChannelHandlerContext ctx, final Object msg) {
+ if (state() == State.FAILED) {
+ // We have already failed -- do not process any more messages
+ return;
+ }
+
LOG.debug("Negotiation read invoked on channel {}", channel);
try {
handleMessage((NetconfHelloMessage) msg);
LOG.debug("Negotiation read invoked on channel {}", channel);
try {
handleMessage((NetconfHelloMessage) msg);