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

engine.io

Package Overview
Dependencies
Maintainers
1
Versions
152
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

engine.io - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

History.md
1.0.1 / 2014-03-06
==================
* package: bump `engine.io-parser`
* transports: fix jshint warnings and style
1.0.0 / 2014-03-06

@@ -3,0 +9,0 @@ ==================

124

lib/transports/polling.js

@@ -74,30 +74,31 @@

res.writeHead(500);
} else {
debug('setting request');
return;
}
this.req = req;
this.res = res;
debug('setting request');
var self = this;
this.req = req;
this.res = res;
function onClose () {
self.onError('poll connection closed prematurely');
}
var self = this;
function cleanup () {
req.removeListener('close', onClose);
self.req = self.res = null;
}
function onClose () {
self.onError('poll connection closed prematurely');
}
req.cleanup = cleanup;
req.on('close', onClose);
function cleanup () {
req.removeListener('close', onClose);
self.req = self.res = null;
}
this.writable = true;
this.emit('drain');
req.cleanup = cleanup;
req.on('close', onClose);
// if we're still writable but had a pending close, trigger an empty send
if (this.writable && this.shouldClose) {
debug('triggering empty send to append close packet');
this.send([{ type: 'noop' }]);
}
this.writable = true;
this.emit('drain');
// if we're still writable but had a pending close, trigger an empty send
if (this.writable && this.shouldClose) {
debug('triggering empty send to append close packet');
this.send([{ type: 'noop' }]);
}

@@ -117,50 +118,51 @@ };

res.writeHead(500);
} else {
var isBinary = 'application/octet-stream' == req.headers['content-type'];
return;
}
this.dataReq = req;
this.dataRes = res;
var isBinary = 'application/octet-stream' == req.headers['content-type'];
var chunks = isBinary ? new Buffer(0) : ''
, self = this
this.dataReq = req;
this.dataRes = res;
function cleanup () {
chunks = isBinary ? new Buffer(0) : '';
req.removeListener('data', onData);
req.removeListener('end', onEnd);
req.removeListener('close', onClose);
self.dataReq = self.dataRes = null;
};
var chunks = isBinary ? new Buffer(0) : '';
var self = this;
function onClose () {
cleanup();
self.onError('data request connection closed prematurely');
};
function cleanup () {
chunks = isBinary ? new Buffer(0) : '';
req.removeListener('data', onData);
req.removeListener('end', onEnd);
req.removeListener('close', onClose);
self.dataReq = self.dataRes = null;
}
function onData (data) {
if (typeof data == 'string') {
chunks += data;
} else {
chunks = Buffer.concat([chunks, data]);
}
};
function onClose () {
cleanup();
self.onError('data request connection closed prematurely');
}
function onEnd () {
self.onData(chunks);
res.writeHead(200, self.headers(req, {
'Content-Length': 2
// text/html is required instead of text/plain to avoid an
// unwanted download dialog on certain user-agents (GH-43)
, 'Content-Type': 'text/html'
}));
res.end('ok');
cleanup();
};
function onData (data) {
if (typeof data == 'string') {
chunks += data;
} else {
chunks = Buffer.concat([chunks, data]);
}
}
req.abort = cleanup;
req.on('close', onClose);
req.on('data', onData);
req.on('end', onEnd);
if (!isBinary) { req.setEncoding('utf8'); }
function onEnd () {
self.onData(chunks);
res.writeHead(200, self.headers(req, {
'Content-Length': 2
// text/html is required instead of text/plain to avoid an
// unwanted download dialog on certain user-agents (GH-43)
, 'Content-Type': 'text/html'
}));
res.end('ok');
cleanup();
}
req.abort = cleanup;
req.on('close', onClose);
req.on('data', onData);
req.on('end', onEnd);
if (!isBinary) req.setEncoding('utf8');
};

@@ -167,0 +169,0 @@

{
"name": "engine.io",
"version": "1.0.0",
"version": "1.0.1",
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",

@@ -21,3 +21,3 @@ "main": "./lib/engine.io",

"ws": "0.4.31",
"engine.io-parser": "1.0.0",
"engine.io-parser": "1.0.1",
"base64id": "0.1.0"

@@ -29,3 +29,3 @@ },

"superagent": "0.15.4",
"engine.io-client": "1.0.0",
"engine.io-client": "1.0.1",
"s": "0.1.1"

@@ -32,0 +32,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