1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-05 13:59:01 -05:00

remove npm agent code

Signed-off-by: Satya Rohith <me@satyarohith.com>
This commit is contained in:
Satya Rohith 2024-10-25 14:21:58 +05:30 committed by GitHub
parent 8e55dab349
commit 7cf82b7af4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -781,7 +781,6 @@ export class Socket extends Duplex {
_host: string | null = null;
// deno-lint-ignore no-explicit-any
_parent: any = null;
_isNpmAgent = false;
constructor(options: SocketOptions | number) {
if (typeof options === "number") {
@ -801,19 +800,6 @@ export class Socket extends Duplex {
super(options);
// Note: If the socket is created from @npmcli/agent, the 'socket' event
// on ClientRequest object happens after 'connect' event on Socket object.
// That swaps the sequence of op_node_http_request_with_conn() call and
// initial socket read. That causes op_node_http_request_with_conn() not
// working.
// To avoid the above situation, we detect the socket created from
// @npmcli/agent and pause the socket (and also skips the startTls call
// if it's TLSSocket)
this._isNpmAgent = new Error().stack?.includes("@npmcli/agent") || false;
if (this._isNpmAgent) {
this.pause();
}
if (options.handle) {
this._handle = options.handle;
this[asyncIdSymbol] = _getNewAsyncId(this._handle);