broadband-bearer: ensure we close the port even if we got cancelled
When there is an error in the connection attempt we need to close the dialling port ourselves. In the case where we got an error and we also got cancelled, we need to make sure that the port gets closed.
This commit is contained in:
@@ -501,6 +501,9 @@ extended_error_ready (MMBaseModem *modem,
|
|||||||
{
|
{
|
||||||
const gchar *result;
|
const gchar *result;
|
||||||
|
|
||||||
|
/* Close the dialling port as we got an error */
|
||||||
|
mm_serial_port_close (MM_SERIAL_PORT (ctx->dial_port));
|
||||||
|
|
||||||
/* If cancelled, complete */
|
/* If cancelled, complete */
|
||||||
if (dial_3gpp_context_complete_and_free_if_cancelled (ctx))
|
if (dial_3gpp_context_complete_and_free_if_cancelled (ctx))
|
||||||
return;
|
return;
|
||||||
@@ -520,9 +523,6 @@ extended_error_ready (MMBaseModem *modem,
|
|||||||
|
|
||||||
ctx->saved_error = NULL;
|
ctx->saved_error = NULL;
|
||||||
|
|
||||||
/* Close the dialling port as we got an error */
|
|
||||||
mm_serial_port_close (MM_SERIAL_PORT (ctx->dial_port));
|
|
||||||
|
|
||||||
/* Done with errors */
|
/* Done with errors */
|
||||||
dial_3gpp_context_complete_and_free (ctx);
|
dial_3gpp_context_complete_and_free (ctx);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user