]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: Rename i_stream_is_eof() to i_stream_read_eof()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 30 Oct 2017 14:06:39 +0000 (16:06 +0200)
committerTimo Sirainen <tss@dovecot.fi>
Mon, 30 Oct 2017 15:10:30 +0000 (17:10 +0200)
This describes its behavior a bit better.

src/lib-compression/istream-zlib.c
src/lib-fs/fs-sis.c
src/lib-http/http-server-request.c
src/lib-oauth2/oauth2.c
src/lib-program-client/program-client.c
src/lib-storage/index/dbox-common/dbox-file.c
src/lib-storage/index/dbox-multi/mdbox-purge.c
src/lib-storage/index/index-mail-binary.c
src/lib/istream.c
src/lib/istream.h

index 63c8f2630deb827df07827b7e7832a0165a45c86..5f68d75d27bbb600e28976cea662dba0030957e6 100644 (file)
@@ -183,7 +183,7 @@ static ssize_t i_stream_zlib_read(struct istream_private *stream)
                        if (ret <= 0)
                                return ret;
                }
-               if (!zstream->gz || i_stream_is_eof(stream->parent)) {
+               if (!zstream->gz || i_stream_read_eof(stream->parent)) {
                        stream->istream.eof = TRUE;
                        return -1;
                }
index 5e2d431df3d3c01564666495f71ef50653ba0eca..93eb9863fccb2da63621663dbd8897d600fbe49a 100644 (file)
@@ -243,7 +243,7 @@ static int fs_sis_write(struct fs_file *_file, const void *data, size_t size)
 
        if (file->hash_input != NULL &&
            stream_cmp_block(file->hash_input, data, size) &&
-           i_stream_is_eof(file->hash_input)) {
+           i_stream_read_eof(file->hash_input)) {
                /* try to use existing file */
                if (fs_sis_try_link(file))
                        return 0;
@@ -293,7 +293,7 @@ static int fs_sis_write_stream_finish(struct fs_file *_file, bool success)
 
        if (file->hash_input != NULL &&
            o_stream_cmp_equals(_file->output) &&
-           i_stream_is_eof(file->hash_input)) {
+           i_stream_read_eof(file->hash_input)) {
                o_stream_unref(&_file->output);
                if (fs_sis_try_link(file)) {
                        fs_write_stream_abort_parent(_file, &file->fs_output);
index 1763528afba401ff271bbb09a222cc4bb26b238e..6e6522fdc8079cb09ac0e555b0c24156a973e0d4 100644 (file)
@@ -680,7 +680,7 @@ payload_handler_pump_callback(bool success,
        struct ostream *output = iostream_pump_get_output(phandler->pump);
 
        if (success) {
-               if (!i_stream_is_eof(conn->incoming_payload)) {
+               if (!i_stream_read_eof(conn->incoming_payload)) {
                        http_server_request_fail_close(req,
                                413, "Payload Too Large");
                } else {
index 760f8a7c761ea305a2ed46d5122e3f20b7cf528a..d6442356110289c109abf10f2c13e29afcb29d5e 100644 (file)
@@ -49,7 +49,7 @@ oauth2_parse_json(struct oauth2_request *req)
                (void)json_parser_deinit(&req->parser, &error);
                error = "Invalid response data";
                success = FALSE;
-       } else if (i_stream_is_eof(req->is) &&
+       } else if (i_stream_read_eof(req->is) &&
                   req->is->v_offset == 0 && req->is->stream_errno == 0) {
                /* discard error, empty response is OK. */
                (void)json_parser_deinit(&req->parser, &error);
index f2143c32f311d254212bcd8211cca90475653cbb..09dfdb382ad6646f131b9c9cb07e46dc6da352de 100644 (file)
@@ -186,7 +186,7 @@ bool program_client_input_pending(struct program_client *pclient)
 
        if (pclient->program_input != NULL &&
            !pclient->program_input->closed &&
-           !i_stream_is_eof(pclient->program_input)) {
+           !i_stream_read_eof(pclient->program_input)) {
                return TRUE;
        }
 
@@ -195,7 +195,7 @@ bool program_client_input_pending(struct program_client *pclient)
                for(i = 0; i < count; i++) {
                        if (efds[i].input != NULL &&
                            !efds[i].input->closed &&
-                           !i_stream_is_eof(efds[i].input)) {
+                           !i_stream_read_eof(efds[i].input)) {
                                return TRUE;
                        }
                }
@@ -389,7 +389,7 @@ void program_client_extra_fd_input(struct program_client_extra_fd *efd)
        i_assert(efd->callback != NULL);
        efd->callback(efd->context, efd->input);
 
-       if (efd->input->closed || i_stream_is_eof(efd->input)) {
+       if (efd->input->closed || i_stream_read_eof(efd->input)) {
                if (!program_client_input_pending(pclient))
                        program_client_disconnect(pclient, FALSE);
        }
index 0b3aed167e2ce7fdcdfeff4fe01a33132b9850c8..ffedcc4cadd131f62dbf4c60b7b6416f0b30aa37 100644 (file)
@@ -454,7 +454,7 @@ int dbox_file_seek_next(struct dbox_file *file, uoff_t *offset_r, bool *last_r)
                        *offset_r = file->cur_offset;
                        return ret;
                }
-               if (i_stream_is_eof(file->input)) {
+               if (i_stream_read_eof(file->input)) {
                        *last_r = TRUE;
                        return 0;
                }
index 704d855f5a63bd66ec0c3aeaa380ce2b7c748071..2c78084dd0ebb362a43645ae55ea0f6553d2d869 100644 (file)
@@ -215,7 +215,7 @@ mdbox_purge_save_msg(struct mdbox_purge_context *ctx, struct dbox_file *file,
                ret = -1;
        } else if (input->v_offset != msg_size) {
                i_assert(input->v_offset < msg_size);
-               i_assert(i_stream_is_eof(file->input));
+               i_assert(i_stream_read_eof(file->input));
 
                dbox_file_set_corrupted(file, "truncated message at EOF");
                ret = 0;
index 9533a470ad52e9cb5419fc2f582340ec9e5919c4..11150d8a755801ab4562180c6fad8084fc5d2f48 100644 (file)
@@ -342,7 +342,7 @@ blocks_count_lines(struct binary_ctx *ctx, struct istream *full_input)
                if (cur_block->input->eof) {
                        /* go to the next block */
                        if (++block_idx == block_count) {
-                               i_assert(i_stream_is_eof(full_input));
+                               i_assert(i_stream_read_eof(full_input));
                                ret = -1;
                                break;
                        }
index cb904f5bad9d40cea193741f094ea6cf8ac0b792..9665cbc3f7dd0c5cb8a4c2e5c727d504aadcd0a8 100644 (file)
@@ -393,7 +393,7 @@ bool i_stream_have_bytes_left(struct istream *stream)
        return i_stream_get_data_size(stream) > 0 || !stream->eof;
 }
 
-bool i_stream_is_eof(struct istream *stream)
+bool i_stream_read_eof(struct istream *stream)
 {
        if (i_stream_get_data_size(stream) == 0)
                (void)i_stream_read(stream);
index 1efffd9472b994bada0f411a481f6081f7489777..a279688d9af64efd8e399b20868e7b7e788fa996 100644 (file)
@@ -169,7 +169,7 @@ bool i_stream_have_bytes_left(struct istream *stream);
    returns EOF/error. Usually it's enough to check for stream->eof instead of
    calling this function. Note that if the stream isn't at EOF, this function
    has now read data into the stream buffer. */
-bool i_stream_is_eof(struct istream *stream);
+bool i_stream_read_eof(struct istream *stream);
 /* Returns the absolute offset of the stream. This is the stream's current
    v_offset + the parent's absolute offset when the stream was created. */
 uoff_t i_stream_get_absolute_offset(struct istream *stream);