Use constant for error

Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
Matthias Hanel
2020-02-18 10:54:12 -05:00
parent a5b3cf2ead
commit 329cc7225b

View File

@@ -855,7 +855,7 @@ func (c *client) parse(buf []byte) error {
// exact at all but the performance hit is too great to be precise, and
// catching here should prevent memory exhaustion attacks.
if len(c.argBuf) > int(mcl) {
c.sendErr("Maximum Control Line Exceeded")
c.sendErr(ErrMaxControlLine.Error())
c.closeConnection(MaxControlLineExceeded)
return ErrMaxControlLine
}