]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fix to recent error handling change.
authorTimo Sirainen <tss@iki.fi>
Tue, 25 May 2010 16:34:56 +0000 (17:34 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 25 May 2010 16:34:56 +0000 (17:34 +0100)
--HG--
branch : HEAD

src/lib-index/mail-transaction-log-view.c

index 13fa9056e05fa17fd2cfc4b542af11803624ae5b..e2f8eb434dd293df6f82a771d3a1bcd2eead491e 100644 (file)
@@ -202,16 +202,6 @@ int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
        }
        i_assert(min_file_offset >= view->tail->hdr.hdr_size);
 
-       if (min_file_seq == view->head->hdr.file_seq &&
-           min_file_offset > view->head->sync_offset) {
-               /* log file offset is probably corrupted in the index file. */
-               mail_transaction_log_view_set_corrupted(view,
-                       "file_seq=%u, min_file_offset (%"PRIuUOFF_T
-                       ") > sync_offset (%"PRIuUOFF_T")", min_file_seq,
-                       min_file_offset, view->head->sync_offset);
-               return -1;
-       }
-
        /* we have all of them. update refcounts. */
        mail_transaction_log_view_unref_all(view);
 
@@ -262,6 +252,16 @@ int mail_transaction_log_view_set(struct mail_transaction_log_view *view,
                }
        }
 
+       if (min_file_seq == view->head->hdr.file_seq &&
+           min_file_offset > view->head->sync_offset) {
+               /* log file offset is probably corrupted in the index file. */
+               mail_transaction_log_view_set_corrupted(view,
+                       "file_seq=%u, min_file_offset (%"PRIuUOFF_T
+                       ") > sync_offset (%"PRIuUOFF_T")", min_file_seq,
+                       min_file_offset, view->head->sync_offset);
+               return -1;
+       }
+
        i_assert(max_file_seq == (uint32_t)-1 ||
                 max_file_seq == view->head->hdr.file_seq);
        i_assert(max_file_offset == (uoff_t)-1 ||