Mercurial > dovecot > core-2.2
comparison src/lib-storage/index/dbox/dbox-uidlist.c @ 4304:3bb4f35b99d4 HEAD
dbox_rotate_size checking was wrong.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 08 Jun 2006 17:42:21 +0300 |
parents | be915546ce49 |
children | f693898fee3b |
comparison
equal
deleted
inserted
replaced
4303:5f03738219a6 | 4304:3bb4f35b99d4 |
---|---|
33 dev_t dev; | 33 dev_t dev; |
34 ino_t ino; | 34 ino_t ino; |
35 | 35 |
36 struct dotlock *dotlock; | 36 struct dotlock *dotlock; |
37 array_t ARRAY_DEFINE(seqs, unsigned int); | 37 array_t ARRAY_DEFINE(seqs, unsigned int); |
38 | |
39 /* append offset for the first mail we've saved */ | |
40 uoff_t append_offset; | |
41 }; | 38 }; |
42 | 39 |
43 struct dbox_uidlist { | 40 struct dbox_uidlist { |
44 struct dbox_mailbox *mbox; | 41 struct dbox_mailbox *mbox; |
45 char *path; | 42 char *path; |
669 } | 666 } |
670 str_printfa(str, " %u", save_file->file->file_seq); | 667 str_printfa(str, " %u", save_file->file->file_seq); |
671 | 668 |
672 /* add creation time and file size */ | 669 /* add creation time and file size */ |
673 str_printfa(str, " %s %s", dec2str(save_file->file->create_time), | 670 str_printfa(str, " %s %s", dec2str(save_file->file->create_time), |
674 dec2str(save_file->append_offset)); | 671 dec2str(save_file->file->append_offset)); |
675 str_append_c(str, '\n'); | 672 str_append_c(str, '\n'); |
676 } | 673 } |
677 | 674 |
678 static void dbox_uidlist_update_changes(struct dbox_uidlist_append_ctx *ctx) | 675 static void dbox_uidlist_update_changes(struct dbox_uidlist_append_ctx *ctx) |
679 { | 676 { |
1060 | 1057 |
1061 /* check first from already opened files */ | 1058 /* check first from already opened files */ |
1062 files = array_get(&ctx->files, &count); | 1059 files = array_get(&ctx->files, &count); |
1063 for (i = 0; i < count; i++) { | 1060 for (i = 0; i < count; i++) { |
1064 if (DBOX_CAN_APPEND(ctx, files[i]->file->create_time, | 1061 if (DBOX_CAN_APPEND(ctx, files[i]->file->create_time, |
1065 files[i]->append_offset)) { | 1062 files[i]->file->append_offset)) { |
1066 if (dbox_reopen_file(ctx, files[i]) < 0) | 1063 if (dbox_reopen_file(ctx, files[i]) < 0) |
1067 return -1; | 1064 return -1; |
1068 | 1065 |
1069 *file_r = file = files[i]->file; | 1066 *file_r = file = files[i]->file; |
1070 o_stream_seek(file->output, file->append_offset); | 1067 o_stream_seek(file->output, file->append_offset); |