|
|
@@ -1031,7 +1031,7 @@ func (b *Broker) sendSaslAuthenticateRequest(correlationID int32, msg []byte) (i
|
|
|
|
|
|
func (b *Broker) receiveSaslAuthenticateResponse(correlationID int32) ([]byte, error) {
|
|
|
buf := make([]byte, responseLengthSize+correlationIDSize)
|
|
|
- bytesRead, err := io.ReadFull(b.conn, buf)
|
|
|
+ _, err := io.ReadFull(b.conn, buf)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
@@ -1044,8 +1044,7 @@ func (b *Broker) receiveSaslAuthenticateResponse(correlationID int32) ([]byte, e
|
|
|
return nil, fmt.Errorf("correlation ID didn't match, wanted %d, got %d", b.correlationID, header.correlationID)
|
|
|
}
|
|
|
buf = make([]byte, header.length-correlationIDSize)
|
|
|
- c, err := io.ReadFull(b.conn, buf)
|
|
|
- bytesRead += c
|
|
|
+ _, err = io.ReadFull(b.conn, buf)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
@@ -1053,9 +1052,6 @@ func (b *Broker) receiveSaslAuthenticateResponse(correlationID int32) ([]byte, e
|
|
|
if err := versionedDecode(buf, res, 0); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
- if err != nil {
|
|
|
- return nil, err
|
|
|
- }
|
|
|
if res.Err != ErrNoError {
|
|
|
return nil, res.Err
|
|
|
}
|
|
|
@@ -1122,7 +1118,7 @@ func (b *Broker) sendSASLOAuthBearerClientResponse(token *AccessToken, correlati
|
|
|
|
|
|
func (b *Broker) receiveSASLOAuthBearerServerResponse(correlationID int32) (int, error) {
|
|
|
|
|
|
- buf := make([]byte, 8)
|
|
|
+ buf := make([]byte, responseLengthSize+correlationIDSize)
|
|
|
|
|
|
bytesRead, err := io.ReadFull(b.conn, buf)
|
|
|
|
|
|
@@ -1142,7 +1138,7 @@ func (b *Broker) receiveSASLOAuthBearerServerResponse(correlationID int32) (int,
|
|
|
return bytesRead, fmt.Errorf("correlation ID didn't match, wanted %d, got %d", b.correlationID, header.correlationID)
|
|
|
}
|
|
|
|
|
|
- buf = make([]byte, header.length-4)
|
|
|
+ buf = make([]byte, header.length-correlationIDSize)
|
|
|
|
|
|
c, err := io.ReadFull(b.conn, buf)
|
|
|
|