This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Mailutils".
http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=64b00582e8b3b08cbf1b6e530583b1757a8bdf77 The branch, master has been updated via 64b00582e8b3b08cbf1b6e530583b1757a8bdf77 (commit) from 439f8c1a9f99409087694f95c82f40c12e286371 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 64b00582e8b3b08cbf1b6e530583b1757a8bdf77 Author: Sergey Poznyakoff <g...@gnu.org.ua> Date: Tue Nov 9 23:54:56 2010 +0200 filter subsystem: bugfixes. * include/mailutils/sys/filter.h (_mu_filter_stream)<eof>: New member. * libmailutils/filter/binflt.c (_bit8_filter): Change name initializer to "8bit". (_bit7_filter): Change name initializer to "7bit". * libmailutils/filter/filter.c (mu_filter_create): Limit line length for encoding streams only. * libmailutils/stream/fltstream.c (filter_read): Use fs->eof instead of the regular stream EOF marker. * libmailutils/stream/stream.c (mu_stream_eof): Bugfix: take into account eventual buffered data. (_stream_read_unbuffered): Call mu_stream_eof instead of checking the _MU_STR_EOF bit. ----------------------------------------------------------------------- Summary of changes: include/mailutils/sys/filter.h | 1 + libmailutils/filter/binflt.c | 4 ++-- libmailutils/filter/filter.c | 2 +- libmailutils/stream/fltstream.c | 9 +++++++-- libmailutils/stream/stream.c | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/mailutils/sys/filter.h b/include/mailutils/sys/filter.h index 5eb91f5..557a207 100644 --- a/include/mailutils/sys/filter.h +++ b/include/mailutils/sys/filter.h @@ -41,6 +41,7 @@ struct _mu_filter_stream struct _mu_stream stream; mu_stream_t transport; int mode; + int eof; struct _mu_filter_buffer inbuf, outbuf; mu_filter_xcode_t xcode; diff --git a/libmailutils/filter/binflt.c b/libmailutils/filter/binflt.c index d3de518..1faf88c 100644 --- a/libmailutils/filter/binflt.c +++ b/libmailutils/filter/binflt.c @@ -93,7 +93,7 @@ mu_filter_record_t mu_binary_filter = &_binary_filter; static struct _mu_filter_record _bit8_filter = { - "bit8", + "8bit", 0, NULL, _copy_codec, @@ -103,7 +103,7 @@ static struct _mu_filter_record _bit8_filter = { mu_filter_record_t mu_bit8_filter = &_bit8_filter; static struct _mu_filter_record _bit7_filter = { - "bit7", + "7bit", 0, NULL, _bit7_coder, diff --git a/libmailutils/filter/filter.c b/libmailutils/filter/filter.c index a98d0a9..6ab3c92 100644 --- a/libmailutils/filter/filter.c +++ b/libmailutils/filter/filter.c @@ -182,7 +182,7 @@ mu_filter_create (mu_stream_t *pstream, mu_stream_t stream, const char *name, status = ((flags & MU_STREAM_WRITE) ? filter_create_wr : filter_create_rd) (pstream, stream, - frec->max_line_length, + mode == MU_FILTER_ENCODE ? frec->max_line_length : 0, mode, mode == MU_FILTER_ENCODE ? frec->encoder : frec->decoder, xdata, diff --git a/libmailutils/stream/fltstream.c b/libmailutils/stream/fltstream.c index f6fe6ad..a830957 100644 --- a/libmailutils/stream/fltstream.c +++ b/libmailutils/stream/fltstream.c @@ -127,6 +127,9 @@ filter_read (mu_stream_t stream, char *buf, size_t size, size_t *pret) { enum mu_filter_result res; int rc; + + if (fs->eof) + break; if (MFB_RDBYTES (fs->inbuf) < min_input_level && !again) { @@ -174,7 +177,7 @@ filter_read (mu_stream_t stream, char *buf, size_t size, size_t *pret) again = 0; if (cmd == mu_filter_lastbuf || iobuf.eof) { - _mu_stream_seteof (stream); + fs->eof = 1; stop = 1; } break; @@ -517,8 +520,10 @@ mu_filter_stream_create (mu_stream_t *pflt, fs->xcode = xcode; fs->xdata = xdata; fs->mode = mode; + fs->eof = 0; - mu_stream_set_buffer ((mu_stream_t) fs, mu_buffer_full, MU_FILTER_BUF_SIZE); + mu_stream_set_buffer ((mu_stream_t) fs, mu_buffer_full, + MU_FILTER_BUF_SIZE); rc = filter_stream_init (fs); if (rc) diff --git a/libmailutils/stream/stream.c b/libmailutils/stream/stream.c index 367db90..48ca32b 100644 --- a/libmailutils/stream/stream.c +++ b/libmailutils/stream/stream.c @@ -368,7 +368,7 @@ mu_stream_clearerr (mu_stream_t stream) int mu_stream_eof (mu_stream_t stream) { - return stream->flags & _MU_STR_EOF; + return (stream->flags & _MU_STR_EOF) && (stream->pos == stream->level); } int @@ -589,7 +589,7 @@ _stream_read_unbuffered (mu_stream_t stream, void *buf, size_t size, if (stream->flags & _MU_STR_ERR) return stream->last_err; - if ((stream->flags & _MU_STR_EOF) || size == 0) + if (mu_stream_eof (stream) || size == 0) { if (pnread) *pnread = 0; hooks/post-receive -- GNU Mailutils _______________________________________________ Commit-mailutils mailing list Commit-mailutils@gnu.org http://lists.gnu.org/mailman/listinfo/commit-mailutils