Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-20 16:25:49 +00:00

zapret-pcap: move file:close

This commit is contained in:
bol-van
2025-12-24 16:16:34 +03:00
parent efcc1477dd
commit 0430d9d9cd

View File

@@ -6,7 +6,6 @@ function pcap_write_packet(file, raw)
local sec, nsec = clock_gettime();
file:write(bu32(sec)..bu32(nsec)..bu32(#raw)..bu32(#raw))
file:write(raw)
file:close()
end
function pcap_write(file, raw)
local pos = file:seek()
@@ -36,4 +35,5 @@ function pcap(ctx, desync)
error("pcap: could not write to '".._G[fn_cache_name].."'")
end
pcap_write(f, raw_packet(ctx))
f:close()
end