From 82844e8f9d04233340f2e467b409b7b8ce789d9d Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Fri, 16 Jan 2015 07:55:31 -0800 Subject: [PATCH] http: rename flush to flushHeaders In order to preserve the potential for a flush method being added to the streams API, rename flush to flushHeaders which is much more clear about the behavior of this method. --- doc/api/http.markdown | 2 +- lib/_http_outgoing.js | 2 +- test/simple/test-http-flush.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 3d482b441c8..3ba57a19567 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -855,7 +855,7 @@ Emitted when the server sends a '100 Continue' HTTP response, usually because the request contained 'Expect: 100-continue'. This is an instruction that the client should send the request body. -### request.flush() +### request.flushHeaders() Flush the request headers. diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 9fd579c09fd..d02bdf7f23e 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -613,7 +613,7 @@ OutgoingMessage.prototype._flush = function() { }; -OutgoingMessage.prototype.flush = function() { +OutgoingMessage.prototype.flushHeaders = function outgoingFlushHeaders() { if (!this._header) { // Force-flush the headers. this._implicitHeader(); diff --git a/test/simple/test-http-flush.js b/test/simple/test-http-flush.js index 842cf8729e0..08dd1477220 100644 --- a/test/simple/test-http-flush.js +++ b/test/simple/test-http-flush.js @@ -32,6 +32,6 @@ http.createServer(function(req, res) { host: '127.0.0.1', port: common.PORT, }); - req.flush(); // Flush the request headers. - req.flush(); // Should be idempotent. + req.flushHeaders(); // Flush the request headers. + req.flushHeaders(); // Should be idempotent. });