don't write anything if theres no data

This commit is contained in:
Asim Aslam 2019-12-31 22:58:14 +00:00
parent 45c986c5f1
commit 6358b9277d

View File

@ -126,6 +126,10 @@ func (c *Codec) Write(m *codec.Message, b interface{}) error {
return err return err
} }
if len(buf) == 0 {
return nil
}
return encode(0, buf, c.Conn) return encode(0, buf, c.Conn)
} }