From f50ddd9de119590e93f2fe6939b0a364c357783d Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 28 Feb 2001 18:41:27 +0000 Subject: If we get back 0 bytes from camel_stream_buffer_gets, that means the * camel-remote-store.c (remote_recv_line): If we get back 0 bytes from camel_stream_buffer_gets, that means the socket got disconnected, so set an exception. (Noticed because of a message that crashes our IMAP server when you try to look at it. :) svn path=/trunk/; revision=8429 --- camel/ChangeLog | 7 +++++++ camel/camel-remote-store.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/camel/ChangeLog b/camel/ChangeLog index e370e7bbc3..444d3b8ea3 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2001-02-28 Dan Winship + + * camel-remote-store.c (remote_recv_line): If we get back 0 bytes + from camel_stream_buffer_gets, that means the socket got + disconnected, so set an exception. (Noticed because of a message + that crashes our IMAP server when you try to look at it. :) + 2001-02-28 Jeffrey Stedfast * Makefile.am: Added camel-sasl*.[c,h] to the build. diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 52f1908f05..41e16a27fc 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -538,6 +538,11 @@ remote_recv_line (CamelRemoteStore *store, char **dest, CamelException *ex) camel_exception_set(ex, CAMEL_EXCEPTION_USER_CANCEL, _("Operation cancelled")); else camel_exception_set(ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE, strerror(errno)); + } else if (bytes->len == 0) { + camel_exception_set(ex, CAMEL_EXCEPTION_SERVICE_NOT_CONNECTED, + _("Server unexpectedly disconnected")); + } + if (camel_exception_is_set (ex)) { g_byte_array_free(bytes, TRUE); camel_service_disconnect (CAMEL_SERVICE (store), FALSE, NULL); return -1; -- cgit v1.2.3