good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit e2016acc authored by Anmol Sethi's avatar Anmol Sethi
Browse files

Merge branch 'dev'

parents b4e4f4f1 454aee86
No related branches found
No related tags found
No related merge requests found
...@@ -138,7 +138,8 @@ func (c *Conn) Read(ctx context.Context) (MessageType, []byte, error) { ...@@ -138,7 +138,8 @@ func (c *Conn) Read(ctx context.Context) (MessageType, []byte, error) {
if err != nil { if err != nil {
return 0, nil, fmt.Errorf("failed to read: %w", err) return 0, nil, fmt.Errorf("failed to read: %w", err)
} }
if int64(len(p)) > c.msgReadLimit.Load() { readLimit := c.msgReadLimit.Load()
if readLimit >= 0 && int64(len(p)) > readLimit {
err := fmt.Errorf("read limited at %v bytes", c.msgReadLimit.Load()) err := fmt.Errorf("read limited at %v bytes", c.msgReadLimit.Load())
c.Close(StatusMessageTooBig, err.Error()) c.Close(StatusMessageTooBig, err.Error())
return 0, nil, err return 0, nil, err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment