@@ -4,7 +4,7 @@ import { VSBuffer } from 'vs/base/common/buffer';
4
4
import { Emitter } from 'vs/base/common/event' ;
5
5
import { FileAccess } from 'vs/base/common/network' ;
6
6
import { ISocket } from 'vs/base/parts/ipc/common/ipc.net' ;
7
- import { NodeSocket } from 'vs/base/parts/ipc/node/ipc.net' ;
7
+ import { WebSocketNodeSocket } from 'vs/base/parts/ipc/node/ipc.net' ;
8
8
import { INativeEnvironmentService } from 'vs/platform/environment/common/environment' ;
9
9
import { getNlsConfiguration } from 'vs/server/node/nls' ;
10
10
import { Protocol } from 'vs/server/node/protocol' ;
@@ -88,7 +88,7 @@ export class ExtensionHostConnection extends Connection {
88
88
private readonly logger : Logger ;
89
89
90
90
public constructor (
91
- locale :string , protocol : Protocol , buffer : VSBuffer , token : string ,
91
+ locale : string , protocol : Protocol , buffer : VSBuffer , token : string ,
92
92
private readonly environment : INativeEnvironmentService ,
93
93
) {
94
94
super ( protocol , token ) ;
@@ -115,11 +115,18 @@ export class ExtensionHostConnection extends Connection {
115
115
private sendInitMessage ( buffer : VSBuffer ) : void {
116
116
const socket = this . protocol . getUnderlyingSocket ( ) ;
117
117
socket . pause ( ) ;
118
+
119
+ const wrapperSocket = this . protocol . getSocket ( ) ;
120
+
118
121
this . logger . trace ( 'Sending socket' ) ;
119
122
this . process ! . send ( { // Process must be set at this point.
120
123
type : 'VSCODE_EXTHOST_IPC_SOCKET' ,
121
- initialDataChunk : ( buffer . buffer as Buffer ) . toString ( 'base64' ) ,
122
- skipWebSocketFrames : this . protocol . getSocket ( ) instanceof NodeSocket ,
124
+ initialDataChunk : Buffer . from ( buffer . buffer ) . toString ( 'base64' ) ,
125
+ skipWebSocketFrames : ! ( wrapperSocket instanceof WebSocketNodeSocket ) ,
126
+ permessageDeflate : this . protocol . options . permessageDeflate ,
127
+ inflateBytes : wrapperSocket instanceof WebSocketNodeSocket
128
+ ? Buffer . from ( wrapperSocket . recordedInflateBytes . buffer ) . toString ( 'base64' )
129
+ : undefined ,
123
130
} , socket ) ;
124
131
}
125
132
0 commit comments