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

access to internalRid via kStreamBaseField as it could be swapped to TlsConn in afterConnect of tls.connect

This commit is contained in:
Yoshiya Hinosawa 2024-10-29 22:51:42 +09:00
parent eaa52272ee
commit 3a4de2eb82
No known key found for this signature in database
GPG key ID: 9017DB4559488785
2 changed files with 4 additions and 3 deletions

View file

@ -51,6 +51,7 @@ import { Agent, globalAgent } from "node:_http_agent";
import { urlToHttpOptions } from "ext:deno_node/internal/url.ts";
import { kEmptyObject, once } from "ext:deno_node/internal/util.mjs";
import { constants, TCP } from "ext:deno_node/internal_binding/tcp_wrap.ts";
import { kStreamBaseField } from "ext:deno_node/internal_binding/stream_wrap.ts";
import { notImplemented } from "ext:deno_node/_utils.ts";
import { isWindows } from "ext:deno_node/_util/os.ts";
import {
@ -453,10 +454,11 @@ class ClientRequest extends OutgoingMessage {
(async () => {
try {
const parsedUrl = new URL(url);
let baseConnRid = this.socket._handle[internalRidSymbol];
let baseConnRid =
this.socket._handle[kStreamBaseField][internalRidSymbol];
if (this._encrypted && !this.socket.authorized) {
[baseConnRid] = op_tls_start({
rid: this.socket._handle[internalRidSymbol],
rid: baseConnRid,
hostname: parsedUrl.hostname,
caCerts: [],
alpnProtocols: ["http/1.0", "http/1.1"],

View file

@ -385,7 +385,6 @@ export class TCP extends ConnectionWrap {
this.#address = req.localAddress = localAddr.hostname;
this.#port = req.localPort = localAddr.port;
this[kStreamBaseField] = conn;
this[internalRidSymbol] = conn[internalRidSymbol];
try {
this.afterConnect(req, 0);