Implement an ioctl for replace bottom-level transport layers in a stream chain.
* include/mailutils/stream.h (MU_IOCTL_SWAP_STREAM): New ioctl op. (mu_stream_seterr): New function. * include/mailutils/sys/stream.h (_MU_SWAP_FIRST_ONLY) (_MU_SWAP_IOCTL_MUST_SUCCEED): New defines. (_mu_stream_swap_streams): New proto. * mailbox/amd.c (amd_body_stream_read): Always update *pnread. * mailbox/errors (MU_ERR_NO_TRANSPORT): New error code. * mailbox/stream.c (_stream_seterror): Rename to mu_stream_seterr, remove static qualifier. All uses updated. (_mu_stream_swap_streams): New function. * mailbox/filter_iconv.c (_icvt_ioctl): Implement MU_IOCTL_SWAP_STREAM. * mailbox/iostream.c (_iostream_ctl): Likewise. * mailbox/xscript-stream.c (_xscript_ctl): Likewise. * pop3d/extra.c (real_istream, real_ostream): Remove statics. (pop3d_init_tls_server): Use MU_IOCTL_SWAP_STREAM to replace bottom-level transport layers without recreating the entire stream chain.
Showing
10 changed files
with
157 additions
and
57 deletions
-
Please register or sign in to post a comment