aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-stream-fs.c7
-rw-r--r--camel/camel-tcp-stream-raw.c9
3 files changed, 19 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index aac9cb55d7..47c12348fc 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,10 @@
+2001-10-17 Not Zed <NotZed@Ximian.com>
+
+ * camel-tcp-stream-raw.c (stream_write): As below.
+
+ * camel-stream-fs.c (stream_write): If not checking cancellation,
+ make sure we write out everything asked of us.
+
2001-10-16 Jeffrey Stedfast <fejj@ximian.com>
* camel-pgp-context.c (pgp_verify): Rearange the order of the gpg
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index 64e4912785..63c1b2eae0 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -279,10 +279,13 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
cancel_fd = camel_operation_cancel_fd(NULL);
if (cancel_fd == -1) {
do {
- v = write (stream_fs->fd, buffer+written, n-written);
+ do {
+ v = write (stream_fs->fd, buffer+written, n-written);
+ } while (v == -1 && errno == EINTR);
+
if (v > 0)
written += v;
- } while (v == -1 && errno == EINTR);
+ } while (v != -1 && written < n);
} else {
fd_set rdset, wrset;
int error, flags, fdmax;
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index 0aa9c2e1e5..34ba1446c5 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -188,8 +188,13 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
cancel_fd = camel_operation_cancel_fd (NULL);
if (cancel_fd == -1) {
do {
- written = write (tcp_stream_raw->sockfd, buffer, n);
- } while (written == -1 && errno == EINTR);
+ do {
+ w = write (tcp_stream_raw->sockfd, buffer+written, n-written);
+ } while (w == -1 && errno == EINTR);
+
+ if (w > 0)
+ written += w;
+ } while (w != -1 && written < n);
} else {
fd_set rdset, wrset;
int flags, fdmax;