Skip to content

Commit

Permalink
nsqd: fix deflate level handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jehiah committed Aug 14, 2017
1 parent e8e1040 commit 38fdf49
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nsqd/protocol_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func (p *protocolV2) IDENTIFY(client *clientV2, params [][]byte) ([]byte, error)
if identifyData.DeflateLevel <= 0 {
deflateLevel = 6
}
deflateLevel = int(math.Min(float64(deflateLevel), float64(p.ctx.nsqd.getOpts().MaxDeflateLevel)))
deflateLevel = int(math.Min(float64(identifyData.DeflateLevel), float64(p.ctx.nsqd.getOpts().MaxDeflateLevel)))
}
snappy := p.ctx.nsqd.getOpts().SnappyEnabled && identifyData.Snappy

Expand Down Expand Up @@ -472,7 +472,7 @@ func (p *protocolV2) IDENTIFY(client *clientV2, params [][]byte) ([]byte, error)
}

if deflate {
p.ctx.nsqd.logf(LOG_INFO, "PROTOCOL(V2): [%s] upgrading connection to deflate", client)
p.ctx.nsqd.logf(LOG_INFO, "PROTOCOL(V2): [%s] upgrading connection to deflate (level %d)", client, deflateLevel)
err = client.UpgradeDeflate(deflateLevel)
if err != nil {
return nil, protocol.NewFatalClientErr(err, "E_IDENTIFY_FAILED", "IDENTIFY failed "+err.Error())
Expand Down

0 comments on commit 38fdf49

Please sign in to comment.