clean declare structs (#3929)

This commit is contained in:
Ciro Spaciari
2023-08-02 16:58:44 -03:00
committed by GitHub
parent 9bbac35fd0
commit d9f162ff95
2 changed files with 2 additions and 5 deletions

View File

@@ -169,8 +169,7 @@ pub const ServerConfig = struct {
const log = Output.scoped(.SSLConfig, false);
pub fn asUSockets(this_: ?SSLConfig) uws.us_bun_socket_context_options_t {
var ctx_opts: uws.us_bun_socket_context_options_t = undefined;
@memset(@as([*]u8, @ptrCast(&ctx_opts))[0..@sizeOf(uws.us_bun_socket_context_options_t)], 0);
var ctx_opts: uws.us_bun_socket_context_options_t = .{};
if (this_) |ssl_config| {
if (ssl_config.key_file_name != null)

View File

@@ -319,9 +319,7 @@ fn NewHTTPContext(comptime ssl: bool) type {
}
pub fn init(this: *@This()) !void {
var opts: uws.us_socket_context_options_t = undefined;
const size = @sizeOf(uws.us_socket_context_options_t);
@memset(@as([*]u8, @ptrCast(&opts))[0..size], 0);
var opts: uws.us_socket_context_options_t = .{};
this.us_socket_context = uws.us_create_socket_context(ssl_int, http_thread.loop, @sizeOf(usize), opts).?;
if (comptime ssl) {
this.sslCtx().setup();