summaryrefslogtreecommitdiff
path: root/lib/_http_incoming.js
diff options
context:
space:
mode:
authorEvan Lucas <evanlucas@me.com>2015-05-13 21:25:57 -0500
committerRoman Reiss <me@silverwind.io>2015-05-16 07:17:41 +0200
commitd4726cde57856896c560820b89eae0bc08621034 (patch)
tree01e5ec875240d6e0fb9a7b4e8cfba309dd271a44 /lib/_http_incoming.js
parentc7fb91dc1310f9454d4aa8091bcc6d305322a72f (diff)
downloadandroid-node-v8-d4726cde57856896c560820b89eae0bc08621034.tar.gz
android-node-v8-d4726cde57856896c560820b89eae0bc08621034.tar.bz2
android-node-v8-d4726cde57856896c560820b89eae0bc08621034.zip
http,net,tls: return this from setTimeout methods
Modifies the setTimeout methods for the following prototypes: - http.ClientRequest - http.IncomingMessage - http.OutgoingMessage - http.Server - https.Server - net.Socket - tls.TLSSocket Previously, the above functions returned undefined. They now return `this`. This is useful for chaining function calls. PR-URL: https://github.com/nodejs/io.js/pull/1699 Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'lib/_http_incoming.js')
-rw-r--r--lib/_http_incoming.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js
index aea665e809..b371c7d7a5 100644
--- a/lib/_http_incoming.js
+++ b/lib/_http_incoming.js
@@ -68,6 +68,7 @@ IncomingMessage.prototype.setTimeout = function(msecs, callback) {
if (callback)
this.on('timeout', callback);
this.socket.setTimeout(msecs);
+ return this;
};