Skip to content

Commit 47d645b

Browse files
author
Achille Roussel
committed
fix SASL handshake
1 parent 6f5a903 commit 47d645b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

conn.go

+3
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,10 @@ func (c *Conn) saslAuthenticate(data []byte) ([]byte, error) {
15161516
return nil, err
15171517
}
15181518

1519+
// Pretend there are no limits to how many bytes we may be reading next.
1520+
c.rb.n = math.MaxInt64
15191521
data = c.rb.readBytes()
1522+
c.rb.n = 0
15201523

15211524
if err := c.rb.err; err != nil {
15221525
c.conn.Close()

sasl/sasl_test.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/segmentio/kafka-go"
8+
kafka "github.com/segmentio/kafka-go"
99
"github.com/segmentio/kafka-go/sasl"
1010
"github.com/segmentio/kafka-go/sasl/plain"
1111
"github.com/segmentio/kafka-go/sasl/scram"
@@ -18,9 +18,6 @@ const (
1818
)
1919

2020
func TestSASL(t *testing.T) {
21-
22-
t.Parallel()
23-
2421
tests := []struct {
2522
valid func() sasl.Mechanism
2623
invalid func() sasl.Mechanism

0 commit comments

Comments
 (0)