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

permessage-deflate decompression support in websocket #3263

Merged
merged 20 commits into from
May 20, 2024

Conversation

KhafraDev
Copy link
Member

https://www.rfc-editor.org/rfc/rfc7692

Famous last words, but I'm looking at the spec and it doesn't seem too difficult to implement.

Copy link
Contributor

github-actions bot commented May 15, 2024

Autobahn Test Report

Summary

Type Count
OK 456
Failed 54
Non-Strict 4
Wrong Code 0
Unclean 0
Failed By Client 0
Informational 3
Unimplemented 0
Total Tests 517
Details
Test Case Behavior Close Behavior Duration Remote Close Code
1.1.1 OK OK 2 1000
1.1.2 OK OK 2 1000
1.1.3 OK OK 2 1000
1.1.4 OK OK 2 1000
1.1.5 OK OK 2 1000
1.1.6 OK OK 7 1000
1.1.7 OK OK 7 1000
1.1.8 OK OK 26 1000
1.2.1 OK OK 2 1000
1.2.2 OK OK 4 1000
1.2.3 OK OK 2 1000
1.2.4 OK OK 2 1000
1.2.5 OK OK 2 1000
1.2.6 OK OK 7 1000
1.2.7 OK OK 6 1000
1.2.8 OK OK 16 1000
2.1 OK OK 1 1000
2.2 OK OK 2 1000
2.3 OK OK 2 1000
2.4 OK OK 1 1000
2.5 OK OK 2 null
2.6 OK OK 35 1000
2.7 OK OK 1 1000
2.8 OK OK 1 1000
2.9 OK OK 2 1000
2.10 OK OK 4 1000
2.11 OK OK 25 1000
3.1 OK OK 1 null
3.2 OK OK 1 null
3.3 OK OK 1 null
3.4 OK OK 10 null
3.5 OK OK 1 null
3.6 OK OK 1 null
3.7 OK OK 1 null
4.1.1 OK OK 1 null
4.1.2 OK OK 1 null
4.1.3 OK OK 2 null
4.1.4 OK OK 2 null
4.1.5 OK OK 4 null
4.2.1 OK OK 1 null
4.2.2 OK OK 1 null
4.2.3 OK OK 2 null
4.2.4 OK OK 1 null
4.2.5 OK OK 3 null
5.1 OK OK 1 null
5.2 OK OK 1 null
5.3 OK OK 1 1000
5.4 OK OK 2 1000
5.5 OK OK 4 1000
5.6 OK OK 3 1000
5.7 OK OK 2 1000
5.8 OK OK 6 1000
5.9 OK OK 1 null
5.10 OK OK 2 null
5.11 OK OK 1 null
5.12 OK OK 1 null
5.13 OK OK 2 null
5.14 OK OK 1 null
5.15 OK OK 1 null
5.16 OK OK 1 null
5.17 OK OK 1 null
5.18 OK OK 1 null
5.19 OK OK 1002 1000
5.20 OK OK 1003 1000
6.1.1 OK OK 4 1000
6.1.2 OK OK 1 1000
6.1.3 OK OK 2 1000
6.2.1 OK OK 2 1000
6.2.2 OK OK 2 1000
6.2.3 OK OK 2 1000
6.2.4 OK OK 2 1000
6.3.1 OK OK 1 null
6.3.2 OK OK 1 null
6.4.1 NON-STRICT OK 2002 null
6.4.2 NON-STRICT OK 2002 null
6.4.3 NON-STRICT OK 2002 null
6.4.4 NON-STRICT OK 2002 null
6.5.1 OK OK 4 1000
6.5.2 OK OK 1 1000
6.5.3 OK OK 2 1000
6.5.4 OK OK 2 1000
6.5.5 OK OK 1 1000
6.6.1 OK OK 4 null
6.6.2 OK OK 2 1000
6.6.3 OK OK 1 null
6.6.4 OK OK 1 null
6.6.5 OK OK 2 1000
6.6.6 OK OK 1 null
6.6.7 OK OK 2 1000
6.6.8 OK OK 1 null
6.6.9 OK OK 2 1000
6.6.10 OK OK 1 null
6.6.11 OK OK 2 1000
6.7.1 OK OK 2 1000
6.7.2 OK OK 2 1000
6.7.3 OK OK 2 1000
6.7.4 OK OK 2 1000
6.8.1 OK OK 1 null
6.8.2 OK OK 1 null
6.9.1 OK OK 2 1000
6.9.2 OK OK 2 1000
6.9.3 OK OK 2 1000
6.9.4 OK OK 2 1000
6.10.1 OK OK 1 null
6.10.2 OK OK 1 null
6.10.3 OK OK 1 null
6.11.1 OK OK 4 1000
6.11.2 OK OK 2 1000
6.11.3 OK OK 1 1000
6.11.4 OK OK 1 1000
6.11.5 OK OK 1 null
6.12.1 OK OK 1 null
6.12.2 OK OK 1 null
6.12.3 OK OK 1 null
6.12.4 OK OK 1 null
6.12.5 OK OK 1 null
6.12.6 OK OK 1 null
6.12.7 OK OK 1 null
6.12.8 OK OK 1 null
6.13.1 OK OK 1 null
6.13.2 OK OK 1 null
6.13.3 OK OK 1 null
6.13.4 OK OK 1 null
6.13.5 OK OK 1 null
6.14.1 OK OK 1 null
6.14.2 OK OK 1 null
6.14.3 OK OK 1 null
6.14.4 OK OK 1 null
6.14.5 OK OK 1 null
6.14.6 OK OK 1 null
6.14.7 OK OK 1 null
6.14.8 OK OK 1 null
6.14.9 OK OK 1 null
6.14.10 OK OK 1 null
6.15.1 OK OK 1 null
6.16.1 OK OK 1 null
6.16.2 OK OK 1 null
6.16.3 OK OK 1 null
6.17.1 OK OK 1 null
6.17.2 OK OK 1 null
6.17.3 OK OK 1 null
6.17.4 OK OK 1 null
6.17.5 OK OK 1 null
6.18.1 OK OK 10 null
6.18.2 OK OK 1 null
6.18.3 OK OK 1 null
6.18.4 OK OK 1 null
6.18.5 OK OK 1 null
6.19.1 OK OK 1 null
6.19.2 OK OK 1 null
6.19.3 OK OK 1 null
6.19.4 OK OK 1 null
6.19.5 OK OK 1 null
6.20.1 OK OK 1 null
6.20.2 OK OK 1 null
6.20.3 OK OK 2 null
6.20.4 OK OK 1 null
6.20.5 OK OK 1 null
6.20.6 OK OK 1 null
6.20.7 OK OK 1 null
6.21.1 OK OK 1 null
6.21.2 OK OK 1 null
6.21.3 OK OK 1 null
6.21.4 OK OK 1 null
6.21.5 OK OK 1 null
6.21.6 OK OK 1 null
6.21.7 OK OK 1 null
6.21.8 OK OK 1 null
6.22.1 OK OK 2 1000
6.22.2 OK OK 1 1000
6.22.3 OK OK 2 1000
6.22.4 OK OK 2 1000
6.22.5 OK OK 1 1000
6.22.6 OK OK 1 1000
6.22.7 OK OK 1 1000
6.22.8 OK OK 1 1000
6.22.9 OK OK 2 1000
6.22.10 OK OK 2 1000
6.22.11 OK OK 1 1000
6.22.12 OK OK 5 1000
6.22.13 OK OK 2 1000
6.22.14 OK OK 1 1000
6.22.15 OK OK 1 1000
6.22.16 OK OK 2 1000
6.22.17 OK OK 1 1000
6.22.18 OK OK 1 1000
6.22.19 OK OK 1 1000
6.22.20 OK OK 1 1000
6.22.21 OK OK 1 1000
6.22.22 OK OK 1 1000
6.22.23 OK OK 2 1000
6.22.24 OK OK 2 1000
6.22.25 OK OK 1 1000
6.22.26 OK OK 2 1000
6.22.27 OK OK 1 1000
6.22.28 OK OK 1 1000
6.22.29 OK OK 2 1000
6.22.30 OK OK 1 1000
6.22.31 OK OK 2 1000
6.22.32 OK OK 2 1000
6.22.33 OK OK 2 1000
6.22.34 OK OK 2 1000
6.23.1 OK OK 4 1000
6.23.2 OK OK 1 1000
6.23.3 OK OK 1 1000
6.23.4 OK OK 8 1000
6.23.5 OK OK 1 1000
6.23.6 OK OK 5 1000
6.23.7 OK OK 1 1000
7.1.1 OK OK 4 1000
7.1.2 OK OK 1 1000
7.1.3 OK OK 4 1000
7.1.4 OK OK 1 1000
7.1.5 OK OK 1 1000
7.1.6 INFORMATIONAL INFORMATIONAL 26 1000
7.3.1 OK OK 1 null
7.3.2 OK OK 1 null
7.3.3 OK OK 1 1000
7.3.4 OK OK 1 1000
7.3.5 OK OK 1 1000
7.3.6 OK OK 1 null
7.5.1 OK OK 1 1007
7.7.1 OK OK 1 1000
7.7.2 OK OK 1 1001
7.7.3 OK OK 1 1002
7.7.4 OK OK 1 1003
7.7.5 OK OK 1 1007
7.7.6 OK OK 1 1008
7.7.7 OK OK 1 1009
7.7.8 OK OK 1 1010
7.7.9 OK OK 1 1011
7.7.10 OK OK 1 3000
7.7.11 OK OK 1 3999
7.7.12 OK OK 1 4000
7.7.13 OK OK 1 4999
7.9.1 OK OK 1 1002
7.9.2 OK OK 1 1002
7.9.3 OK OK 1 1002
7.9.4 OK OK 1 1002
7.9.5 OK OK 1 1002
7.9.6 OK OK 1 1002
7.9.7 OK OK 1 1002
7.9.8 OK OK 1 1002
7.9.9 OK OK 1 1002
7.13.1 INFORMATIONAL INFORMATIONAL 1 1002
7.13.2 INFORMATIONAL INFORMATIONAL 1 1002
9.1.1 OK OK 3 1000
9.1.2 OK OK 5 1000
9.1.3 OK OK 19 1000
9.1.4 OK OK 142 1000
9.1.5 OK OK 133 1000
9.1.6 OK OK 223 1000
9.2.1 OK OK 3 1000
9.2.2 OK OK 4 1000
9.2.3 OK OK 11 1000
9.2.4 OK OK 42 1000
9.2.5 OK OK 107 1000
9.2.6 OK OK 217 1000
9.3.1 OK OK 173 1000
9.3.2 OK OK 79 1000
9.3.3 OK OK 59 1000
9.3.4 OK OK 47 1000
9.3.5 OK OK 43 1000
9.3.6 OK OK 59 1000
9.3.7 OK OK 43 1000
9.3.8 OK OK 40 1000
9.3.9 OK OK 41 1000
9.4.1 OK OK 115 1000
9.4.2 OK OK 56 1000
9.4.3 OK OK 32 1000
9.4.4 OK OK 31 1000
9.4.5 OK OK 46 1000
9.4.6 OK OK 36 1000
9.4.7 OK OK 27 1000
9.4.8 OK OK 27 1000
9.4.9 OK OK 27 1000
9.5.1 OK OK 408 1000
9.5.2 OK OK 141 1000
9.5.3 OK OK 76 1000
9.5.4 OK OK 50 1000
9.5.5 OK OK 34 1000
9.5.6 OK OK 33 1000
9.6.1 OK OK 254 1000
9.6.2 OK OK 133 1000
9.6.3 OK OK 90 1000
9.6.4 OK OK 52 1000
9.6.5 OK OK 32 1000
9.6.6 OK OK 26 1000
9.7.1 OK OK 271 1000
9.7.2 OK OK 180 1000
9.7.3 OK OK 117 1000
9.7.4 OK OK 171 1000
9.7.5 OK OK 119 1000
9.7.6 OK OK 205 1000
9.8.1 OK OK 165 1000
9.8.2 OK OK 169 1000
9.8.3 OK OK 136 1000
9.8.4 OK OK 165 1000
9.8.5 OK OK 148 1000
9.8.6 OK OK 208 1000
10.1.1 OK OK 4 1000
12.1.1 OK OK 432 1000
12.1.2 OK OK 424 1000
12.1.3 OK OK 313 1000
12.1.4 OK OK 323 1000
12.1.5 OK OK 429 1000
12.1.6 OK OK 492 1000
12.1.7 OK OK 699 1000
12.1.8 OK OK 1142 1000
12.1.9 OK OK 1904 1000
12.1.10 OK OK 3474 1000
12.1.11 OK OK 616 1000
12.1.12 OK OK 907 1000
12.1.13 OK OK 1368 1000
12.1.14 OK OK 2524 1000
12.1.15 OK OK 4483 1000
12.1.16 OK OK 3712 1000
12.1.17 OK OK 3495 1000
12.1.18 OK OK 3455 1000
12.2.1 OK OK 337 1000
12.2.2 OK OK 262 1000
12.2.3 OK OK 295 1000
12.2.4 OK OK 345 1000
12.2.5 OK OK 563 1000
12.2.6 OK OK 785 1000
12.2.7 OK OK 1268 1000
12.2.8 OK OK 2244 1000
12.2.9 OK OK 4217 1000
12.2.10 OK OK 7984 1000
12.2.11 OK OK 2259 1000
12.2.12 OK OK 4085 1000
12.2.13 OK OK 7568 1000
12.2.14 OK OK 15623 1000
12.2.15 OK OK 31502 1000
12.2.16 OK OK 13958 1000
12.2.17 OK OK 9709 1000
12.2.18 OK OK 8387 1000
12.3.1 OK OK 244 1000
12.3.2 OK OK 270 1000
12.3.3 OK OK 290 1000
12.3.4 OK OK 387 1000
12.3.5 OK OK 630 1000
12.3.6 OK OK 988 1000
12.3.7 OK OK 1695 1000
12.3.8 OK OK 3052 1000
12.3.9 OK OK 5871 1000
12.3.10 OK OK 11300 1000
12.3.11 OK OK 1692 1000
12.3.12 OK OK 2950 1000
12.3.13 OK OK 5546 1000
12.3.14 OK OK 10906 1000
12.3.15 OK OK 21682 1000
12.3.16 OK OK 13864 1000
12.3.17 OK OK 12060 1000
12.3.18 OK OK 11422 1000
12.4.1 OK OK 432 1000
12.4.2 OK OK 439 1000
12.4.3 OK OK 465 1000
12.4.4 OK OK 521 1000
12.4.5 OK OK 585 1000
12.4.6 OK OK 712 1000
12.4.7 OK OK 937 1000
12.4.8 OK OK 1385 1000
12.4.9 OK OK 2313 1000
12.4.10 OK OK 4238 1000
12.4.11 OK OK 816 1000
12.4.12 OK OK 1124 1000
12.4.13 OK OK 1762 1000
12.4.14 OK OK 3013 1000
12.4.15 OK OK 5675 1000
12.4.16 OK OK 4617 1000
12.4.17 OK OK 4382 1000
12.4.18 OK OK 4331 1000
12.5.1 OK OK 250 1000
12.5.2 OK OK 251 1000
12.5.3 OK OK 286 1000
12.5.4 OK OK 343 1000
12.5.5 OK OK 499 1000
12.5.6 OK OK 708 1000
12.5.7 OK OK 1093 1000
12.5.8 OK OK 1806 1000
12.5.9 OK OK 3446 1000
12.5.10 OK OK 6330 1000
12.5.11 OK OK 2014 1000
12.5.12 OK OK 3555 1000
12.5.13 OK OK 6462 1000
12.5.14 OK OK 13764 1000
12.5.15 OK OK 27008 1000
12.5.16 OK OK 11497 1000
12.5.17 OK OK 7872 1000
12.5.18 OK OK 6779 1000
13.1.1 OK OK 312 1000
13.1.2 OK OK 302 1000
13.1.3 OK OK 318 1000
13.1.4 OK OK 335 1000
13.1.5 OK OK 455 1000
13.1.6 OK OK 597 1000
13.1.7 OK OK 741 1000
13.1.8 OK OK 1195 1000
13.1.9 OK OK 2045 1000
13.1.10 OK OK 3697 1000
13.1.11 OK OK 610 1000
13.1.12 OK OK 965 1000
13.1.13 OK OK 1446 1000
13.1.14 OK OK 2667 1000
13.1.15 OK OK 4894 1000
13.1.16 OK OK 3975 1000
13.1.17 OK OK 3749 1000
13.1.18 OK OK 3659 1000
13.2.1 OK OK 311 1000
13.2.2 OK OK 301 1000
13.2.3 OK OK 310 1000
13.2.4 OK OK 339 1000
13.2.5 OK OK 439 1000
13.2.6 OK OK 538 1000
13.2.7 OK OK 767 1000
13.2.8 OK OK 1160 1000
13.2.9 OK OK 1938 1000
13.2.10 OK OK 3589 1000
13.2.11 OK OK 632 1000
13.2.12 OK OK 860 1000
13.2.13 OK OK 1458 1000
13.2.14 OK OK 2586 1000
13.2.15 OK OK 4684 1000
13.2.16 OK OK 3855 1000
13.2.17 OK OK 3629 1000
13.2.18 OK OK 3663 1000
13.3.1 FAILED FAILED 40 1007
13.3.2 FAILED FAILED 11 1007
13.3.3 FAILED FAILED 4 1007
13.3.4 FAILED FAILED 2 1007
13.3.5 FAILED FAILED 2 1007
13.3.6 FAILED FAILED 2 1007
13.3.7 FAILED FAILED 2 1007
13.3.8 FAILED FAILED 1 1007
13.3.9 FAILED FAILED 2 1007
13.3.10 FAILED FAILED 2 1007
13.3.11 FAILED FAILED 1 1007
13.3.12 FAILED FAILED 2 1007
13.3.13 FAILED FAILED 2 1007
13.3.14 FAILED FAILED 2 1007
13.3.15 FAILED FAILED 2 1007
13.3.16 FAILED FAILED 3 1007
13.3.17 FAILED FAILED 3 1007
13.3.18 FAILED FAILED 2 1007
13.4.1 OK OK 330 1000
13.4.2 OK OK 320 1000
13.4.3 OK OK 336 1000
13.4.4 OK OK 350 1000
13.4.5 OK OK 456 1000
13.4.6 OK OK 549 1000
13.4.7 OK OK 733 1000
13.4.8 OK OK 1193 1000
13.4.9 OK OK 2012 1000
13.4.10 OK OK 3624 1000
13.4.11 OK OK 610 1000
13.4.12 OK OK 872 1000
13.4.13 OK OK 1474 1000
13.4.14 OK OK 2507 1000
13.4.15 OK OK 4648 1000
13.4.16 OK OK 3850 1000
13.4.17 OK OK 3625 1000
13.4.18 OK OK 3574 1000
13.5.1 FAILED FAILED 47 1007
13.5.2 FAILED FAILED 16 1007
13.5.3 FAILED FAILED 3 1007
13.5.4 FAILED FAILED 2 1007
13.5.5 FAILED FAILED 2 1007
13.5.6 FAILED FAILED 2 1007
13.5.7 FAILED FAILED 2 1007
13.5.8 FAILED FAILED 1 1007
13.5.9 FAILED FAILED 1 1007
13.5.10 FAILED FAILED 2 1007
13.5.11 FAILED FAILED 1 1007
13.5.12 FAILED FAILED 1 1007
13.5.13 FAILED FAILED 1 1007
13.5.14 FAILED FAILED 1 1007
13.5.15 FAILED FAILED 2 1007
13.5.16 FAILED FAILED 3 1007
13.5.17 FAILED FAILED 2 1007
13.5.18 FAILED FAILED 2 1007
13.6.1 OK OK 321 1000
13.6.2 OK OK 313 1000
13.6.3 OK OK 334 1000
13.6.4 OK OK 344 1000
13.6.5 OK OK 455 1000
13.6.6 OK OK 549 1000
13.6.7 OK OK 735 1000
13.6.8 OK OK 1174 1000
13.6.9 OK OK 1969 1000
13.6.10 OK OK 3563 1000
13.6.11 OK OK 601 1000
13.6.12 OK OK 896 1000
13.6.13 OK OK 1475 1000
13.6.14 OK OK 2540 1000
13.6.15 OK OK 4698 1000
13.6.16 OK OK 3904 1000
13.6.17 OK OK 3631 1000
13.6.18 OK OK 3569 1000
13.7.1 FAILED FAILED 37 1007
13.7.2 FAILED FAILED 10 1007
13.7.3 FAILED FAILED 3 1007
13.7.4 FAILED FAILED 2 1007
13.7.5 FAILED FAILED 2 1007
13.7.6 FAILED FAILED 2 1007
13.7.7 FAILED FAILED 2 1007
13.7.8 FAILED FAILED 1 1007
13.7.9 FAILED FAILED 1 1007
13.7.10 FAILED FAILED 2 1007
13.7.11 FAILED FAILED 1 1007
13.7.12 FAILED FAILED 1 1007
13.7.13 FAILED FAILED 2 1007
13.7.14 FAILED FAILED 2 1007
13.7.15 FAILED FAILED 2 1007
13.7.16 FAILED FAILED 2 1007
13.7.17 FAILED FAILED 2 1007
13.7.18 FAILED FAILED 2 1007

