diff --git a/lib/http.js b/lib/http.js index 2012edbdec..52bbf350cb 100644 --- a/lib/http.js +++ b/lib/http.js @@ -79,11 +79,11 @@ IncomingMessage.prototype.setBodyEncoding = function (enc) { }; IncomingMessage.prototype.pause = function () { - this.connection.readPause(); + this.connection.pause(); }; IncomingMessage.prototype.resume = function () { - this.connection.readResume(); + this.connection.resume(); }; IncomingMessage.prototype._addHeaderLine = function (field, value) { diff --git a/src/node_net.cc b/src/node_net.cc index 272862a8fb..da43517f11 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -56,6 +56,13 @@ static const struct addrinfo client_tcp_hints = Persistent Connection::constructor_template; +Handle ThrottleMissingError(const Arguments& args) { + HandleScope scope; + return ThrowException(Exception::Error(String::New( + "readPause() and readResume() have been renamed to pause() and " + "resume() respectively."))); +} + // Initialize the tcp.Connection object. void Connection::Initialize(v8::Handle target) { HandleScope scope; @@ -102,6 +109,8 @@ void Connection::Initialize(v8::Handle target) { NODE_SET_PROTOTYPE_METHOD(constructor_template, "setEncoding", SetEncoding); NODE_SET_PROTOTYPE_METHOD(constructor_template, "pause", Pause); NODE_SET_PROTOTYPE_METHOD(constructor_template, "resume", Resume); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "readPause", ThrottleMissingError); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "readResume", ThrottleMissingError); NODE_SET_PROTOTYPE_METHOD(constructor_template, "setTimeout", SetTimeout); NODE_SET_PROTOTYPE_METHOD(constructor_template, "setNoDelay", SetNoDelay); #if EVCOM_HAVE_GNUTLS