make writing safe (by using a tmp file and moving to actual location)

This commit is contained in:
Green Sky 2024-02-19 20:32:56 +01:00
parent 385addff12
commit 57aced357e
No known key found for this signature in database
3 changed files with 6 additions and 3 deletions

@ -1 +1 @@
Subproject commit 6f3f9ef1911ce8189609ba9d6c7a5931ab1efc69
Subproject commit e40271670b4df96a8d02f32a1ba61a838419db48

View File

@ -105,8 +105,8 @@ void MessageFragmentStore::handleMessage(const Message3Handle& m) {
if (fragment_uid.empty()) {
for (auto& [ts_begin, ts_end, fid] : fuid_open) {
const int64_t frag_range = int64_t(ts_end) - int64_t(ts_begin);
//constexpr static int64_t max_frag_ts_extent {1000*60*60};
constexpr static int64_t max_frag_ts_extent {1000*60*3}; // 3min for testing
constexpr static int64_t max_frag_ts_extent {1000*60*60};
//constexpr static int64_t max_frag_ts_extent {1000*60*3}; // 3min for testing
const int64_t possible_extention = max_frag_ts_extent - frag_range;
// which direction

View File

@ -36,6 +36,9 @@ namespace Fragment::Components {
struct MessagesContact {
std::vector<uint8_t> id;
};
// TODO: add src contact (self id)
} // Fragment::Components
// handles fragments for messages