[dovecot-cvs]
dovecot/src/lib-storage/index/mbox istream-raw-mbox.c, 1.17,
1.18 istream-raw-mbox.h, 1.6, 1.7 mbox-sync.c, 1.66, 1.67
cras at dovecot.org
cras at dovecot.org
Sun Aug 22 07:00:09 EEST 2004
Update of /home/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv29108/lib-storage/index/mbox
Modified Files:
istream-raw-mbox.c istream-raw-mbox.h mbox-sync.c
Log Message:
Removed istream.disconnected, it's too much of a special case and the only
place where it's needed will be removed soon. Added istream.eof back, it's
more useful.
Index: istream-raw-mbox.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/istream-raw-mbox.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- istream-raw-mbox.c 15 Aug 2004 03:40:32 -0000 1.17
+++ istream-raw-mbox.c 22 Aug 2004 04:00:07 -0000 1.18
@@ -18,7 +18,6 @@
unsigned int corrupted:1;
unsigned int eom:1;
- unsigned int eof:1;
};
static void _close(struct _iostream *stream __attr_unused__)
@@ -167,7 +166,7 @@
stream->pos = pos;
rstream->eom = TRUE;
- rstream->eof = TRUE;
+ stream->istream.eof = TRUE;
handle_end_of_mail(rstream, pos);
return ret < 0 ? _read(stream) : ret;
}
@@ -177,7 +176,7 @@
/* beginning of message, we haven't yet read our From-line */
if (mbox_read_from_line(rstream) < 0) {
stream->pos = 0;
- rstream->eof = TRUE;
+ stream->istream.eof = TRUE;
rstream->corrupted = TRUE;
return -1;
}
@@ -269,7 +268,6 @@
rstream->input_peak_offset = 0;
rstream->eom = FALSE;
- rstream->eof = FALSE;
}
struct istream *i_stream_create_raw_mbox(pool_t pool, struct istream *input)
@@ -450,7 +448,7 @@
i_stream_seek(rstream->input, rstream->from_offset);
rstream->eom = FALSE;
- rstream->eof = FALSE;
+ stream->eof = FALSE;
}
int istream_raw_mbox_seek(struct istream *stream, uoff_t offset)
@@ -461,7 +459,7 @@
rstream->corrupted = FALSE;
rstream->eom = FALSE;
- rstream->eof = FALSE;
+ stream->eof = FALSE;
if (rstream->mail_size != (uoff_t)-1 &&
rstream->hdr_offset + rstream->mail_size == offset) {
@@ -509,11 +507,3 @@
rstream->istream.skip = 0;
rstream->istream.pos = 0;
}
-
-int istream_raw_mbox_is_eof(struct istream *stream)
-{
- struct raw_mbox_istream *rstream =
- (struct raw_mbox_istream *)stream->real_stream;
-
- return rstream->eof;
-}
Index: istream-raw-mbox.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/istream-raw-mbox.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- istream-raw-mbox.h 18 Jun 2004 00:33:08 -0000 1.6
+++ istream-raw-mbox.h 22 Aug 2004 04:00:07 -0000 1.7
@@ -36,7 +36,4 @@
/* Flush all buffering. Call if you modify the mbox. */
void istream_raw_mbox_flush(struct istream *stream);
-/* Returns TRUE if we've read the whole mbox. */
-int istream_raw_mbox_is_eof(struct istream *stream);
-
#endif
Index: mbox-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- mbox-sync.c 31 Jul 2004 00:48:09 -0000 1.66
+++ mbox-sync.c 22 Aug 2004 04:00:07 -0000 1.67
@@ -111,7 +111,7 @@
{
/* get EOF */
(void)istream_raw_mbox_get_header_offset(sync_ctx->input);
- if (istream_raw_mbox_is_eof(sync_ctx->input))
+ if (sync_ctx->input->eof)
return 0;
memset(mail_ctx, 0, sizeof(*mail_ctx));
@@ -826,7 +826,7 @@
}
}
- if (istream_raw_mbox_is_eof(sync_ctx->input)) {
+ if (sync_ctx->input->eof) {
/* rest of the messages in index don't exist -> expunge them */
while (sync_ctx->idx_seq <= messages_count)
mail_index_expunge(sync_ctx->t, sync_ctx->idx_seq++);
@@ -841,7 +841,7 @@
uoff_t offset, padding, trailer_size;
int need_rewrite;
- if (!istream_raw_mbox_is_eof(sync_ctx->input)) {
+ if (!sync_ctx->input->eof) {
i_assert(sync_ctx->need_space_seq == 0);
i_assert(sync_ctx->expunged_space == 0);
return 0;
@@ -938,7 +938,7 @@
sizeof(sync_ctx->base_uid_validity));
}
- if (istream_raw_mbox_is_eof(sync_ctx->input) &&
+ if (sync_ctx->input->eof &&
sync_ctx->next_uid != sync_ctx->hdr->next_uid) {
i_assert(sync_ctx->next_uid != 0);
mail_index_update_header(sync_ctx->t,
More information about the dovecot-cvs
mailing list