This describes its behavior a bit better.
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;
}
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;
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);
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 {
(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);
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;
}
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;
}
}
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);
}
*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;
}
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;
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;
}
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);
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);