Allow file owners to revoke active transfers on custody expiry or deletion

This commit is contained in:
evgeny committed 2026-10-01 15:42:54 +03:00
1 parent 84c148acff
commit e47c7fb2ac
2 files changed
+13

No files matched your search

+11
View File
@@ -329,3 +329,14 @@ struct file_transfer_op* file_transfer_pull(struct file_transfer* ft, uint64_t g
void file_transfer_cancel(struct file_transfer_op* op) {
if (op) ft_finish(op, -2);
}
void file_transfer_cancel_object(struct file_transfer* ft, const uint8_t object[16]) {
if (!ft) return;
for (;;) {
struct file_transfer_op* found = NULL;
for (struct file_transfer_op* op = ft->ops; op; op = op->next)
if (!memcmp(op->object, object, 16)) { found = op; break; }
if (!found) break;
ft_finish(found, -2);
}
}
+2
View File
@@ -28,5 +28,7 @@ struct file_transfer_op* file_transfer_pull(struct file_transfer* ft, uint64_t g
const uint8_t object[16], uint64_t size, const char* destination,
file_transfer_done_fn done, void* arg);
void file_transfer_cancel(struct file_transfer_op* op);
/* Отозвать все операции объекта (TTL/delete); callbacks приёма вызываются с -2. */
void file_transfer_cancel_object(struct file_transfer* ft, const uint8_t object[16]);
#endif