Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
node v0.10 does not emit 'aborted' after request.abort()
Browse files Browse the repository at this point in the history
For v0.10 we need to check `req.timedOut` in `gotEnd()`
to know that we aborted, and this is not a complete response.
  • Loading branch information
dannycoates committed Aug 16, 2013
1 parent 673b564 commit 0c7d2e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ module.exports = function (inherits, EventEmitter, Pinger, EndpointError) {

if (req.callback === null) { return }

if (req.timedOut) { return gotAborted.call(this) }

var buffer = new Buffer(this.bodyLength)
var offset = 0
for (var i = 0; i < this.bodyChunks.length; i++) {
Expand Down

0 comments on commit 0c7d2e2

Please sign in to comment.