comparison util/datamanager.lua @ 14018:7ffb2d3ab50b 13.0

util.datamanager: Include record length in header In order to distinguish 32bit from 64bit architectures since they look the same when truncated and little-endian.
author Kim Alvefur <zash@zash.se>
date Tue, 09 Dec 2025 21:41:34 +0100
parents 515ac7e8ae6d
children 604bed81808e
comparison
equal deleted inserted replaced
14014:f0b2a05bcedc 14018:7ffb2d3ab50b
272 272
273 local index_fmt, index_item_size, index_magic; 273 local index_fmt, index_item_size, index_magic;
274 if string.packsize then 274 if string.packsize then
275 index_fmt = "T"; -- offset to the end of the item, length can be derived from two index items 275 index_fmt = "T"; -- offset to the end of the item, length can be derived from two index items
276 index_item_size = string.packsize(index_fmt); 276 index_item_size = string.packsize(index_fmt);
277 index_magic = string.pack(index_fmt, 7767639 + 1); -- Magic string: T9 for "prosody", version number 277 index_magic = string.pack(index_fmt, 7767639 + 2 + index_item_size); -- Magic string: T9 for "prosody", version number
278 end 278 end
279 279
280 local function list_append(username, host, datastore, data) 280 local function list_append(username, host, datastore, data)
281 if not data then return; end 281 if not data then return; end
282 if callback(username, host, datastore) == false then return true; end 282 if callback(username, host, datastore) == false then return true; end