]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Clarify i[o]_stream_get_disconnect_reason() comment
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 2 Mar 2021 13:06:50 +0000 (15:06 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 11 Mar 2021 11:19:09 +0000 (11:19 +0000)
src/lib/iostream.h
src/lib/istream.h

index ac0b22148bdc01fe5042f3b440bf1289462e8c3a..87bc37486b1a24d460394ea827c9c800b0963f59 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef IOSTREAM_H
 #define IOSTREAM_H
 
-/* Returns human-readable reason for why iostream was disconnected. */
+/* Returns human-readable reason for why iostream was disconnected.
+   The output is either "Connection closed" for clean disconnections or
+   "Connection closed: <error>" for unclean disconnections. */
 const char *io_stream_get_disconnect_reason(struct istream *input,
                                            struct ostream *output);
 
index 04263ff1d6ba6a497125bcdf8dd8e0540cbd5751..2ea9601463361089431ec72dc49a105da4c1f4e0 100644 (file)
@@ -100,9 +100,11 @@ int i_stream_get_fd(struct istream *stream);
 /* Returns error string for the last error. It also returns "EOF" in case there
    is no error, but eof is set. Otherwise it returns "<no error>". */
 const char *i_stream_get_error(struct istream *stream);
-/* Returns human-readable reason for why istream was disconnected. This can be
-   called to log the error when i_stream_read() returns -1. If there's an error
-   the output is identical to i_stream_get_error(). */
+/* Returns human-readable reason for why istream was disconnected.
+   The output is either "Connection closed" for clean disconnections or
+   "Connection closed: <error>" for unclean disconnections. This is an
+   alternative to i_stream_get_error(), which is preferred to be used when
+   logging errors about client connections. */
 const char *i_stream_get_disconnect_reason(struct istream *stream);
 
 /* Mark the stream and all of its parent streams closed. Any reads after this