diff options
author | Robby Zambito <contact@robbyzambito.me> | 2025-04-26 11:05:31 -0400 |
---|---|---|
committer | Robby Zambito <contact@robbyzambito.me> | 2025-04-27 16:18:48 -0400 |
commit | 180babae15f26a5f4538e7b103176d26f5acc1c2 (patch) | |
tree | ed0a16cdf0bc2e1699dea57655c6c0ec5729f700 /src/Client.zig | |
parent | fe1c735026b08e6985dc267a7487cc58998cbaf5 (diff) |
Big changes to the C api implementationsc-api
Should map directly to the zig struct instead of mallocing
Diffstat (limited to 'src/Client.zig')
-rw-r--r-- | src/Client.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Client.zig b/src/Client.zig index 19f8360..849d627 100644 --- a/src/Client.zig +++ b/src/Client.zig @@ -76,7 +76,7 @@ pub fn sendInitialConnection(payload: []const u8, initial_port: u16, allocator: return msg; } -pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusMessage { +pub fn connect(payload: []const u8, allocator: Allocator) !SaprusMessage { var initial_port: u16 = 0; if (rand) |r| { initial_port = r.intRangeAtMost(u16, 1024, 65000); @@ -109,7 +109,7 @@ pub fn connect(payload: []const u8, allocator: Allocator) !?SaprusMessage { // Complete handshake after awaiting response try broadcastSaprusMessage(msg, randomPort(), allocator); - return initial_conn_res; + return initial_conn_res.?; } const SaprusMessage = @import("message.zig").Message; |