diff options
author | Dan Winship <danw@src.gnome.org> | 2001-09-27 22:39:39 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-09-27 22:39:39 +0800 |
commit | 5120d7098b94b95a75993be8faa3377507a50b45 (patch) | |
tree | c3f8f8a9e1e8049feb869b2084db6d032133b2c6 /camel/camel-operation.c | |
parent | f967421b532778246b6b68226c9eb42ad1eaa5d1 (diff) | |
download | gsoc2013-evolution-5120d7098b94b95a75993be8faa3377507a50b45.tar gsoc2013-evolution-5120d7098b94b95a75993be8faa3377507a50b45.tar.gz gsoc2013-evolution-5120d7098b94b95a75993be8faa3377507a50b45.tar.bz2 gsoc2013-evolution-5120d7098b94b95a75993be8faa3377507a50b45.tar.lz gsoc2013-evolution-5120d7098b94b95a75993be8faa3377507a50b45.tar.xz gsoc2013-evolution-5120d7098b94b95a75993be8faa3377507a50b45.tar.zst gsoc2013-evolution-5120d7098b94b95a75993be8faa3377507a50b45.zip |
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
Diffstat (limited to 'camel/camel-operation.c')
-rw-r--r-- | camel/camel-operation.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/camel/camel-operation.c b/camel/camel-operation.c index 42aa448820..95d8fa0f91 100644 --- a/camel/camel-operation.c +++ b/camel/camel-operation.c @@ -105,10 +105,13 @@ CamelOperation *camel_operation_registered(void) CamelOperation *cc = NULL; CAMEL_ACTIVE_LOCK(); - if (operation_active != NULL) + if (operation_active != NULL) { cc = g_hash_table_lookup(operation_active, (void *)pthread_self()); - g_assert(cc->refcount > 0); - cc->refcount++; + if (cc) { + g_assert(cc->refcount > 0); + cc->refcount++; + } + } CAMEL_ACTIVE_UNLOCK(); return cc; |