mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
deref
This commit is contained in:
@@ -4230,6 +4230,7 @@ pub const H2FrameParser = struct {
|
||||
this.detachNativeSocket();
|
||||
if (JSTLSSocket.fromJS(socket_js)) |socket| {
|
||||
log("TLSSocket attached", .{});
|
||||
defer _ = this.flush();
|
||||
if (socket.attachNativeCallback(.{ .h2 = this })) {
|
||||
this.native_socket = .{ .tls = socket };
|
||||
} else {
|
||||
@@ -4241,6 +4242,7 @@ pub const H2FrameParser = struct {
|
||||
this.has_nonnative_backpressure = false;
|
||||
} else if (JSTCPSocket.fromJS(socket_js)) |socket| {
|
||||
log("TCPSocket attached", .{});
|
||||
defer _ = this.flush();
|
||||
|
||||
if (socket.attachNativeCallback(.{ .h2 = this })) {
|
||||
this.native_socket = .{ .tcp = socket };
|
||||
@@ -4261,9 +4263,11 @@ pub const H2FrameParser = struct {
|
||||
|
||||
switch (native_socket) {
|
||||
inline .tcp, .tls => |socket| {
|
||||
socket.poll_ref.unref(this.globalThis.bunVM());
|
||||
socket.detachNativeCallback();
|
||||
},
|
||||
inline .tcp_writeonly, .tls_writeonly => |socket| {
|
||||
socket.poll_ref.unref(this.globalThis.bunVM());
|
||||
socket.deref();
|
||||
},
|
||||
.none => {},
|
||||
@@ -4337,6 +4341,7 @@ pub const H2FrameParser = struct {
|
||||
if (try options.get(globalObject, "native")) |socket_js| {
|
||||
if (JSTLSSocket.fromJS(socket_js)) |socket| {
|
||||
log("TLSSocket attached", .{});
|
||||
defer _ = this.flush();
|
||||
if (socket.attachNativeCallback(.{ .h2 = this })) {
|
||||
this.native_socket = .{ .tls = socket };
|
||||
} else {
|
||||
@@ -4346,6 +4351,7 @@ pub const H2FrameParser = struct {
|
||||
}
|
||||
} else if (JSTCPSocket.fromJS(socket_js)) |socket| {
|
||||
log("TCPSocket attached", .{});
|
||||
defer _ = this.flush();
|
||||
if (socket.attachNativeCallback(.{ .h2 = this })) {
|
||||
this.native_socket = .{ .tcp = socket };
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user