Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vscode-jsonrpc

Package Overview
Dependencies
Maintainers
7
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-jsonrpc - npm Package Compare versions

Comparing version 8.2.1-next.1 to 8.2.1

8

lib/common/connection.js

@@ -1082,9 +1082,11 @@ "use strict";

try {
responsePromises.set(id, responsePromise);
await messageWriter.write(requestMessage);
responsePromises.set(id, responsePromise);
}
catch (error) {
// Writing the message failed. So we need to delete it from the response promises and
// reject it.
responsePromises.delete(id);
responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error.message ? error.message : 'Unknown reason'));
logger.error(`Sending request failed.`);
// Writing the message failed. So we need to reject the promise.
responsePromise.reject(new messages_1.ResponseError(messages_1.ErrorCodes.MessageWriteError, error.message ? error.message : 'Unknown reason'));
throw error;

@@ -1091,0 +1093,0 @@ }

@@ -27,3 +27,2 @@ "use strict";

const os = require("os");
const fs = require("fs");
const crypto_1 = require("crypto");

@@ -160,17 +159,18 @@ const net_1 = require("net");

function generateRandomPipeName() {
const randomSuffix = (0, crypto_1.randomBytes)(21).toString('hex');
if (process.platform === 'win32') {
return `\\\\.\\pipe\\lsp-${(0, crypto_1.randomBytes)(16).toString('hex')}-sock`;
return `\\\\.\\pipe\\vscode-jsonrpc-${randomSuffix}-sock`;
}
let randomLength = 32;
const fixedLength = 'lsp-.sock'.length;
const tmpDir = fs.realpathSync(XDG_RUNTIME_DIR ?? os.tmpdir());
let result;
if (XDG_RUNTIME_DIR) {
result = path.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
}
else {
result = path.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
}
const limit = safeIpcPathLengths.get(process.platform);
if (limit !== undefined) {
randomLength = Math.min(limit - tmpDir.length - fixedLength, randomLength);
if (limit !== undefined && result.length > limit) {
(0, ril_1.default)().console.warn(`WARNING: IPC handle "${result}" is longer than ${limit} characters.`);
}
if (randomLength < 16) {
throw new Error(`Unable to generate a random pipe name with ${randomLength} characters.`);
}
const randomSuffix = (0, crypto_1.randomBytes)(Math.floor(randomLength / 2)).toString('hex');
return path.join(tmpDir, `lsp-${randomSuffix}.sock`);
return result;
}

@@ -177,0 +177,0 @@ exports.generateRandomPipeName = generateRandomPipeName;

{
"name": "vscode-jsonrpc",
"description": "A json rpc implementation over streams",
"version": "8.2.1-next.1",
"version": "8.2.1",
"author": "Microsoft Corporation",

@@ -24,3 +24,3 @@ "license": "MIT",

"devDependencies": {
"@types/msgpack-lite": "^0.1.10",
"@types/msgpack-lite": "^0.1.7",
"msgpack-lite": "^0.1.26"

@@ -27,0 +27,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc