From 5120d7098b94b95a75993be8faa3377507a50b45 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 27 Sep 2001 14:39:39 +0000 Subject: Change "gboolean connected" to "CamelServiceConnectionStatus status", * camel-service.c: Change "gboolean connected" to "CamelServiceConnectionStatus status", which can be disconnected, connecting, connected, or disconnecting. (camel_service_init, camel_service_finalize): create/destroy the connect_op_lock. Refer to service->status rather than service->connected. (camel_service_connect): When connecting, note the current operation (and create a new one if there's none registered) and mark the connection "connecting" until we succeed or fail. (camel_service_disconnect): Likewise in reverse. (camel_service_cancel_connect): New function to cancel a connection attempt. (cancel_connect): Default implementation: Call camel_operation_cancel on the connect_op. * camel-disco-store.c (disco_connect): Only call CamelRemoteStore's connect func if we're online. (disco_cancel_connect): Fall back to offline if a connection gets cancelled. (disco_get_folder_info): Kludge: call connect explicitly before deciding whether to do the online or offline version, so if the connect fails, we fall back correctly. * camel-session.c (camel_session_get_service_connected): s/svc->connected/svc->status/ * camel-remote-store.c (camel_remote_store_finalise): Change service->connected check to service->status check. (remote_connect): Don't set service->connected here: camel_service_connect() itself does that. * camel-operation.c (camel_operation_registered): Deal with the possibility that there's no registered op. svn path=/trunk/; revision=13191 --- camel/camel-remote-store.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'camel/camel-remote-store.c') diff --git a/camel/camel-remote-store.c b/camel/camel-remote-store.c index 00f8dce4f4..e1818e47c0 100644 --- a/camel/camel-remote-store.c +++ b/camel/camel-remote-store.c @@ -129,7 +129,7 @@ camel_remote_store_finalise (CamelObject *object) CamelRemoteStore *remote_store = CAMEL_REMOTE_STORE (object); CamelService *service = CAMEL_SERVICE (object); - if (service->connected) { + if (service->status == CAMEL_SERVICE_CONNECTED) { CamelException ex; camel_exception_init (&ex); @@ -277,9 +277,6 @@ remote_connect (CamelService *service, CamelException *ex) store->ostream = tcp_stream; store->istream = camel_stream_buffer_new (tcp_stream, CAMEL_STREAM_BUFFER_READ); - /* Okay, good enough for us */ - CAMEL_SERVICE (store)->connected = TRUE; - /* Add a timeout so that we can hopefully prevent getting disconnected */ /* (Only if the implementation supports it) */ if (CRSC (store)->keepalive) { -- cgit