-
Notifications
You must be signed in to change notification settings - Fork 5.3k
WebSocket Compression #49304
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
Merged
Merged
WebSocket Compression #49304
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
705c171
Prototyped how deflate/inflate should be plugged in.
zlatanov 740798c
Replaced WebSocketReceiveResultGetter abstraction for the receive wit…
zlatanov 72a34fd
Moved ZLibNative and ZLibNative.ZStream to Common so they can be used…
zlatanov 5128c9f
Added compression related implementation.
zlatanov 2825973
Added api changes and implementation to ClientWebSocket to light up d…
zlatanov 67a5d72
Added tests and fixed a few deflate bugs.
zlatanov 9cb024e
Forgot to dispose inflater & deflater.
zlatanov 92cf8f4
Addressing pr feedback.
zlatanov 4045305
Moved deflate state into deflater.
zlatanov 862e163
Moved inflater buffer into the inflater.
zlatanov 92520b6
Using Math.Clamp instead of Math.Min/Max.
zlatanov 4d024fa
Releasing deflater buffer as soon as we're done using it.
zlatanov b8bdfae
Using 2 constructors in ManagedWebSocket to avoid allocations for Web…
zlatanov 7e8d3c4
Added missing assert.
zlatanov 3869367
Removed unnecessary comments that visual studio inserted from resx fi…
zlatanov b7f58b1
Better buffer handling in inflater.
zlatanov c6c3326
Renaming clientBufferLength to userBufferLength.
zlatanov 7ec3151
Fixed an issue in inflater / deflater where with context takeover, th…
zlatanov 271c9cd
Revert removal of BOM.
zlatanov 61c7e5b
PR feedback for ClientWebSocket.
zlatanov 4fa65f4
PR feedback for WebSocket.
zlatanov 9031be3
Prefer Length over IsEmpty for spans.
zlatanov 4e70073
Fixed wrong check.
zlatanov b7743ef
New API that allows disabling compression per message basis and renam…
zlatanov 49d00eb
Added comment explaining why GetReceiveResult<TResult> will not resul…
zlatanov 58a3338
Exposed DeflateReset and InflateReset methods from zlib.
zlatanov 56fd0ef
Pooling zlib streams.
zlatanov fdf41d6
Moved min/max deflate window bits consants to WebSocketValidate so th…
zlatanov 4fd18f6
Testing negotiation of deflate options with reflection.
zlatanov 29c539a
Removed the default value for messageFlags parameter.
zlatanov 0739640
pr feedback
zlatanov 224f7ab
Removed cache capacity limit for deflate streams. Now the cache is on…
zlatanov 4a7feb4
Created a test with active issue to track a failing case for the defl…
zlatanov 222c782
Disabled client websocket deflate tests for browser platform.
zlatanov 0b09b5b
Created tests for ZLibStream pooling.
zlatanov 99869bf
Reusing constants in deflate options.
zlatanov c46a0f3
Fixing tests for browser environment.
zlatanov 3ec748d
Added Block flush code for zlib, because it's needed for websockets.
zlatanov fb45f2c
Bug fixes after running Autobahn WebSocket Testsuite.
zlatanov 00283e8
Addressing PR feedback.
zlatanov 5a0e435
Fixed a test.
zlatanov 935969a
Addressing flakiness of a couple of tests.
zlatanov 437b7e7
Disallowing the usage of different compression options for continuati…
zlatanov 5edadd9
Removed [ActiveIssue] from websocket deflate tests. Created a new tes…
zlatanov f6a4b32
Addressing PR feedback.
zlatanov f0f09f3
Removed custom deflate pool.
zlatanov ea049ea
Added missing dispose when creating deflater.
zlatanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...System.Net.WebSockets.Client/src/System/Net/WebSockets/ClientWebSocketDeflateConstants.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| namespace System.Net.WebSockets | ||
| { | ||
| internal static class ClientWebSocketDeflateConstants | ||
| { | ||
| /// <summary> | ||
| /// The maximum length that this extension can have, assuming that we're not abusing white space. | ||
| /// <para /> | ||
| /// "permessage-deflate; client_max_window_bits=15; client_no_context_takeover; server_max_window_bits=15; server_no_context_takeover" | ||
| /// </summary> | ||
| public const int MaxExtensionLength = 128; | ||
|
|
||
| public const string Extension = "permessage-deflate"; | ||
|
|
||
| public const string ClientMaxWindowBits = "client_max_window_bits"; | ||
| public const string ClientNoContextTakeover = "client_no_context_takeover"; | ||
|
|
||
| public const string ServerMaxWindowBits = "server_max_window_bits"; | ||
| public const string ServerNoContextTakeover = "server_no_context_takeover"; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.