chore(vscode): update to 1.54.2

This commit is contained in:
Joe Previte
2021-03-11 10:27:10 -07:00
1459 changed files with 53404 additions and 51004 deletions

View File

@@ -99,10 +99,6 @@ export function isAllInterfaces(host: string): boolean {
return ALL_INTERFACES_ADDRESSES.indexOf(host) >= 0;
}
function getOtherLocalhost(host: string): string | undefined {
return (host === 'localhost') ? '127.0.0.1' : ((host === '127.0.0.1') ? 'localhost' : undefined);
}
export function isPortPrivileged(port: number, os?: OperatingSystem): boolean {
if (os) {
return os !== OperatingSystem.Windows && (port < 1024);
@@ -282,20 +278,25 @@ export abstract class AbstractTunnelService implements ITunnelService {
}
protected getTunnelFromMap(remoteHost: string, remotePort: number): { refcount: number, readonly value: Promise<RemoteTunnel | undefined> } | undefined {
const otherLocalhost = getOtherLocalhost(remoteHost);
let portMap: Map<number, { refcount: number, readonly value: Promise<RemoteTunnel | undefined> }> | undefined;
if (otherLocalhost) {
const firstMap = this._tunnels.get(remoteHost);
const secondMap = this._tunnels.get(otherLocalhost);
if (firstMap && secondMap) {
portMap = new Map([...Array.from(firstMap.entries()), ...Array.from(secondMap.entries())]);
} else {
portMap = firstMap ?? secondMap;
}
} else {
portMap = this._tunnels.get(remoteHost);
let hosts = [remoteHost];
// Order matters. We want the original host to be first.
if (isLocalhost(remoteHost)) {
hosts.push(...LOCALHOST_ADDRESSES);
// For localhost, we add the all interfaces hosts because if the tunnel is already available at all interfaces,
// then of course it is available at localhost.
hosts.push(...ALL_INTERFACES_ADDRESSES);
} else if (isAllInterfaces(remoteHost)) {
hosts.push(...ALL_INTERFACES_ADDRESSES);
}
return portMap ? portMap.get(remotePort) : undefined;
const existingPortMaps = hosts.map(host => this._tunnels.get(host));
for (const map of existingPortMaps) {
const existingTunnel = map?.get(remotePort);
if (existingTunnel) {
return existingTunnel;
}
}
return undefined;
}
canTunnel(uri: URI): boolean {