BUG-2838: Trim leading whitespaces from incoming NETCONF messages. 27/16927/5
authorGwenael Lambrouin <gwenael.lambrouin@b-com.com>
Thu, 21 May 2015 13:32:35 +0000 (15:32 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 26 May 2015 11:54:11 +0000 (11:54 +0000)
commiteb3ebced9d3471644dece3e4e27cca9451db0685
tree75c757877c607df3cc8c244f8659bf0df678c8c8
parent5734a3672f1b8cd5dd84bfc437d7861743bf1325
BUG-2838: Trim leading whitespaces from incoming NETCONF messages.

Some network devices (such as Cisco routers) send RPC replies with a leading
newline before the XML declaration. The OpenDaylight controller does not accept
those replies: the XML parsing fails.

This patch fixes the NETCONF messages before they are sent to the XML parser:
it removes all the spurious characters at the beginning of the messages.

Change-Id: Ibc6eb6dc5bad6252a3c9bed73d3db83814aff501
Signed-off-by: Gwenael Lambrouin <gwenael.lambrouin@b-com.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/netconf/netconf-netty-util/src/main/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfXMLToMessageDecoder.java
opendaylight/netconf/netconf-netty-util/src/test/java/org/opendaylight/controller/netconf/nettyutil/handler/NetconfXMLToMessageDecoderTest.java