summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-03-24 15:03:08 +0100
committerAleksander Morgado <aleksander@aleksander.es>2017-03-24 21:43:21 +0100
commitd1bb389849b661553c52984d734a3cb49a19ef50 (patch)
tree40a5245a1ad175d09648f5b4624b9e84c2c5ffc3
parentdc4c555173b2e52053af0200618d0e418e988320 (diff)
downloadModemManager-d1bb389849b661553c52984d734a3cb49a19ef50.tar.gz
broadband-bearer: set TTY as connected as soon as ATD replies
When the connection request is done via ATD, flag the port as connected as soon as the successful response is received, so that we remove our polling on the device right away. https://bugs.freedesktop.org/show_bug.cgi?id=99541 (cherry picked from commit dd1e281e82726bcf3349a776da53c4158b088724)
-rw-r--r--src/mm-broadband-bearer.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c
index d8c8c884c..aeff2ef46 100644
--- a/src/mm-broadband-bearer.c
+++ b/src/mm-broadband-bearer.c
@@ -246,7 +246,10 @@ dial_cdma_ready (MMBaseModem *modem,
return;
}
- /* else... Yuhu! */
+ /* The ATD command has succeeded, and therefore the TTY is in data mode now.
+ * Instead of waiting for setting the port as connected later in
+ * connect_succeeded(), we do it right away so that we stop our polling. */
+ mm_port_set_connected (ctx->data, TRUE);
/* Keep port open during connection */
ctx->close_data_on_exit = FALSE;
@@ -565,6 +568,11 @@ atd_ready (MMBaseModem *modem,
return;
}
+ /* The ATD command has succeeded, and therefore the TTY is in data mode now.
+ * Instead of waiting for setting the port as connected later in
+ * connect_succeeded(), we do it right away so that we stop our polling. */
+ mm_port_set_connected (MM_PORT (ctx->dial_port), TRUE);
+
g_simple_async_result_set_op_res_gpointer (ctx->result,
g_object_ref (ctx->dial_port),
(GDestroyNotify)g_object_unref);
@@ -1089,7 +1097,8 @@ connect_succeeded (ConnectContext *ctx,
ctx->self->priv->port = g_object_ref (mm_bearer_connect_result_peek_data (result));
ctx->self->priv->connection_type = connection_type;
- /* Port is connected; update the state */
+ /* Port is connected; update the state. For ATD based connections, the port
+ * may already be set as connected, but no big deal. */
mm_port_set_connected (ctx->self->priv->port, TRUE);
/* Set operation result */