From 9b0ffde9c0478e5f175ca085318db8ea68d32fe7 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 19 Nov 2001 21:00:25 +0000 Subject: Added a check to see if the operation has been cancelled. (stream_write): 2001-11-19 Jeffrey Stedfast * camel-tcp-stream-ssl.c (stream_read): Added a check to see if the operation has been cancelled. (stream_write): Same. svn path=/trunk/; revision=14751 --- camel/ChangeLog | 6 ++++++ camel/camel-tcp-stream-ssl.c | 10 ++++++++++ 2 files changed, 16 insertions(+) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 631a303eb0..eaf1edd0c1 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2001-11-19 Jeffrey Stedfast + + * camel-tcp-stream-ssl.c (stream_read): Added a check to see if + the operation has been cancelled. + (stream_write): Same. + 2001-11-19 Jeffrey Stedfast Updates for compliance with rfc2231 diff --git a/camel/camel-tcp-stream-ssl.c b/camel/camel-tcp-stream-ssl.c index 167d94b8b7..46a8dfa6e3 100644 --- a/camel/camel-tcp-stream-ssl.c +++ b/camel/camel-tcp-stream-ssl.c @@ -183,6 +183,11 @@ stream_read (CamelStream *stream, char *buffer, size_t n) ssize_t nread; do { + if (camel_operation_cancel_check (NULL)) { + errno = EINTR; + return -1; + } + nread = PR_Read (tcp_stream_ssl->priv->sockfd, buffer, n); if (nread == -1) set_errno (PR_GetError ()); @@ -198,6 +203,11 @@ stream_write (CamelStream *stream, const char *buffer, size_t n) ssize_t w, written = 0; do { + if (camel_operation_cancel_check (NULL)) { + errno = EINTR; + return -1; + } + do { w = PR_Write (tcp_stream_ssl->priv->sockfd, buffer + written, n - written); if (w == -1) -- cgit v1.2.3