bearer: set state as DISCONNECTING as soon as we cancel the connection sequence

Just when we request to cancel the connection we need to set the bearer as
being disconnected, so that we do not end up overwriting connection cancellation
requests.

Reported by: Thieu Le <thieule@chromium.org>
This commit is contained in:
Aleksander Morgado
2012-07-31 09:16:07 +02:00
parent 737b6c2fc5
commit 0ff904b3c5

View File

@@ -466,6 +466,9 @@ mm_bearer_disconnect (MMBearer *self,
/* If currently connecting, try to cancel that operation, and wait to get /* If currently connecting, try to cancel that operation, and wait to get
* disconnected. */ * disconnected. */
if (self->priv->status == MM_BEARER_STATUS_CONNECTING) { if (self->priv->status == MM_BEARER_STATUS_CONNECTING) {
/* Set ourselves as disconnecting */
bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTING);
/* We MUST ensure that we get to DISCONNECTED */ /* We MUST ensure that we get to DISCONNECTED */
g_cancellable_cancel (self->priv->connect_cancellable); g_cancellable_cancel (self->priv->connect_cancellable);
/* Note that we only allow to remove disconnected bearers, so should /* Note that we only allow to remove disconnected bearers, so should