mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Suggestion to improve tracing in nats-server through wrapping errors
Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
@@ -855,9 +855,11 @@ 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(ErrMaxControlLine.Error())
|
||||
err := NewErrorCtx(ErrMaxControlLine, "State %d, max_control_line %d, Buffer len %d",
|
||||
c.state, int(mcl), len(c.argBuf))
|
||||
c.sendErr(err.Error())
|
||||
c.closeConnection(MaxControlLineExceeded)
|
||||
return ErrMaxControlLine
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user