summaryrefslogtreecommitdiff
path: root/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'message.c')
-rw-r--r--message.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/message.c b/message.c
index 1513691..8adb463 100644
--- a/message.c
+++ b/message.c
@@ -133,8 +133,17 @@ static char *message_buffer_readline(message_t *message)
static void message_buffer_fill(message_t *message)
{
FILE *fp = message->fp ? message->fp : stdin;
+ size_t n;
- message->buffer_stop += fread(message->buffer, 1, message->buffer_size - message->buffer_stop, fp);
+ if((n = fread(message->buffer + message->buffer_stop, 1, message->buffer_size - message->buffer_stop, fp)))
+ {
+ /* hook for the MDA pipe */
+ if(mda_fp)
+ fwrite(message->buffer + message->buffer_stop, 1, n, mda_fp);
+
+ message->buffer_stop += n;
+ }
+
}
static size_t message_buffer_flush(message_t *message, char *ptr, size_t size)