Make sure modifications to a message or its parts become visible in the message stream.
* include/mailutils/sys/body.h (_mu_body)<rawstream>: New member. * include/mailutils/sys/message.h (_mu_message)<rawstream>: New member. * libmailutils/mailbox/body.c: Rewrite. Return the specially crafted "body-stream" for user I/O operations. Writes to that stream trigger creation of a temporary stream (write-through mode) which will be used for subsequent I/O. * libmailutils/mailbox/msgbody.c (mu_message_get_body): Use msg->rawstream. * libmailutils/mailbox/msgheader.c (message_header_fill): Do not call mu_message_get_streamref, as that can result in endless recursion. Use msg->rawstream instead. * libmailutils/mailbox/msgref.c (_mu_message_free): Destroy both rawstream and outstream. * libmailutils/mailbox/msgstream.c (mu_message_set_stream): Set rawstream. (mu_message_get_stream): Create outstream as needed. (mu_message_get_streamref): If the message has been modified, create the outstream and return it to the caller. This way, the modifications become visible via the stream interface. * libmailutils/tests/Makefile.am: Add new testcases. * libmailutils/tests/testsuite.at: Likewise. * libmailutils/tests/modmesg.c: New file. * libmailutils/tests/modmesg00.at: New file. * libmailutils/tests/modmesg01.at: New file. * libmailutils/tests/modmesg02.at: New file. * libmailutils/tests/modmesg03.at: New file. * mh/mhn.c: Fix message reference counting.
Showing
15 changed files
with
630 additions
and
273 deletions
libmailutils/tests/modmesg.c
0 → 100644
libmailutils/tests/modmesg00.at
0 → 100644
libmailutils/tests/modmesg01.at
0 → 100644
libmailutils/tests/modmesg02.at
0 → 100644
libmailutils/tests/modmesg03.at
0 → 100644
-
Please register or sign in to post a comment