]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added i_stream_unset_destroy_callback()
authorTimo Sirainen <tss@iki.fi>
Wed, 14 Dec 2011 11:50:43 +0000 (13:50 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 14 Dec 2011 11:50:43 +0000 (13:50 +0200)
src/lib/istream.c
src/lib/istream.h

index 7ff659b921b003ecf446571068dd36a4b99596e1..04b0efbdbdece4cd2f57bd05521026d55c703c55 100644 (file)
@@ -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;
index 319036ae00cc6a3561869edab0f1a767ecf98960..134310a0592933ab838ee170baeba4b1be992828 100644 (file)
@@ -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);