engine.io
Advanced tools
Comparing version 6.5.3 to 6.5.4
@@ -286,8 +286,2 @@ "use strict"; | ||
} | ||
if (req._query && req._query.b64) { | ||
transport.supportsBinary = false; | ||
} | ||
else { | ||
transport.supportsBinary = true; | ||
} | ||
} | ||
@@ -621,8 +615,2 @@ catch (e) { | ||
const transport = this.createTransport(req._query.transport, req); | ||
if (req._query && req._query.b64) { | ||
transport.supportsBinary = false; | ||
} | ||
else { | ||
transport.supportsBinary = true; | ||
} | ||
transport.perMessageDeflate = this.opts.perMessageDeflate; | ||
@@ -629,0 +617,0 @@ client.maybeUpgrade(transport); |
@@ -9,2 +9,3 @@ /// <reference types="node" /> | ||
} | ||
declare type ReadyState = "opening" | "open" | "closing" | "closed"; | ||
export declare class Socket extends EventEmitter { | ||
@@ -14,3 +15,3 @@ readonly protocol: number; | ||
readonly remoteAddress: string; | ||
_readyState: string; | ||
_readyState: ReadyState; | ||
transport: Transport; | ||
@@ -24,4 +25,2 @@ private server; | ||
private cleanupFn; | ||
private checkIntervalTimer; | ||
private upgradeTimeoutTimer; | ||
private pingTimeoutTimer; | ||
@@ -36,4 +35,4 @@ private pingIntervalTimer; | ||
private readonly id; | ||
get readyState(): string; | ||
set readyState(state: string); | ||
get readyState(): ReadyState; | ||
set readyState(state: ReadyState); | ||
/** | ||
@@ -61,3 +60,3 @@ * Client class (abstract). | ||
* | ||
* @param {Error} error object | ||
* @param {Error} err - error object | ||
* @api private | ||
@@ -168,1 +167,2 @@ */ | ||
} | ||
export {}; |
@@ -16,7 +16,5 @@ "use strict"; | ||
super(); | ||
this.id = id; | ||
this.server = server; | ||
this._readyState = "opening"; | ||
this.upgrading = false; | ||
this.upgraded = false; | ||
this.readyState = "opening"; | ||
this.writeBuffer = []; | ||
@@ -26,2 +24,4 @@ this.packetsFn = []; | ||
this.cleanupFn = []; | ||
this.id = id; | ||
this.server = server; | ||
this.request = req; | ||
@@ -42,4 +42,2 @@ this.protocol = protocol; | ||
} | ||
this.checkIntervalTimer = null; | ||
this.upgradeTimeoutTimer = null; | ||
this.pingTimeoutTimer = null; | ||
@@ -133,3 +131,3 @@ this.pingIntervalTimer = null; | ||
* | ||
* @param {Error} error object | ||
* @param {Error} err - error object | ||
* @api private | ||
@@ -202,3 +200,3 @@ */ | ||
// set transport upgrade timer | ||
this.upgradeTimeoutTimer = (0, timers_1.setTimeout)(() => { | ||
const upgradeTimeoutTimer = (0, timers_1.setTimeout)(() => { | ||
debug("client did not complete upgrade - closing transport"); | ||
@@ -210,2 +208,3 @@ cleanup(); | ||
}, this.server.opts.upgradeTimeout); | ||
let checkIntervalTimer; | ||
const onPacket = (packet) => { | ||
@@ -216,4 +215,4 @@ if ("ping" === packet.type && "probe" === packet.data) { | ||
this.emit("upgrading", transport); | ||
clearInterval(this.checkIntervalTimer); | ||
this.checkIntervalTimer = setInterval(check, 100); | ||
clearInterval(checkIntervalTimer); | ||
checkIntervalTimer = setInterval(check, 100); | ||
} | ||
@@ -249,6 +248,4 @@ else if ("upgrade" === packet.type && this.readyState !== "closed") { | ||
this.upgrading = false; | ||
clearInterval(this.checkIntervalTimer); | ||
this.checkIntervalTimer = null; | ||
(0, timers_1.clearTimeout)(this.upgradeTimeoutTimer); | ||
this.upgradeTimeoutTimer = null; | ||
clearInterval(checkIntervalTimer); | ||
(0, timers_1.clearTimeout)(upgradeTimeoutTimer); | ||
transport.removeListener("packet", onPacket); | ||
@@ -307,5 +304,2 @@ transport.removeListener("close", onTransportClose); | ||
(0, timers_1.clearTimeout)(this.pingTimeoutTimer); | ||
clearInterval(this.checkIntervalTimer); | ||
this.checkIntervalTimer = null; | ||
(0, timers_1.clearTimeout)(this.upgradeTimeoutTimer); | ||
// clean writeBuffer in next tick, so developers can still | ||
@@ -312,0 +306,0 @@ // grab the writeBuffer on 'close' event |
@@ -5,2 +5,3 @@ /// <reference types="node" /> | ||
import { Packet } from "engine.io-parser"; | ||
declare type ReadyState = "open" | "closing" | "closed"; | ||
export declare abstract class Transport extends EventEmitter { | ||
@@ -10,3 +11,3 @@ sid: string; | ||
protocol: number; | ||
protected _readyState: string; | ||
protected _readyState: ReadyState; | ||
protected discarded: boolean; | ||
@@ -18,8 +19,8 @@ protected parser: any; | ||
protected supportsBinary: boolean; | ||
get readyState(): string; | ||
set readyState(state: string); | ||
get readyState(): ReadyState; | ||
set readyState(state: ReadyState); | ||
/** | ||
* Transport constructor. | ||
* | ||
* @param {http.IncomingMessage} request | ||
* @param {http.IncomingMessage} req | ||
* @api public | ||
@@ -37,3 +38,3 @@ */ | ||
* | ||
* @param {http.IncomingMessage} request | ||
* @param {http.IncomingMessage} req | ||
* @api protected | ||
@@ -51,4 +52,4 @@ */ | ||
* | ||
* @param {String} message error | ||
* @param {Object} error description | ||
* @param {String} msg - message error | ||
* @param {Object} desc - error description | ||
* @api protected | ||
@@ -97,1 +98,2 @@ */ | ||
} | ||
export {}; |
@@ -19,3 +19,3 @@ "use strict"; | ||
* | ||
* @param {http.IncomingMessage} request | ||
* @param {http.IncomingMessage} req | ||
* @api public | ||
@@ -25,6 +25,8 @@ */ | ||
super(); | ||
this.readyState = "open"; | ||
this.writable = false; | ||
this._readyState = "open"; | ||
this.discarded = false; | ||
this.protocol = req._query.EIO === "4" ? 4 : 3; // 3rd revision by default | ||
this.parser = this.protocol === 4 ? parser_v4 : parser_v3; | ||
this.supportsBinary = !(req._query && req._query.b64); | ||
} | ||
@@ -49,3 +51,3 @@ get readyState() { | ||
* | ||
* @param {http.IncomingMessage} request | ||
* @param {http.IncomingMessage} req | ||
* @api protected | ||
@@ -71,4 +73,4 @@ */ | ||
* | ||
* @param {String} message error | ||
* @param {Object} error description | ||
* @param {String} msg - message error | ||
* @param {Object} desc - error description | ||
* @api protected | ||
@@ -75,0 +77,0 @@ */ |
@@ -43,2 +43,4 @@ "use strict"; | ||
const res = req.res; | ||
// remove the reference to the ServerResponse object (as the first request of the session is kept in memory by default) | ||
req.res = null; | ||
if (req.getMethod() === "get") { | ||
@@ -45,0 +47,0 @@ this.onPollRequest(req, res); |
@@ -42,2 +42,4 @@ "use strict"; | ||
const res = req.res; | ||
// remove the reference to the ServerResponse object (as the first request of the session is kept in memory by default) | ||
req.res = null; | ||
if ("GET" === req.method) { | ||
@@ -44,0 +46,0 @@ this.onPollRequest(req, res); |
{ | ||
"name": "engine.io", | ||
"version": "6.5.3", | ||
"version": "6.5.4", | ||
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
162391
4469