summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-04-29 14:12:24 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-04-29 14:12:25 +0200
commitd3ddee61c2f83e2a3b7ebabfbefee060801d27f5 (patch)
treef215591db20cc489e23e8d4064685fa407d07e3c
parentaf1ed99ce2d209e33a7c2aaedaff041fb1b5e8ad (diff)
downloadandroid-node-v8-d3ddee61c2f83e2a3b7ebabfbefee060801d27f5.tar.gz
android-node-v8-d3ddee61c2f83e2a3b7ebabfbefee060801d27f5.tar.bz2
android-node-v8-d3ddee61c2f83e2a3b7ebabfbefee060801d27f5.zip
http: forward-port missing bits from 01e2920
Forward-port the comments from commit 01e2920 (v0.10) to the master branch. Everything else from that patch already exists in master. It didn't merge cleanly because lib/http.js has been split up in several files.
-rw-r--r--lib/_http_incoming.js3
-rw-r--r--lib/_http_outgoing.js3
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js
index 53a3a386fa..c089ec9e24 100644
--- a/lib/_http_incoming.js
+++ b/lib/_http_incoming.js
@@ -102,6 +102,9 @@ IncomingMessage.prototype._read = function(n) {
};
+// It's possible that the socket will be destroyed, and removed from
+// any messages, before ever calling this. In that case, just skip
+// it, since something else is destroying this connection anyway.
IncomingMessage.prototype.destroy = function(error) {
if (this.socket)
this.socket.destroy(error);
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index 8edc8666de..57394b408b 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -93,6 +93,9 @@ OutgoingMessage.prototype.setTimeout = function(msecs, callback) {
};
+// It's possible that the socket will be destroyed, and removed from
+// any messages, before ever calling this. In that case, just skip
+// it, since something else is destroying this connection anyway.
OutgoingMessage.prototype.destroy = function(error) {
if (this.socket)
this.socket.destroy(error);