[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mailbox stream

From: Alain Magloire
Subject: Re: mailbox stream
Date: Fri, 1 Jun 2001 11:15:47 -0400 (EDT)

> There seems to be an inconsistency in handling of mailbox->stream
> member between mailbox.c and mbx_mbox.c, mbx_mboxscan.c. For example,
> if one calls mailbox_set_stream(mbx, stream), the stream is associated
> with the mailbox folder, i.e. mbx->folder->stream, whereas all
> functions in mbx_mbox.c, mbx_mboxscan.c operate on mbx->stream
> directly. This effectively makes mailbox_set_stream() useless.


> I suppose the functions in mbx_mbox*.c should obtain stream pointer
> via mailbox_get_stream instead of directly accessing mailbox->stream.
> Am I missing something?

No, It is a confusing scheme that should be settle.  Let me explain the
problem for a remote mailbox, such as IMAP4 or POP3.

Because we need to make a distinction between the stream that represent
the mailbox and the stream that represent the channel or the protocol
(i.e the socket).  So if I do this:

mailbox_get_stream (mbox, &stream);
while (stream_readline (stream, buffer, sizeof buffer, offset, &n) == 0
       n > 0)
    /* write the buffer to a file  ... etc .. */

Meaning I'm expecting to when reading from a stream that I got from
a mailbox that I'm dowloading _The messages_  not receiving things
like "+OK LIST 1 234" or "* SEARCH 1 2 3\ng002 SEARCH completed\n"

To get/set the __tcpip__ stream we should have another function call
I thought of

mailbox_get_carrier (mailbox, stream_t *);
mailbox_get_channel (mailbox, stream_t *);

Or we could decide, forget it, this type of functionnality is not need it
they should always read messages via the message_t and
mailbox_{s,g}et_stream () means the to give the __tcpip__ stream.

I'll gladly cleanup the code once we know which path to take.

Any suggestions?

au revoir, alain
Aussi haut que l'on soit assis, on n'est toujours assis que sur son cul !!!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]