Browse Source

Ignore the number of bytes read returned by ReadFull

In receiveSASLOAuthBearerServerResponse the number of bytes read is
never used nor returned.
Iyed Bennour 6 years ago
parent
commit
c324180821
1 changed files with 2 additions and 3 deletions
  1. 2 3
      broker.go

+ 2 - 3
broker.go

@@ -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
 	}