]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Updated istream's stream_errno comments.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 6 Jul 2016 10:31:12 +0000 (13:31 +0300)
committerGitLab <gitlab@git.dovecot.net>
Wed, 6 Jul 2016 13:00:18 +0000 (16:00 +0300)
src/lib/istream.h

index 9f93f299d9a065aa78676b35d46dca40b28b877a..d722b047d17d3323f3170932c24e5d915d03c954 100644 (file)
@@ -7,7 +7,18 @@
 struct istream {
        uoff_t v_offset;
 
+       /* Commonly used errors:
+
+          ENOENT  - File/object doesn't exist.
+          EPIPE   - Stream ended unexpectedly (or i_stream_close() was called).
+          ESPIPE  - i_stream_seek() was used on a stream that can't be seeked.
+          ENOBUFS - i_stream_read_next_line() was used for a too long line.
+          EIO     - Internal error. Retrying may work, but it may also be
+                    because of a misconfiguration.
+          EINVAL  - Stream is corrupted.
+       */
        int stream_errno;
+
        bool mmaped:1; /* be careful when copying data */
        bool blocking:1; /* read() shouldn't return 0 */
        bool closed:1;
@@ -116,7 +127,8 @@ ssize_t i_stream_read(struct istream *stream);
    was successful. */
 void i_stream_skip(struct istream *stream, uoff_t count);
 /* Seek to specified position from beginning of file. Never fails, the next
-   read tells if it was successful. This works only for files. */
+   read tells if it was successful. This works only for files, others will
+   set stream_errno=ESPIPE. */
 void i_stream_seek(struct istream *stream, uoff_t v_offset);
 /* Like i_stream_seek(), but also giving a hint that after reading some data
    we could be seeking back to this mark or somewhere after it. If input