Skip to content

Commit

Permalink
Update requests completed
Browse files Browse the repository at this point in the history
  • Loading branch information
KhairallahA committed Oct 1, 2024
1 parent bb594e4 commit c3a3c2b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/network/protocol/messages/filterload.zig
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,21 @@ pub const FilterLoadMessage = struct {
if (!std.meta.hasFn(@TypeOf(r), "readNoEof")) @compileError("Expects r to have fn 'readNoEof'.");
}

var fl: Self = undefined;

const filter_len = (try CompactSizeUint.decodeReader(r)).value();
const filter = try allocator.alloc(u8, filter_len);
errdefer allocator.free(filter);
try r.readNoEof(filter);

fl.filter = filter;
fl.hash_func = try r.readInt(u32, .little);
fl.tweak = try r.readInt(u32, .little);
fl.flags = try r.readInt(u8, .little);

return fl;
const hash_func = try r.readInt(u32, .little);
const tweak = try r.readInt(u32, .little);
const flags = try r.readInt(u8, .little);

return Self{
.filter = filter,
.hash_func = hash_func,
.tweak = tweak,
.flags = flags,
};
}

pub fn deserializeSlice(allocator: std.mem.Allocator, bytes: []const u8) !Self {
Expand Down

0 comments on commit c3a3c2b

Please sign in to comment.