Skip to content

Commit

Permalink
Fix typo in parseReadSize
Browse files Browse the repository at this point in the history
Previously the check was against `maxSize`, which comes from the
consumer configuration, so there's no point checking that to see if it
is "HTTP".
  • Loading branch information
alistairking committed Aug 24, 2023
1 parent 89cd6a7 commit 9d25d3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kgo/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ func (cxn *brokerCxn) parseReadSize(sizeBuf []byte) (int32, error) {
return 0, fmt.Errorf("invalid negative response size %d", size)
}
if maxSize := cxn.b.cl.cfg.maxBrokerReadBytes; size > maxSize {
if maxSize == 0x48545450 { // "HTTP"
if size == 0x48545450 { // "HTTP"
return 0, fmt.Errorf("invalid large response size %d > limit %d; the four size bytes are 'HTTP' in ascii, the beginning of an HTTP response; is your broker port correct?", size, maxSize)
}
// A TLS alert is 21, and a TLS alert has the version
Expand Down

0 comments on commit 9d25d3a

Please sign in to comment.