@KhafraDev
Copy link
Member Author

@Uzlopak I think we should revert 903c667 so we can incrementally implement this. Wdyt?

@KhafraDev KhafraDev force-pushed the permessage-deflate branch from a978d0f to b50e9d9 Compare May 16, 2024 20:25
@KhafraDev KhafraDev marked this pull request as ready for review May 16, 2024 20:31
Copy link
Member

@tsctx tsctx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

if (secExtension !== null) {
extensions = parseExtensions(secExtension)

if (!extensions.has(permessageDeflate)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably wrong

@@ -122,7 +140,7 @@ class ByteParser extends Writable {
return
}

if (isContinuationFrame(opcode) && this.#fragments.length === 0) {
if (isContinuationFrame(opcode) && this.#fragments.length === 0 && !this.#info.compressed) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably wrong (?)

lib/web/websocket/websocket.js Outdated Show resolved Hide resolved
lib/web/websocket/util.js Show resolved Hide resolved
lib/web/websocket/permessage-deflate.js Outdated Show resolved Hide resolved
@Uzlopak Uzlopak dismissed their stale review May 18, 2024 01:02

Not blocking

@Uzlopak
Copy link
Contributor

Uzlopak commented May 18, 2024

Please give feedback if you want to have a review

@KhafraDev
Copy link
Member Author

these 13.x tests are killing me

@KhafraDev
Copy link
Member Author

@Uzlopak we can land this.

The failing tests (to the best of my knowledge) are because we don't compress the messages we send, only decompress. We can add that in at a later date. Will require a queuing system that's not too important for this PR.

@KhafraDev KhafraDev changed the title permessage-deflate support in websocket permessage-deflate decompression support in websocket May 18, 2024
@Uzlopak
Copy link
Contributor

Uzlopak commented May 18, 2024

According to the comment 5.18 failed? Is this a regression or a flaky test?

@KhafraDev
Copy link
Member Author

the comment is always 1 commit behind, it's passing

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

Successfully merging this pull request may close these issues.

3 participants