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

Test 13 WebSocket Compression (different parameters) #112

Open
mortzdk opened this issue Aug 19, 2020 · 0 comments
Open

Test 13 WebSocket Compression (different parameters) #112

mortzdk opened this issue Aug 19, 2020 · 0 comments

Comments

@mortzdk
Copy link

mortzdk commented Aug 19, 2020

Hi I'm currently working on a websocket server in C.

At this point in time I pass all tests in the testsuite including the compression tests.

One interesting bug that occured in Firefox (after I passed all tests in the testsuite) was when no parameters was send with the permessage-deflate, I was not able to decompress the message.

According to the spec:

Absence of this extension parameter in an extension negotiation response indicates that the server can receive messages compressed using an LZ77 sliding window of up to 32,768 bytes.

I'm not really sure whether some of the tests actually do test this, but if they do, the behaviour is different from the behaviour of Firefox, since I passed all tests but still failed in Firefox.

My issue was solved by choosing the default_max_client_bits to be 15 (2^15 = 32,768 bytes) if the client did not send the client_max_window_bits parameter at all.

I use zlib and before solving the issue I used the value 0 for the windowSize of inflateInit2 or simply inflateInit where no windowSize needs to be given.

I'm not sure whether this is the job of the testsuite to catch such a bug, but at least now you know of the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant