diff options
author | Not Zed <NotZed@Ximian.com> | 2001-02-05 15:15:50 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2001-02-05 15:15:50 +0800 |
commit | 764b9e26b00bf10e474c2684f74c8c9497de30d9 (patch) | |
tree | fd63a1bdf0a6fc0e51da474a47dcf628d9325655 /camel/camel-stream-filter.c | |
parent | f1f97ce865d29370b45ce08380cd56ab24f26a78 (diff) | |
download | gsoc2013-evolution-764b9e26b00bf10e474c2684f74c8c9497de30d9.tar.gz gsoc2013-evolution-764b9e26b00bf10e474c2684f74c8c9497de30d9.tar.zst gsoc2013-evolution-764b9e26b00bf10e474c2684f74c8c9497de30d9.zip |
Revert jeff's earlier change, the change below is the more-correct fix.
2001-02-05 Not Zed <NotZed@Ximian.com>
* camel-stream-filter.c (do_write): Revert jeff's earlier change,
the change below is the more-correct fix. All his was doing was
ignoring the return code & looping actually :)
* camel-stream-fs.c (stream_write): Since we are non-blocking on
the outgoing fd, keep looping if writing out large blocks, so we
can keep checking for cancel, etc.
svn path=/trunk/; revision=7966
Diffstat (limited to 'camel/camel-stream-filter.c')
-rw-r--r-- | camel/camel-stream-filter.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/camel/camel-stream-filter.c b/camel/camel-stream-filter.c index 1189262ddc..866c8d2416 100644 --- a/camel/camel-stream-filter.c +++ b/camel/camel-stream-filter.c @@ -269,7 +269,6 @@ do_write (CamelStream *stream, const char *buf, size_t n) CamelStreamFilter *filter = (CamelStreamFilter *)stream; struct _CamelStreamFilterPrivate *p = _PRIVATE(filter); struct _filter *f; - ssize_t w, written = 0; int presize; char *buffer = (char *)buf; size_t len = n; @@ -292,13 +291,10 @@ do_write (CamelStream *stream, const char *buf, size_t n) f = f->next; } - - do { - w = camel_stream_write (filter->source, buffer + written, len - written); - if (w > 0) - written += w; - } while (written < len); - + + if (camel_stream_write(filter->source, buffer, len) != len) + return -1; + return n; } |