sqlite: add cache_size/mmap_size/temp_store PRAGMAs to db_sync and topo_group — 159x insert speedup, fix test_chat_sync_stress timeout

This commit is contained in:
Evgeny committed 2026-07-18 20:16:24 +03:00
1 parent 0e0ad9316a
commit 20f5e6c953
11 files changed
+131 -46

No files matched your search

+4 -2
View File
@@ -14,7 +14,7 @@ QString encodeInviteLink(uint64_t channelId, const QByteArray& pubkey,
}
QByteArray blob;
blob.reserve(1 + 8 + addrs.size() * (1 + 32 + 18));
blob.reserve(1 + 8 + addrs.size() * (1 + 32 + 19));
blob.append(static_cast<char>(INVITE_LINK_VERSION));
@@ -37,6 +37,7 @@ QString encodeInviteLink(uint64_t channelId, const QByteArray& pubkey,
blob.append(pubkey);
for (int j = 0; j < cnt; j++) {
blob.append(static_cast<char>(addrs[i + j].socketId));
blob.append(addrs[i + j].address);
quint16 p = addrs[i + j].port;
blob.append(static_cast<char>((p >> 8) & 0xFF));
@@ -111,12 +112,13 @@ InviteData decodeInviteLink(const QString& link) {
for (int j = 0; j < cnt; j++) {
bool isV6 = header & (1 << (2 + j));
int ipLen = isV6 ? 16 : 4;
if (off + ipLen + 2 > len) {
if (off + 1 + ipLen + 2 > len) {
d.error = QStringLiteral("truncated at addr %1 of block").arg(j);
GUI_ERROR("decodeInviteLink: truncated at addr %d of block", j);
return d;
}
InviteAddr a;
a.socketId = data[off++];
a.family = isV6 ? 6 : 4;
a.address = QByteArray(reinterpret_cast<const char*>(data + off), ipLen);
off += ipLen;