aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-service.c
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/camel-service.c
parent1d60c5cc024dd69b2f0d776bd0f48d1af7fef08b (diff)
downloadgsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.tar
gsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.tar.gz
gsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.tar.bz2
gsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.tar.lz
gsoc2013-evolution-517db3b21fece8d8616620ff299689699b62b277.tar.xz
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/camel-service.c')
-rw-r--r--camel/camel-service.c39
1 files changed, 10 insertions, 29 deletions
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 14d086653b..5eb78dcaa6 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -37,7 +37,8 @@ static CamelObjectClass *parent_class = NULL;
#define CSERV_CLASS(so) CAMEL_SERVICE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
static gboolean service_connect(CamelService *service, CamelException *ex);
-static gboolean service_disconnect(CamelService *service, CamelException *ex);
+static gboolean service_disconnect(CamelService *service, gboolean clean,
+ CamelException *ex);
/*static gboolean is_connected (CamelService *service);*/
static GList * query_auth_types_func (CamelService *service, CamelException *ex);
static void free_auth_types (CamelService *service, GList *authtypes);
@@ -72,7 +73,7 @@ camel_service_finalize (CamelObject *object)
/*g_warning ("camel_service_finalize: finalizing while still connected!");*/
camel_exception_init (&ex);
- CSERV_CLASS (camel_service)->disconnect (camel_service, &ex);
+ CSERV_CLASS (camel_service)->disconnect (camel_service, FALSE, &ex);
if (camel_exception_is_set (&ex)) {
g_warning ("camel_service_finalize: silent disconnect failure: %s",
camel_exception_get_description(&ex));
@@ -240,7 +241,7 @@ camel_service_connect (CamelService *service, CamelException *ex)
}
static gboolean
-service_disconnect (CamelService *service, CamelException *ex)
+service_disconnect (CamelService *service, gboolean clean, CamelException *ex)
{
/*service->connect_level--;*/
@@ -254,48 +255,28 @@ service_disconnect (CamelService *service, CamelException *ex)
/**
* camel_service_disconnect:
* @service: CamelService object
+ * @clean: whether or not to try to disconnect cleanly.
* @ex: a CamelException
*
- * Disconnect from the service.
+ * Disconnect from the service. If @clean is %FALSE, it should not
+ * try to do any synchronizing or other cleanup of the connection.
*
* Return value: whether or not the disconnection succeeded without
* errors. (Consult @ex if %FALSE.)
**/
-
gboolean
-camel_service_disconnect (CamelService *service, CamelException *ex)
+camel_service_disconnect (CamelService *service, gboolean clean,
+ CamelException *ex)
{
gboolean res;
g_return_val_if_fail (service->connected, FALSE);
- res = CSERV_CLASS (service)->disconnect (service, ex);
+ res = CSERV_CLASS (service)->disconnect (service, clean, ex);
service->connected = FALSE;
return res;
}
/**
- *static gboolean
- *is_connected (CamelService *service)
- *{
- * return (service->connect_level > 0);
- *}
- **/
-
-/**
- * camel_service_is_connected:
- * @service: object to test
- *
- * Return value: whether or not the service is connected
- **/
-/**
- *gboolean
- *camel_service_is_connected (CamelService *service)
- *{
- * return CSERV_CLASS (service)->is_connected (service);
- *}
- **/
-
-/**
* camel_service_get_url:
* @service: a service
*