From: Timo Sirainen Date: Wed, 14 Dec 2011 11:50:43 +0000 (+0200) Subject: Added i_stream_unset_destroy_callback() X-Git-Tag: 2.1.rc2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c28f6aa0b70af4811c9ace9114fe827c2f503455;p=thirdparty%2Fdovecot%2Fcore.git Added i_stream_unset_destroy_callback() --- diff --git a/src/lib/istream.c b/src/lib/istream.c index 7ff659b921..04b0efbdbd 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -54,6 +54,14 @@ void i_stream_set_destroy_callback(struct istream *stream, iostream->destroy_context = context; } +void i_stream_unset_destroy_callback(struct istream *stream) +{ + struct iostream_private *iostream = &stream->real_stream->iostream; + + iostream->destroy_callback = NULL; + iostream->destroy_context = NULL; +} + int i_stream_get_fd(struct istream *stream) { struct istream_private *_stream = stream->real_stream; diff --git a/src/lib/istream.h b/src/lib/istream.h index 319036ae00..134310a059 100644 --- a/src/lib/istream.h +++ b/src/lib/istream.h @@ -54,6 +54,8 @@ void i_stream_set_destroy_callback(struct istream *stream, #define i_stream_set_destroy_callback(stream, callback, context) \ CONTEXT_CALLBACK(i_stream_set_destroy_callback, istream_callback_t, \ callback, context, stream) +/* Remove the destroy callback. */ +void i_stream_unset_destroy_callback(struct istream *stream); /* Return file descriptor for stream, or -1 if none is available. */ int i_stream_get_fd(struct istream *stream);