-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nsqd: fix deflate level handling #927
Conversation
Can you add the deflate level to the log message "upgrading connection to deflate" below? |
50504b7
to
38fdf49
Compare
@ploxiln good idea. PTAL |
nsqd/protocol_v2.go
Outdated
@@ -399,7 +399,7 @@ func (p *protocolV2) IDENTIFY(client *clientV2, params [][]byte) ([]byte, error) | |||
if identifyData.DeflateLevel <= 0 { | |||
deflateLevel = 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more small thing - setting deflateLevel
here has no effect, I think we want to set identifyData.DeflateLevel
to the default of 6 here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of that, we should drop the change on line 402 and update line 398 to:
deflateLevel := identifyData.DeflateLevel
Otherwise the JSON response below would be broken.
nsqd/protocol_v2.go
Outdated
@@ -399,7 +399,7 @@ func (p *protocolV2) IDENTIFY(client *clientV2, params [][]byte) ([]byte, error) | |||
if identifyData.DeflateLevel <= 0 { | |||
deflateLevel = 6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of that, we should drop the change on line 402 and update line 398 to:
deflateLevel := identifyData.DeflateLevel
Otherwise the JSON response below would be broken.
Want to fix the typo reported in #926 while you're in here??!?!?! |
38fdf49
to
7894dc5
Compare
7894dc5
to
b4ca0f3
Compare
This fixes #926 by properly using the client provided deflate level from identify