[Dovecot] Developer Documentation

Alex Baule alexwbaule at gmail.com
Thu Dec 10 22:10:21 EET 2009


Hi Timo....

For tests i do it:

In src/lib-storage/index/maildir/maildir-mail.c


In the final of function maildir_open_mail i change the i_stream_create_fd
to this:

------- origin ------
    int fd  = -1;
.
.
.
.
.

    if (fd == -1) {
        *deleted_r = TRUE;
        return NULL;
    }

    input = i_stream_create_fd(fd, 0, TRUE);
    index_mail_set_read_buffer_size(mail, input);
    return input;

----------------------

-------- my  ------------
    int fd  = -1;
    int fd1 = -1;
    int fdp[2];
.
.
.
.
.
.
    if (fd == -1) {
        *deleted_r = TRUE;
        return NULL;
    }

    do_open(mbox, "/storage/emexis/
exemplo.com.br/messages/alex/Maildir/body_test", &fd1);
    fdp[0] = fd;
    fdp[1] = fd1;

    input = i_stream_create_concat(fdp);

    index_mail_set_read_buffer_size(mail, input);
    return input;
--------------------------
But the concat don't work.

I Try too create 2 streams and put this 2 fds in concat, not work too....

---------- my second ----------------
    int fd  = -1;
    int fd1 = -1;
    int fdp[2];
.
.
.
.
.
.
    if (fd == -1) {
        *deleted_r = TRUE;
        return NULL;
    }

    do_open(mbox, "/storage/emexis/
exemplo.com.br/messages/alex/Maildir/body_test", &fd1);
    fdp[0] = fd;
    fdp[1] = fd1;

    input = i_stream_create_fd(fd, 0, TRUE);
    input = i_stream_create_fd(fd1, 0, TRUE);
    input = i_stream_create_concat(fdp);
--------------------------------------------




2009/12/10 Timo Sirainen <tss at iki.fi>

> On Dec 10, 2009, at 11:16 AM, Alex Baule wrote:
>
> > Ok ... i understand...
> >
> > this is the last one...lol
> >
> > in zib plugin i see a implementation of i_stream_create_zlib, this is a
> "substitution" to the i_stream_create_fd , right ?
> >
> > So, i need to do every think like in istream-zlib.c (close, destroy,
> read, seek, stat and sync) to swap the original functions ?
>
> No, you don't need to implement a new istream, just ignore istream-zlib.c
> completely. Instead of the plugin calling i_stream_create_zlib, you just
> call i_stream_create_concat.
>
>


More information about the dovecot mailing list