]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fixes to make copying mail inside same mbox working.
authorTimo Sirainen <tss@iki.fi>
Wed, 29 Oct 2003 13:37:33 +0000 (15:37 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 29 Oct 2003 13:37:33 +0000 (15:37 +0200)
--HG--
branch : HEAD

src/lib-index/mbox/istream-mbox.c
src/lib-index/mbox/mbox-index.c
src/lib-storage/mail-save.c

index c4ef0adee20d40eef0e7f1d954849a4661c4f9df..a99a03db9800809750a14a82c1c2d3f7bb364c76 100644 (file)
@@ -80,7 +80,7 @@ static ssize_t _read(struct _istream *stream)
 
        if (limit != old_limit)
                i_stream_set_read_limit(mstream->input, old_limit);
-       return ret;
+       return mstream->istream.pos == 0 ? -1 : (ssize_t)mstream->istream.pos;
 }
 
 static void _seek(struct _istream *stream, uoff_t v_offset)
index d2c80398f5d79bed5751855df69fb4d2fd7c479e..d2d6541450bb6e7edd2aa23b92a4260bfd4dedc8 100644 (file)
@@ -85,11 +85,6 @@ struct istream *mbox_get_stream(struct mail_index *index, uoff_t offset,
                                                     MAIL_MMAP_BLOCK_SIZE,
                                                     0, 0, FALSE);
                } else {
-                       if (lseek(index->mbox_fd, 0, SEEK_SET) < 0) {
-                               mbox_set_syscall_error(index, "lseek()");
-                               return NULL;
-                       }
-
                        index->mbox_stream =
                                i_stream_create_file(index->mbox_fd,
                                                     default_pool,
index c685b97750ecff939ce314e822704f4b784db7a3..27b1d905a0dd0a1e13bdff6abe7ec6e0a7201db5 100644 (file)
@@ -167,6 +167,7 @@ int mail_storage_save(struct mail_storage *storage, const char *path,
                        errno = input->stream_errno;
                        if (errno == 0) {
                                /* EOF */
+                               i_warning("%lld vs %lld\n", input->v_offset, input->v_limit);
                                if (input->v_offset != input->v_limit &&
                                    input->v_limit != 0) {
                                        /* too early */