diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-18 17:06:41 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-18 17:06:41 +0000 |
commit | 5e303a63481165da46a78de98f4aadbd892b4d9e (patch) | |
tree | 9ff16aa908c2b61ef2e34b3257fa083f21b465f8 | |
parent | b0d22be3b58c243d5e6a16870e3c01c67cf2b380 (diff) | |
download | mailutils-5e303a63481165da46a78de98f4aadbd892b4d9e.tar.gz mailutils-5e303a63481165da46a78de98f4aadbd892b4d9e.tar.bz2 |
(sendmail_send_message): Bugfix: stream_read
should not use sendmail->offset for positioning.
-rw-r--r-- | mailbox/sendmail.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mailbox/sendmail.c b/mailbox/sendmail.c index 70c50fbdb..fde4893f8 100644 --- a/mailbox/sendmail.c +++ b/mailbox/sendmail.c @@ -345,10 +345,11 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from, char buffer[512]; size_t len = 0; int rc; - + size_t offset = 0; + message_get_stream (msg, &stream); while ((status = stream_read (stream, buffer, sizeof (buffer), - sendmail->offset, &len)) == 0 + offset, &len)) == 0 && len != 0) { if (write (sendmail->fd, buffer, len) == -1) @@ -360,6 +361,7 @@ sendmail_send_message (mailer_t mailer, message_t msg, address_t from, break; } + offset += len; sendmail->offset += len; } if (status == EAGAIN) |