Path: blob/main/src/vs/platform/agentHost/common/transportConstants.ts
13394 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45/**6* Shared constants for agent-host protocol transports. Kept in a common7* module so browser, electron-browser, and sessions-layer transports all8* apply the same malformed-frame policy without duplicating values.9*/1011/**12* Force-close the transport once more than this many malformed inbound13* frames have been observed. A handful of bad frames can be tolerated14* (e.g. a proxy momentarily corrupts a message), but a sustained stream15* almost always indicates a protocol mismatch or a broken relay, and is16* best surfaced as a hard disconnect so the reconnect loop can take over.17*/18export const MALFORMED_FRAMES_FORCE_CLOSE_THRESHOLD = 10;1920/** Cap warn-level logs per connection for malformed frames to avoid spam. */21export const MALFORMED_FRAMES_LOG_CAP = 5;222324