| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a896eff commit 74a807e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,6 +70,7 @@ const { | |||
| 70 | 70 | hideStackFrames, | |
| 71 | 71 | } = require('internal/errors'); | |
| 72 | 72 | const { validateString } = require('internal/validators'); | |
| 73 | + const { assignFunctionName } = require('internal/util'); | ||
| 73 | 74 | const { isUint8Array } = require('internal/util/types'); | |
| 74 | 75 | ||
| 75 | 76 | let debug = require('internal/util/debuglog').debuglog('http', (fn) => { | |
@@ -254,14 +255,14 @@ OutgoingMessage.prototype._renderHeaders = function _renderHeaders() { | |||
| 254 | 255 | return headers; | |
| 255 | 256 | }; | |
| 256 | 257 | ||
| 257 | - OutgoingMessage.prototype.cork = function() { | ||
| 258 | + OutgoingMessage.prototype.cork = function cork() { | ||
| 258 | 259 | this[kCorked]++; | |
| 259 | 260 | if (this[kSocket]) { | |
| 260 | 261 | this[kSocket].cork(); | |
| 261 | 262 | } | |
| 262 | 263 | }; | |
| 263 | 264 | ||
| 264 | - OutgoingMessage.prototype.uncork = function() { | ||
| 265 | + OutgoingMessage.prototype.uncork = function uncork() { | ||
| 265 | 266 | this[kCorked]--; | |
| 266 | 267 | if (this[kSocket]) { | |
| 267 | 268 | this[kSocket].uncork(); | |
@@ -606,21 +607,21 @@ function matchHeader(self, state, field, value) { | |||
| 606 | 607 | } | |
| 607 | 608 | } | |
| 608 | 609 | ||
| 609 | - const validateHeaderName = hideStackFrames((name, label) => { | ||
| 610 | + const validateHeaderName = assignFunctionName('validateHeaderName', hideStackFrames((name, label) => { | ||
| 610 | 611 | if (typeof name !== 'string' || !name || !checkIsHttpToken(name)) { | |
| 611 | 612 | throw new ERR_INVALID_HTTP_TOKEN.HideStackFramesError(label || 'Header name', name); | |
| 612 | 613 | } | |
| 613 | - }); | ||
| 614 | + })); | ||
| 614 | 615 | ||
| 615 | - const validateHeaderValue = hideStackFrames((name, value) => { | ||
| 616 | + const validateHeaderValue = assignFunctionName('validateHeaderValue', hideStackFrames((name, value) => { | ||
| 616 | 617 | if (value === undefined) { | |
| 617 | 618 | throw new ERR_HTTP_INVALID_HEADER_VALUE.HideStackFramesError(value, name); | |
| 618 | 619 | } | |
| 619 | 620 | if (checkInvalidHeaderChar(value)) { | |
| 620 | 621 | debug('Header "%s" contains invalid characters', name); | |
| 621 | 622 | throw new ERR_INVALID_CHAR.HideStackFramesError('header content', name); | |
| 622 | 623 | } | |
| 623 | - }); | ||
| 624 | + })); | ||
| 624 | 625 | ||
| 625 | 626 | function parseUniqueHeadersOption(headers) { | |
| 626 | 627 | if (!ArrayIsArray(headers)) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,6 +80,7 @@ const { | |||
| 80 | 80 | }, | |
| 81 | 81 | } = require('internal/errors'); | |
| 82 | 82 | const { | |
| 83 | + assignFunctionName, | ||
| 83 | 84 | kEmptyObject, | |
| 84 | 85 | promisify, | |
| 85 | 86 | } = require('internal/util'); | |
@@ -573,17 +574,17 @@ function Server(options, requestListener) { | |||
| 573 | 574 | ObjectSetPrototypeOf(Server.prototype, net.Server.prototype); | |
| 574 | 575 | ObjectSetPrototypeOf(Server, net.Server); | |
| 575 | 576 | ||
| 576 | - Server.prototype.close = function() { | ||
| 577 | + Server.prototype.close = function close() { | ||
| 577 | 578 | httpServerPreClose(this); | |
| 578 | 579 | ReflectApply(net.Server.prototype.close, this, arguments); | |
| 579 | 580 | return this; | |
| 580 | 581 | }; | |
| 581 | 582 | ||
| 582 | - Server.prototype[SymbolAsyncDispose] = async function() { | ||
| 583 | + Server.prototype[SymbolAsyncDispose] = assignFunctionName(SymbolAsyncDispose, async function() { | ||
| 583 | 584 | return promisify(this.close).call(this); | |
| 584 | - }; | ||
| 585 | + }); | ||
| 585 | 586 | ||
| 586 | - Server.prototype.closeAllConnections = function() { | ||
| 587 | + Server.prototype.closeAllConnections = function closeAllConnections() { | ||
| 587 | 588 | if (!this[kConnections]) { | |
| 588 | 589 | return; | |
| 589 | 590 | } | |
@@ -595,7 +596,7 @@ Server.prototype.closeAllConnections = function() { | |||
| 595 | 596 | } | |
| 596 | 597 | }; | |
| 597 | 598 | ||
| 598 | - Server.prototype.closeIdleConnections = function() { | ||
| 599 | + Server.prototype.closeIdleConnections = function closeIdleConnections() { | ||
| 599 | 600 | if (!this[kConnections]) { | |
| 600 | 601 | return; | |
| 601 | 602 | } | |
@@ -618,7 +619,8 @@ Server.prototype.setTimeout = function setTimeout(msecs, callback) { | |||
| 618 | 619 | return this; | |
| 619 | 620 | }; | |
| 620 | 621 | ||
| 621 | - Server.prototype[EE.captureRejectionSymbol] = function(err, event, ...args) { | ||
| 622 | + Server.prototype[EE.captureRejectionSymbol] = | ||
| 623 | + assignFunctionName(EE.captureRejectionSymbol, function(err, event, ...args) { | ||
| 622 | 624 | switch (event) { | |
| 623 | 625 | case 'request': { | |
| 624 | 626 | const { 1: res } = args; | |
@@ -639,7 +641,7 @@ Server.prototype[EE.captureRejectionSymbol] = function(err, event, ...args) { | |||
| 639 | 641 | net.Server.prototype[SymbolFor('nodejs.rejection')] | |
| 640 | 642 | .apply(this, arguments); | |
| 641 | 643 | } | |
| 642 | - }; | ||
| 644 | + }); | ||
| 643 | 645 | ||
| 644 | 646 | function checkConnections() { | |
| 645 | 647 | if (this.headersTimeout === 0 && this.requestTimeout === 0) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -110,7 +110,7 @@ Server.prototype.closeIdleConnections = HttpServer.prototype.closeIdleConnection | |||
| 110 | 110 | ||
| 111 | 111 | Server.prototype.setTimeout = HttpServer.prototype.setTimeout; | |
| 112 | 112 | ||
| 113 | - Server.prototype.close = function() { | ||
| 113 | + Server.prototype.close = function close() { | ||
| 114 | 114 | httpServerPreClose(this); | |
| 115 | 115 | ReflectApply(tls.Server.prototype.close, this, arguments); | |
| 116 | 116 | return this; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments