mirror of
https://git.robbyzambito.me/zaprus
synced 2026-02-04 00:14:52 +00:00
Complete handshake badly
This commit is contained in:
22
src/main.zig
22
src/main.zig
@@ -192,8 +192,6 @@ pub fn main(init: std.process.Init) !void {
|
||||
break :blk msg_w.buffered();
|
||||
};
|
||||
|
||||
std.debug.print("full message = {any}\n", .{full_msg});
|
||||
|
||||
try socket.send(full_msg);
|
||||
return;
|
||||
}
|
||||
@@ -213,14 +211,11 @@ pub fn main(init: std.process.Init) !void {
|
||||
},
|
||||
};
|
||||
|
||||
_ = udp_dest_port;
|
||||
|
||||
var connection_buf: [2048]u8 = undefined;
|
||||
const connection_bytes = connection.toBytes(&connection_buf);
|
||||
std.debug.print("connection: {any}\n", .{connection_bytes});
|
||||
headers.setPayloadLen(connection_bytes.len);
|
||||
|
||||
const full_msg = blk: {
|
||||
var full_msg = blk: {
|
||||
var msg_buf: [2048]u8 = undefined;
|
||||
var msg_w: Writer = .fixed(&msg_buf);
|
||||
msg_w.writeAll(&headers.toBytes()) catch unreachable;
|
||||
@@ -228,9 +223,20 @@ pub fn main(init: std.process.Init) !void {
|
||||
break :blk msg_w.buffered();
|
||||
};
|
||||
|
||||
std.debug.print("full message = {any}\n", .{full_msg});
|
||||
|
||||
try socket.send(full_msg);
|
||||
|
||||
headers.udp.dst_port = udp_dest_port;
|
||||
try init.io.sleep(.fromSeconds(3), .real);
|
||||
|
||||
full_msg = blk: {
|
||||
var msg_buf: [2048]u8 = undefined;
|
||||
var msg_w: Writer = .fixed(&msg_buf);
|
||||
msg_w.writeAll(&headers.toBytes()) catch unreachable;
|
||||
msg_w.writeAll(connection_bytes) catch unreachable;
|
||||
break :blk msg_w.buffered();
|
||||
};
|
||||
try socket.send(full_msg);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user