Skip to content

Commit

Permalink
Merge pull request socketio#291 from lpinca/close/pending-request
Browse files Browse the repository at this point in the history
polling: close the pending poll request when closing transport
  • Loading branch information
rauchg committed Nov 15, 2014
2 parents b310fcb + 1d8e074 commit 80aa1aa
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/transports/polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,20 @@ Polling.prototype.onData = function (data) {
parser.decodePayload(data, callback);
};

/**
* Overrides onClose.
*
* @api private
*/

Polling.prototype.onClose = function () {
if (this.writable) {
// close pending poll request
this.send([{ type: 'noop' }]);
}
Transport.prototype.onClose.call(this);
};

/**
* Writes a packet payload.
*
Expand Down

0 comments on commit 80aa1aa

Please sign in to comment.