Skip to content
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

Merged
merged 1 commit into from
Aug 26, 2017
Merged

Conversation

jehiah
Copy link
Member

@jehiah jehiah commented Aug 14, 2017

This fixes #926 by properly using the client provided deflate level from identify

@jehiah jehiah self-assigned this Aug 14, 2017
@jehiah jehiah added the bug label Aug 14, 2017
@jehiah jehiah requested a review from mreiferson August 14, 2017 04:06
@ploxiln
Copy link
Member

ploxiln commented Aug 14, 2017

Can you add the deflate level to the log message "upgrading connection to deflate" below?

@jehiah jehiah force-pushed the deflate_level_927 branch from 50504b7 to 38fdf49 Compare August 14, 2017 10:40
@jehiah
Copy link
Member Author

jehiah commented Aug 14, 2017

@ploxiln good idea. PTAL

@@ -399,7 +399,7 @@ func (p *protocolV2) IDENTIFY(client *clientV2, params [][]byte) ([]byte, error)
if identifyData.DeflateLevel <= 0 {
deflateLevel = 6
Copy link
Member

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

Copy link
Member

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.

@@ -399,7 +399,7 @@ func (p *protocolV2) IDENTIFY(client *clientV2, params [][]byte) ([]byte, error)
if identifyData.DeflateLevel <= 0 {
deflateLevel = 6
Copy link
Member

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.

@mreiferson
Copy link
Member

Want to fix the typo reported in #926 while you're in here??!?!?!

@jehiah jehiah force-pushed the deflate_level_927 branch from 38fdf49 to 7894dc5 Compare August 14, 2017 23:50
@jehiah jehiah force-pushed the deflate_level_927 branch from 7894dc5 to b4ca0f3 Compare August 15, 2017 03:05
@mreiferson mreiferson merged commit e8833c1 into nsqio:master Aug 26, 2017
@mreiferson mreiferson deleted the deflate_level_927 branch August 26, 2017 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nsqd: deflate level specified from client lib in IDENTIFY not work
3 participants