Skip to content

Commit

Permalink
[fix] Undeterministic error in polling buffer processing
Browse files Browse the repository at this point in the history
  • Loading branch information
raulmt committed Sep 1, 2017
1 parent e76e035 commit dcd7b54
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/transports/polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,10 @@ Polling.prototype.onDataRequest = function (req, res) {
var self = this;

function cleanup () {
chunks = isBinary ? new Buffer(0) : '';
req.removeListener('data', onData);
req.removeListener('end', onEnd);
req.removeListener('close', onClose);
self.dataReq = self.dataRes = null;
self.dataReq = self.dataRes = chunks = null;
}

function onClose () {
Expand All @@ -163,7 +162,7 @@ Polling.prototype.onDataRequest = function (req, res) {
}

if (contentLength > self.maxHttpBufferSize) {
chunks = '';
chunks = isBinary ? new Buffer(0) : '';
req.connection.destroy();
}
}
Expand Down

0 comments on commit dcd7b54

Please sign in to comment.