summaryrefslogtreecommitdiff
path: root/lib/_http_incoming.js
diff options
context:
space:
mode:
authormaasencioh <maasencioh@gmail.com>2016-10-12 15:47:06 +0200
committerJames M Snell <jasnell@gmail.com>2016-10-18 15:38:36 -0700
commit239ff06126474ec1035a676b4cb3423bcb2c4165 (patch)
tree1ac65e93cbb10cf9d57840607019ce71a1a99142 /lib/_http_incoming.js
parent23d6e1f7bc3d416ec1540d5c73ee7c87f0115800 (diff)
downloadandroid-node-v8-239ff06126474ec1035a676b4cb3423bcb2c4165.tar.gz
android-node-v8-239ff06126474ec1035a676b4cb3423bcb2c4165.tar.bz2
android-node-v8-239ff06126474ec1035a676b4cb3423bcb2c4165.zip
http: name anonymous functions in _http_incoming
Refs: https://github.com/nodejs/node/issues/8913 PR-URL: https://github.com/nodejs/node/pull/9055 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'lib/_http_incoming.js')
-rw-r--r--lib/_http_incoming.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js
index 4d1c3ea810..5c04ab9dfe 100644
--- a/lib/_http_incoming.js
+++ b/lib/_http_incoming.js
@@ -65,7 +65,7 @@ util.inherits(IncomingMessage, Stream.Readable);
exports.IncomingMessage = IncomingMessage;
-IncomingMessage.prototype.setTimeout = function(msecs, callback) {
+IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) {
if (callback)
this.on('timeout', callback);
this.socket.setTimeout(msecs);
@@ -73,7 +73,7 @@ IncomingMessage.prototype.setTimeout = function(msecs, callback) {
};
-IncomingMessage.prototype.read = function(n) {
+IncomingMessage.prototype.read = function read(n) {
if (!this._consuming)
this._readableState.readingMore = false;
this._consuming = true;
@@ -82,7 +82,7 @@ IncomingMessage.prototype.read = function(n) {
};
-IncomingMessage.prototype._read = function(n) {
+IncomingMessage.prototype._read = function _read(n) {
// We actually do almost nothing here, because the parserOnBody
// function fills up our internal buffer directly. However, we
// do need to unpause the underlying socket so that it flows.
@@ -94,13 +94,14 @@ 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) {
+IncomingMessage.prototype.destroy = function destroy(error) {
if (this.socket)
this.socket.destroy(error);
};
-IncomingMessage.prototype._addHeaderLines = function(headers, n) {
+IncomingMessage.prototype._addHeaderLines = _addHeaderLines;
+function _addHeaderLines(headers, n) {
if (headers && headers.length) {
var raw, dest;
if (this.complete) {
@@ -119,7 +120,7 @@ IncomingMessage.prototype._addHeaderLines = function(headers, n) {
this._addHeaderLine(k, v, dest);
}
}
-};
+}
// Add the given (field, value) pair to the message
@@ -129,7 +130,8 @@ IncomingMessage.prototype._addHeaderLines = function(headers, n) {
// multiple values this way. If not, we declare the first instance the winner
// and drop the second. Extended header fields (those beginning with 'x-') are
// always joined.
-IncomingMessage.prototype._addHeaderLine = function(field, value, dest) {
+IncomingMessage.prototype._addHeaderLine = _addHeaderLine;
+function _addHeaderLine(field, value, dest) {
field = field.toLowerCase();
switch (field) {
// Array headers:
@@ -176,12 +178,12 @@ IncomingMessage.prototype._addHeaderLine = function(field, value, dest) {
dest[field] = value;
}
}
-};
+}
// Call this instead of resume() if we want to just
// dump all the data to /dev/null
-IncomingMessage.prototype._dump = function() {
+IncomingMessage.prototype._dump = function _dump() {
if (!this._dumped) {
this._dumped = true;
this.resume();