|
|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|