diff --git a/lib/_http_client.js b/lib/_http_client.js index dea669c6b41b80..bf99c440e92c88 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -704,21 +704,15 @@ ClientRequest.prototype.setTimeout = function setTimeout(msecs, callback) { return this; }; -ClientRequest.prototype.setNoDelay = function setNoDelay() { - const argsLen = arguments.length; - const args = new Array(argsLen); - for (var i = 0; i < argsLen; i++) - args[i] = arguments[i]; - this._deferToConnect('setNoDelay', args); -}; -ClientRequest.prototype.setSocketKeepAlive = function setSocketKeepAlive() { - const argsLen = arguments.length; - const args = new Array(argsLen); - for (var i = 0; i < argsLen; i++) - args[i] = arguments[i]; - this._deferToConnect('setKeepAlive', args); +ClientRequest.prototype.setNoDelay = function setNoDelay(noDelay) { + this._deferToConnect('setNoDelay', [noDelay]); }; +ClientRequest.prototype.setSocketKeepAlive = + function setSocketKeepAlive(enable, initialDelay) { + this._deferToConnect('setKeepAlive', [enable, initialDelay]); + }; + ClientRequest.prototype.clearTimeout = function clearTimeout(cb) { this.setTimeout(0, cb); };