Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uws: tidy use of ssl intFromBool #12839

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/deps/uws.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ pub const Timer = opaque {

pub const SocketContext = opaque {
pub fn getNativeHandle(this: *SocketContext, comptime ssl: bool) *anyopaque {
return us_socket_context_get_native_handle(comptime @as(i32, @intFromBool(ssl)), this).?;
return us_socket_context_get_native_handle(@intFromBool(ssl), this).?;
}

fn _deinit_ssl(this: *SocketContext) void {
Expand Down Expand Up @@ -1143,10 +1143,7 @@ pub const SocketContext = opaque {
}

fn getLoop(this: *SocketContext, ssl: bool) ?*Loop {
if (ssl) {
return us_socket_context_loop(@as(i32, 1), this);
}
return us_socket_context_loop(@as(i32, 0), this);
return us_socket_context_loop(@intFromBool(ssl), this);
}

/// closes and deinit the SocketContexts
Expand All @@ -1164,7 +1161,7 @@ pub const SocketContext = opaque {

pub fn close(this: *SocketContext, ssl: bool) void {
debug("us_socket_context_close({d})", .{@intFromPtr(this)});
us_socket_context_close(@as(i32, @intFromBool(ssl)), this);
us_socket_context_close(@intFromBool(ssl), this);
}

pub fn ext(this: *SocketContext, ssl: bool, comptime ContextType: type) ?*ContextType {
Expand Down
Loading