From 2a844bd5590fc58a9f68346eaa0554e9df4625f1 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 16 Sep 2021 13:47:09 +0200 Subject: Encoding errors must be logged --- ldapserver/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ldapserver') diff --git a/ldapserver/client.go b/ldapserver/client.go index c9a6f2c..339ae98 100644 --- a/ldapserver/client.go +++ b/ldapserver/client.go @@ -206,7 +206,10 @@ func (c *client) close() { } func (c *client) writeMessage(m *ldap.LDAPMessage) { - data, _ := m.Write() + data, err := m.Write() + if err != nil { + Logger.Errorf("bottin: unable to marshal response message: %v", err) + } //Logger.Printf(">>> %d - %s - hex=%x", c.Numero, m.ProtocolOpName(), data.Bytes()) Logger.Tracef(">>> [%d] %#v", c.Numero, m) -- cgit v1.2.3