From 511a0dfcecf5318700d3eb743e5cd90ee124385d Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 12 Apr 2021 16:45:56 +0300 Subject: [PATCH] dont fail empty payload Signed-off-by: Vasiliy Tolstov --- xml.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xml.go b/xml.go index 257f8ae..1676b9d 100644 --- a/xml.go +++ b/xml.go @@ -54,7 +54,11 @@ func (c *xmlCodec) ReadBody(conn io.Reader, b interface{}) error { return nil } - return xml.NewDecoder(conn).Decode(b) + err := xml.NewDecoder(conn).Decode(b) + if err == io.EOF { + return nil + } + return err } func (c *xmlCodec) Write(conn io.Writer, m *codec.Message, b interface{}) error {