From: Timo Sirainen Date: Wed, 1 Jun 2016 12:15:19 +0000 (+0300) Subject: lib-fs: Added fs_write_stream_abort_async() X-Git-Tag: 2.3.0.rc1~3600 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=adb9f4a606df2df9fdd6502cfffa6fc5de92843f;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Added fs_write_stream_abort_async() --- diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index f124b2b102..d371a604d7 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -707,6 +707,13 @@ void fs_write_stream_abort(struct fs_file *file, struct ostream **output) (void)fs_write_stream_finish_int(file, FALSE); } +void fs_write_stream_abort_async(struct fs_file *file) +{ + i_assert(file->output == NULL); + + fs_write_stream_abort(file, &file->output); +} + void fs_write_set_hash(struct fs_file *file, const struct hash_method *method, const void *digest) { diff --git a/src/lib-fs/fs-api.h b/src/lib-fs/fs-api.h index 486e7fdf17..92a32fc5f4 100644 --- a/src/lib-fs/fs-api.h +++ b/src/lib-fs/fs-api.h @@ -270,6 +270,9 @@ int fs_write_stream_finish_async(struct fs_file *file); o_stream_ignore_last_errors() is called on the output stream so the caller doesn't need to do it. */ void fs_write_stream_abort(struct fs_file *file, struct ostream **output); +/* Abort writing to a stream after fs_write_stream_finish() was already + called. */ +void fs_write_stream_abort_async(struct fs_file *file); /* Set a hash to the following write. The storage can then verify that the input data matches the specified hash, or fail if it doesn't. Typically