aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-11-01 07:44:46 +0800
committerDan Winship <danw@src.gnome.org>2000-11-01 07:44:46 +0800
commit517db3b21fece8d8616620ff299689699b62b277 (patch)
tree0417ff14f0fa20967aba0580e48d8668050ad07b /camel/providers/imap
parent1d60c5cc024dd69b2f0d776bd0f48d1af7fef08b (diff)
downloadgsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.tar.gz
gsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.tar.zst
gsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.zip
Add a new argument, clean, that says whether or not to try to disconnect
* camel-service.c (service_disconnect): Add a new argument, clean, that says whether or not to try to disconnect cleanly. * camel-remote-store.c (remote_send_string, remote_send_stream, remote_recv_line): disconnect uncleanly on failure to prevent infinite loops when providers would normally send commands from disconnect(). Remove some unneeded CamelException goo. * providers/smtp/camel-smtp-transport.c (smtp_disconnect): * providers/pop3/camel-pop3-store.c (pop3_disconnect): * providers/nntp/camel-nntp-store.c (nntp_store_disconnect): * providers/imap/camel-imap-store.c (imap_disconnect): Don't send QUIT/LOGOUT if !clean. svn path=/trunk/; revision=6303
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-store.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 749785b724..8d53f7579c 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -55,7 +55,7 @@
static CamelRemoteStoreClass *remote_store_class = NULL;
static gboolean imap_connect (CamelService *service, CamelException *ex);
-static gboolean imap_disconnect (CamelService *service, CamelException *ex);
+static gboolean imap_disconnect (CamelService *service, gboolean clean, CamelException *ex);
static GList *query_auth_types_generic (CamelService *service, CamelException *ex);
static GList *query_auth_types_connected (CamelService *service, CamelException *ex);
static CamelFolder *get_folder (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
@@ -303,13 +303,13 @@ imap_connect (CamelService *service, CamelException *ex)
"authentication type %s",
service->url->host,
service->url->authmech);
- camel_service_disconnect (service, NULL);
+ camel_service_disconnect (service, TRUE, NULL);
return FALSE;
}
authenticated = imap_try_kerberos_v4_auth (store, ex);
if (camel_exception_is_set (ex)) {
- camel_service_disconnect (service, NULL);
+ camel_service_disconnect (service, TRUE, NULL);
return FALSE;
}
}
@@ -344,7 +344,7 @@ imap_connect (CamelService *service, CamelException *ex)
if (!service->url->passwd) {
camel_exception_set (ex, CAMEL_EXCEPTION_USER_CANCEL,
"You didn\'t enter a password.");
- camel_service_disconnect (service, NULL);
+ camel_service_disconnect (service, TRUE, NULL);
return FALSE;
}
}
@@ -422,12 +422,12 @@ imap_connect (CamelService *service, CamelException *ex)
}
static gboolean
-imap_disconnect (CamelService *service, CamelException *ex)
+imap_disconnect (CamelService *service, gboolean clean, CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (service);
CamelImapResponse *response;
- if (store->connected) {
+ if (store->connected && clean) {
/* send the logout command */
response = camel_imap_command (store, NULL, ex, "LOGOUT");
camel_imap_response_free (response);
@@ -435,7 +435,7 @@ imap_disconnect (CamelService *service, CamelException *ex)
store->current_folder = NULL;
- return CAMEL_SERVICE_CLASS (remote_store_class)->disconnect (service, ex);
+ return CAMEL_SERVICE_CLASS (remote_store_class)->disconnect (service, clean, ex);
}
static gboolean