http: name anonymous functions in _http_server
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>
This commit is contained in:
parent
2ccf601efe
commit
02c3c205f1
@ -96,7 +96,7 @@ function ServerResponse(req) {
|
|||||||
}
|
}
|
||||||
util.inherits(ServerResponse, OutgoingMessage);
|
util.inherits(ServerResponse, OutgoingMessage);
|
||||||
|
|
||||||
ServerResponse.prototype._finish = function() {
|
ServerResponse.prototype._finish = function _finish() {
|
||||||
DTRACE_HTTP_SERVER_RESPONSE(this.connection);
|
DTRACE_HTTP_SERVER_RESPONSE(this.connection);
|
||||||
LTTNG_HTTP_SERVER_RESPONSE(this.connection);
|
LTTNG_HTTP_SERVER_RESPONSE(this.connection);
|
||||||
COUNTER_HTTP_SERVER_RESPONSE();
|
COUNTER_HTTP_SERVER_RESPONSE();
|
||||||
@ -131,7 +131,7 @@ function onServerResponseClose() {
|
|||||||
if (this._httpMessage) this._httpMessage.emit('close');
|
if (this._httpMessage) this._httpMessage.emit('close');
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerResponse.prototype.assignSocket = function(socket) {
|
ServerResponse.prototype.assignSocket = function assignSocket(socket) {
|
||||||
assert(!socket._httpMessage);
|
assert(!socket._httpMessage);
|
||||||
socket._httpMessage = this;
|
socket._httpMessage = this;
|
||||||
socket.on('close', onServerResponseClose);
|
socket.on('close', onServerResponseClose);
|
||||||
@ -141,23 +141,24 @@ ServerResponse.prototype.assignSocket = function(socket) {
|
|||||||
this._flush();
|
this._flush();
|
||||||
};
|
};
|
||||||
|
|
||||||
ServerResponse.prototype.detachSocket = function(socket) {
|
ServerResponse.prototype.detachSocket = function detachSocket(socket) {
|
||||||
assert(socket._httpMessage === this);
|
assert(socket._httpMessage === this);
|
||||||
socket.removeListener('close', onServerResponseClose);
|
socket.removeListener('close', onServerResponseClose);
|
||||||
socket._httpMessage = null;
|
socket._httpMessage = null;
|
||||||
this.socket = this.connection = null;
|
this.socket = this.connection = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
ServerResponse.prototype.writeContinue = function(cb) {
|
ServerResponse.prototype.writeContinue = function writeContinue(cb) {
|
||||||
this._writeRaw('HTTP/1.1 100 Continue' + CRLF + CRLF, 'ascii', cb);
|
this._writeRaw('HTTP/1.1 100 Continue' + CRLF + CRLF, 'ascii', cb);
|
||||||
this._sent100 = true;
|
this._sent100 = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
ServerResponse.prototype._implicitHeader = function() {
|
ServerResponse.prototype._implicitHeader = function _implicitHeader() {
|
||||||
this.writeHead(this.statusCode);
|
this.writeHead(this.statusCode);
|
||||||
};
|
};
|
||||||
|
|
||||||
ServerResponse.prototype.writeHead = function(statusCode, reason, obj) {
|
ServerResponse.prototype.writeHead = writeHead;
|
||||||
|
function writeHead(statusCode, reason, obj) {
|
||||||
var headers;
|
var headers;
|
||||||
|
|
||||||
if (typeof reason === 'string') {
|
if (typeof reason === 'string') {
|
||||||
@ -219,9 +220,9 @@ ServerResponse.prototype.writeHead = function(statusCode, reason, obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this._storeHeader(statusLine, headers);
|
this._storeHeader(statusLine, headers);
|
||||||
};
|
}
|
||||||
|
|
||||||
ServerResponse.prototype.writeHeader = function() {
|
ServerResponse.prototype.writeHeader = function writeHeader() {
|
||||||
this.writeHead.apply(this, arguments);
|
this.writeHead.apply(this, arguments);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -250,7 +251,7 @@ function Server(requestListener) {
|
|||||||
util.inherits(Server, net.Server);
|
util.inherits(Server, net.Server);
|
||||||
|
|
||||||
|
|
||||||
Server.prototype.setTimeout = function(msecs, callback) {
|
Server.prototype.setTimeout = function setTimeout(msecs, callback) {
|
||||||
this.timeout = msecs;
|
this.timeout = msecs;
|
||||||
if (callback)
|
if (callback)
|
||||||
this.on('timeout', callback);
|
this.on('timeout', callback);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user