mirror of
https://git.robbyzambito.me/zaprus
synced 2025-12-20 16:24:50 +00:00
Specify endianness when writing the header struct
This commit is contained in:
@@ -49,13 +49,13 @@ const SaprusMessage = union(SaprusPacketType) {
|
|||||||
|
|
||||||
switch (s) {
|
switch (s) {
|
||||||
.relay => |r| {
|
.relay => |r| {
|
||||||
try w.writeStruct(r.header);
|
try w.writeStructEndian(r.header, .big);
|
||||||
try w.writeInt(u16, @intCast(r.payload.len), .big);
|
try w.writeInt(u16, @intCast(r.payload.len), .big);
|
||||||
try base64.encodeWriter(w, r.payload);
|
try base64.encodeWriter(w, r.payload);
|
||||||
},
|
},
|
||||||
.file_transfer => unreachable,
|
.file_transfer => unreachable,
|
||||||
.connection => |c| {
|
.connection => |c| {
|
||||||
try w.writeStruct(c.header);
|
try w.writeStructEndian(c.header, .big);
|
||||||
try w.writeInt(u16, @intCast(c.payload.len), .big);
|
try w.writeInt(u16, @intCast(c.payload.len), .big);
|
||||||
try base64.encodeWriter(w, c.payload);
|
try base64.encodeWriter(w, c.payload);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user