base-bearer: fix check for cancellation

If we cancel connect_cancellable, the connect task will return a
G_IO_ERROR_CANCELLED. We may need to do some cleanup (like, disconnect
if the connection went far enough to actually start the network
connection), thus it's important we check for cancellation correctly.
This commit is contained in:
Lubomir Rintel
2019-05-03 18:45:22 +02:00
committed by Aleksander Morgado
parent aaea6c77f2
commit eaaf64ffce

View File

@@ -709,9 +709,8 @@ connect_ready (MMBaseBearer *self,
mm_dbg ("Couldn't connect bearer '%s': '%s'", mm_dbg ("Couldn't connect bearer '%s': '%s'",
self->priv->path, self->priv->path,
error->message); error->message);
if (g_error_matches (error, if ( g_error_matches (error, MM_CORE_ERROR, MM_CORE_ERROR_CANCELLED)
MM_CORE_ERROR, || g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
MM_CORE_ERROR_CANCELLED)) {
/* Will launch disconnection */ /* Will launch disconnection */
launch_disconnect = TRUE; launch_disconnect = TRUE;
} else } else