| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1db1c87 commit cff440e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -71,6 +71,7 @@ const { | |||
| 71 | 71 | hideStackFrames, | |
| 72 | 72 | } = require('internal/errors'); | |
| 73 | 73 | const { validateString } = require('internal/validators'); | |
| 74 | + const { assignFunctionName } = internalUtil; | ||
| 74 | 75 | const { isUint8Array } = require('internal/util/types'); | |
| 75 | 76 | ||
| 76 | 77 | let debug = require('internal/util/debuglog').debuglog('http', (fn) => { | |
@@ -312,14 +313,14 @@ OutgoingMessage.prototype._renderHeaders = function _renderHeaders() { | |||
| 312 | 313 | return headers; | |
| 313 | 314 | }; | |
| 314 | 315 | ||
| 315 | - OutgoingMessage.prototype.cork = function() { | ||
| 316 | + OutgoingMessage.prototype.cork = function cork() { | ||
| 316 | 317 | this[kCorked]++; | |
| 317 | 318 | if (this[kSocket]) { | |
| 318 | 319 | this[kSocket].cork(); | |
| 319 | 320 | } | |
| 320 | 321 | }; | |
| 321 | 322 | ||
| 322 | - OutgoingMessage.prototype.uncork = function() { | ||
| 323 | + OutgoingMessage.prototype.uncork = function uncork() { | ||
| 323 | 324 | this[kCorked]--; | |
| 324 | 325 | if (this[kSocket]) { | |
| 325 | 326 | this[kSocket].uncork(); | |
@@ -664,21 +665,21 @@ function matchHeader(self, state, field, value) { | |||
| 664 | 665 | } | |
| 665 | 666 | } | |
| 666 | 667 | ||
| 667 | - const validateHeaderName = hideStackFrames((name, label) => { | ||
| 668 | + const validateHeaderName = assignFunctionName('validateHeaderName', hideStackFrames((name, label) => { | ||
| 668 | 669 | if (typeof name !== 'string' || !name || !checkIsHttpToken(name)) { | |
| 669 | 670 | throw new ERR_INVALID_HTTP_TOKEN.HideStackFramesError(label || 'Header name', name); | |
| 670 | 671 | } | |
| 671 | - }); | ||
| 672 | + })); | ||
| 672 | 673 | ||
| 673 | - const validateHeaderValue = hideStackFrames((name, value) => { | ||
| 674 | + const validateHeaderValue = assignFunctionName('validateHeaderValue', hideStackFrames((name, value) => { | ||
| 674 | 675 | if (value === undefined) { | |
| 675 | 676 | throw new ERR_HTTP_INVALID_HEADER_VALUE.HideStackFramesError(value, name); | |
| 676 | 677 | } | |
| 677 | 678 | if (checkInvalidHeaderChar(value)) { | |
| 678 | 679 | debug('Header "%s" contains invalid characters', name); | |
| 679 | 680 | throw new ERR_INVALID_CHAR.HideStackFramesError('header content', name); | |
| 680 | 681 | } | |
| 681 | - }); | ||
| 682 | + })); | ||
| 682 | 683 | ||
| 683 | 684 | function parseUniqueHeadersOption(headers) { | |
| 684 | 685 | if (!ArrayIsArray(headers)) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,6 +79,7 @@ const { | |||
| 79 | 79 | }, | |
| 80 | 80 | } = require('internal/errors'); | |
| 81 | 81 | const { | |
| 82 | + assignFunctionName, | ||
| 82 | 83 | kEmptyObject, | |
| 83 | 84 | promisify, | |
| 84 | 85 | SymbolAsyncDispose, | |
@@ -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