For the new mailbox, one of the short coming with the old stream_t
object was that select() was not cover, meaning it was not possible to check if a stream was {read,write} ready. The old was to get the fd (stream_get_fd()) and do the select. Providing, stream_is_readready (stream_t, int timeout); stream_is_writeready (stream_t, int timeout); stream_is_exceptionpending (stream_t, int timeout); stream_is_open (stream_t); Takes care of it. It will work specially for tcp stream. * mailbox2/stream.c: New functions for the select calls: (stream_is_readready): New function. (stream_is_writeready): New function.(stream_t, int timeout); (stream_is_exceptionpending): New function. (stream_is_open): New function. * mailbox2/bstream.c (_bs_readline): Bug was truncating the string to early. (_bs_is_readready): New file. (_bs_is_writeready): New file. (_bs_is_exceptionpending): New file. (_bs_is_open): New file. * mailbox2/fstream.c: stubs for the select functions. * mailbox2/memstream.c: stubs for the select functions. * mailbox2/mapstream.c: stubs for the select functions. * mailbox2/tcpstream.c: stubs for the select functions. * mailbox2/include/mailutils/stream.h: Adjust the prototypes * mailbox2/include/mailutils/sys/stream.h: Adjust the prototypes It is better not to put threading (Pthread) code in the low level API. But instead in mailbox_t framework, where it can be control. * mailbox2/include/mailutils/pop3.h: Adjust the prototypes. * mailbox2/pop3/*.c: Remove threading code.
Showing
39 changed files
with
694 additions
and
1097 deletions
mailbox2/mstream.c
deleted
100644 → 0
mailbox2/pop3/pop3_carrier.c
0 → 100644
-
Please register or sign in to post a comment