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

cli: enable server message compression #166139

Merged
merged 2 commits into from
Nov 12, 2022

Conversation

connor4312
Copy link
Member

This is the CLI side of enabling compression of servermsg's sent over the socket. It is feature-detected by the CLI sending protocolVersion=2. If present, the consumer can request compression by passing compress:true when setting up the server.

In this mode, servermsg's are an inflate/deflate stream. Not a ton of code here, but was lots of fun tweaking to get it right :)

Fixes #163688

This is the CLI side of enabling compression of servermsg's sent
over the socket. It is feature-detected by the CLI sending
protocolVersion=2. If present, the consumer can request compression by
passing `compress:true` when setting up the server.

In this mode, servermsg's are an inflate/deflate stream. Not a ton of
code here, but was lots of fun tweaking to get it right :)

Fixes #163688
}

impl FromServerMessage for SocketSignal {
fn from_server_message(i: u16, body: &[u8]) -> Self {
Copy link
Member Author

Choose a reason for hiding this comment

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

Some refactoring here was necessary: previously the server bridges sent server messages blindly to a channel passing it through this encoder, but with compression there now needs to be a stateful encoder.

@connor4312 connor4312 merged commit aa60836 into main Nov 12, 2022
@connor4312 connor4312 deleted the connor4312/cli-server-message-compression branch November 12, 2022 22:40
lemanschik pushed a commit to code-oss-dev/code that referenced this pull request Nov 25, 2022
…ver-message-compression

cli: enable server message compression
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compress data sent between CLI and extension host
3 participants