Bug fixes of calculating message length for InfoRequest/Reply
Changes
1. Wrap added InfoReqest processing with try..finally statement
2. InfoRequest serialize bug fix
3. Overide WriteTo() methods of DefaultLispInfoRequest
and DefaultLispReply
Change-Id: Ifc74619508a004f3fa7c940c30a5905d2cd27963
diff --git a/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/LispChannelHandler.java b/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/LispChannelHandler.java
index 1041370..5f809bf 100644
--- a/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/LispChannelHandler.java
+++ b/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/LispChannelHandler.java
@@ -63,19 +63,17 @@
ctx.writeAndFlush(mapNotify);
}
+
+ if (msg instanceof LispInfoRequest) {
+ LispMapServer mapServer = new LispMapServer();
+ LispInfoReply infoReply = mapServer.processInfoRequest((LispInfoRequest) msg);
+
+ ctx.writeAndFlush(infoReply);
+ }
} finally {
+ // try to remove the received message form the buffer
ReferenceCountUtil.release(msg);
}
-
- if (msg instanceof LispInfoRequest) {
- LispMapServer mapServer = new LispMapServer();
- LispInfoReply infoReply = mapServer.processInfoRequest((LispInfoRequest) msg);
-
- // try to remove the received info-request message from buffer
- ReferenceCountUtil.release(msg);
-
- ctx.writeAndFlush(infoReply);
- }
}
@Override