Fixes in stream subsystem. Rewrite and optimize maidag lmtp mode using streams.
* libmailutils/file_stream.c (mu_fd_stream_create): Mark stream as open, do not call mu_stream_open explicitly. * libmailutils/message_stream.c (mu_stream_to_message): Bugfixes, wrong owner given to mu_envelope_set_ calls. * libmailutils/stream.c (_MU_STR_FLUSH_ALL) (_MU_STR_FLUSH_KEEP): New macros for _stream_flush_buffer. (_stream_flush_buffer): Change the meaning of the last argument. All callers updated. (mu_stream_seek): Fix operation with MU_SEEK_END. Call _mu_stream_cleareof on success. (mu_stream_read): Call _stream_flush_buffer in buffered mode. (mu_stream_getdelim, mu_stream_readdelim): Call _stream_flush_buffer. * libmailutils/streamcpy.c (mu_stream_copy): Reset size if mu_stream_seek fails. * libmailutils/temp_file_stream.c (mu_temp_file_stream_create): Set full buffering mode by default. * maidag/mailtmp.c: Remove. * maidag/Makefile.am (maidag_SOURCES): Remove mailtmp.c * po/POTFILES.in: Likewise. * maidag/deliver.c (make_tmp): Rewrite. Return mu_mailbox_t. All callers changed. * maidag/lmtp.c (lmtp_transcript): Remove static. (lmpt_transcript): New function. (lmtp_reply): Use mu_stream_t instead of FILE. (xlatnl): Remove. Superseded by mu_rtrim_cset and family. (mtmp, mbox): Remove globals. (mesg): New global. (cfun_unknown, cfun_mail_from, cfun_rcpt_to) (dot_temp_fail, dot_deliver, cfun_rset) (cfun_lhlo, cfun_quit, cfun_help): Use mu_stream_t instead of FILE. (cfun_data): Rewrite. (cfun_dot): Remove. (to_fgets): Rewrite using mu_stream_t. (lmtp_loop): Change signature. Rewrite using mu_stream_t. (lmtp_connection, maidag_lmtp_server): Update accordingly. * maidag/maidag.c (maidag_transcript): New global. (options, parse_opt): New option --transcript. * maidag/maidag.h (maidag_transcript): New extern. (mail_tmp_begin, mail_tmp_add_line, mail_tmp_finish) (mail_tmp_destroy): Remove.
Showing
12 changed files
with
176 additions
and
252 deletions
This diff is collapsed.
Click to expand it.
maidag/mailtmp.c
deleted
100644 → 0
-
Please register or sign in to post a comment