@@ -4,7 +4,7 @@ import { VSBuffer } from 'vs/base/common/buffer';
44import { Emitter } from 'vs/base/common/event' ;
55import { FileAccess } from 'vs/base/common/network' ;
66import { 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' ;
88import { INativeEnvironmentService } from 'vs/platform/environment/common/environment' ;
99import { getNlsConfiguration } from 'vs/server/node/nls' ;
1010import { Protocol } from 'vs/server/node/protocol' ;
@@ -88,7 +88,7 @@ export class ExtensionHostConnection extends Connection {
8888 private readonly logger : Logger ;
8989
9090 public constructor (
91- locale :string , protocol : Protocol , buffer : VSBuffer , token : string ,
91+ locale : string , protocol : Protocol , buffer : VSBuffer , token : string ,
9292 private readonly environment : INativeEnvironmentService ,
9393 ) {
9494 super ( protocol , token ) ;
@@ -115,11 +115,18 @@ export class ExtensionHostConnection extends Connection {
115115 private sendInitMessage ( buffer : VSBuffer ) : void {
116116 const socket = this . protocol . getUnderlyingSocket ( ) ;
117117 socket . pause ( ) ;
118+
119+ const wrapperSocket = this . protocol . getSocket ( ) ;
120+
118121 this . logger . trace ( 'Sending socket' ) ;
119122 this . process ! . send ( { // Process must be set at this point.
120123 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 ,
123130 } , socket ) ;
124131 }
125132
0 commit comments