Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/agentHost/common/transportConstants.ts
13394 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
/**
7
* Shared constants for agent-host protocol transports. Kept in a common
8
* module so browser, electron-browser, and sessions-layer transports all
9
* apply the same malformed-frame policy without duplicating values.
10
*/
11
12
/**
13
* Force-close the transport once more than this many malformed inbound
14
* frames have been observed. A handful of bad frames can be tolerated
15
* (e.g. a proxy momentarily corrupts a message), but a sustained stream
16
* almost always indicates a protocol mismatch or a broken relay, and is
17
* best surfaced as a hard disconnect so the reconnect loop can take over.
18
*/
19
export const MALFORMED_FRAMES_FORCE_CLOSE_THRESHOLD = 10;
20
21
/** Cap warn-level logs per connection for malformed frames to avoid spam. */
22
export const MALFORMED_FRAMES_LOG_CAP = 5;
23
24