Permalink
Browse files

Fixes #1399.

  • Loading branch information...
1 parent 141a281 commit 7b80c332379215099179be028955362be03872fc @SaltwaterC SaltwaterC committed Jul 26, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/http.js
View
@@ -701,10 +701,13 @@ OutgoingMessage.prototype.end = function(data, encoding) {
this.finished = true;
// There is the first message on the outgoing queue, and we've sent
- // everything to the socket.
- if (this.output.length === 0 && this.connection._httpMessage === this) {
- debug('outgoing message end.');
- this._finish();
+ // everything to the socket. The connection may be destroyed by an abort()
+ // call though.
+ if (this.connection) {
+ if (this.output.length === 0 && this.connection._httpMessage === this) {
+ debug('outgoing message end.');
+ this._finish();
+ }
}
return ret;

0 comments on commit 7b80c33

Please sign in to comment.