Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
slaunay committed Dec 3, 2019
1 parent 26344ea commit 0acbf44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ func (b *Broker) send(rb protocolBody, promiseResponse bool) (*responsePromise,
}

requestTime := time.Now()
// Will be decremented in responseReceiver (except error or request with NoResponse)
b.addRequestInFlightMetrics(1)
bytes, err := b.write(buf)
b.updateOutgoingCommunicationMetrics(bytes)
Expand Down Expand Up @@ -900,7 +901,7 @@ func (b *Broker) sendAndReceiveSASLHandshake(saslType SASLMechanism, version int
}

requestTime := time.Now()
// Will be decremented in the responseReceiver (except error or request with NoResponse)
// Will be decremented in updateIncomingCommunicationMetrics (except error)
b.addRequestInFlightMetrics(1)
bytes, err := b.write(buf)
b.updateOutgoingCommunicationMetrics(bytes)
Expand Down Expand Up @@ -997,6 +998,7 @@ func (b *Broker) sendAndReceiveV0SASLPlainAuth() error {
copy(authBytes[4:], []byte("\x00"+b.conf.Net.SASL.User+"\x00"+b.conf.Net.SASL.Password))

requestTime := time.Now()
// Will be decremented in updateIncomingCommunicationMetrics (except error)
b.addRequestInFlightMetrics(1)
bytesWritten, err := b.write(authBytes)
b.updateOutgoingCommunicationMetrics(bytesWritten)
Expand Down Expand Up @@ -1026,6 +1028,7 @@ func (b *Broker) sendAndReceiveV1SASLPlainAuth() error {

requestTime := time.Now()

// Will be decremented in updateIncomingCommunicationMetrics (except error)
b.addRequestInFlightMetrics(1)
bytesWritten, err := b.sendSASLPlainAuthClientResponse(correlationID)
b.updateOutgoingCommunicationMetrics(bytesWritten)
Expand Down Expand Up @@ -1086,6 +1089,7 @@ func (b *Broker) sendAndReceiveSASLOAuth(provider AccessTokenProvider) error {
func (b *Broker) sendClientMessage(message []byte) (bool, error) {

requestTime := time.Now()
// Will be decremented in updateIncomingCommunicationMetrics (except error)
b.addRequestInFlightMetrics(1)
correlationID := b.correlationID

Expand Down Expand Up @@ -1131,6 +1135,7 @@ func (b *Broker) sendAndReceiveSASLSCRAMv1() error {

for !scramClient.Done() {
requestTime := time.Now()
// Will be decremented in updateIncomingCommunicationMetrics (except error)
b.addRequestInFlightMetrics(1)
correlationID := b.correlationID
bytesWritten, err := b.sendSaslAuthenticateRequest(correlationID, []byte(msg))
Expand Down

0 comments on commit 0acbf44

Please sign in to comment.