Merge request !1389 from 'fix/set-supl-server'
shared-qmi: fix setting URL to supl server https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1389
This commit is contained in:
+18
-4
@@ -4525,13 +4525,20 @@ pds_set_supl_server (GTask *task)
|
||||
MMSharedQmi *self;
|
||||
SetSuplServerContext *ctx;
|
||||
QmiMessagePdsSetAgpsConfigInput *input;
|
||||
guint32 ip;
|
||||
guint32 ip = 0;
|
||||
guint16 port;
|
||||
GArray *url;
|
||||
GError *error = NULL;
|
||||
|
||||
self = g_task_get_source_object (task);
|
||||
ctx = g_task_get_task_data (task);
|
||||
|
||||
if (!mm_parse_supl_address (ctx->supl, NULL, &ip, &port, &error)) {
|
||||
g_task_return_error (task, error);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
input = qmi_message_pds_set_agps_config_input_new ();
|
||||
|
||||
/* For multimode devices, prefer UMTS by default */
|
||||
@@ -4540,7 +4547,7 @@ pds_set_supl_server (GTask *task)
|
||||
else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self)))
|
||||
qmi_message_pds_set_agps_config_input_set_network_mode (input, QMI_PDS_NETWORK_MODE_CDMA, NULL);
|
||||
|
||||
if (mm_parse_supl_address (ctx->supl, NULL, &ip, &port, NULL))
|
||||
if (ip)
|
||||
qmi_message_pds_set_agps_config_input_set_location_server_address (input, GUINT32_FROM_BE (ip), port, NULL);
|
||||
else {
|
||||
url = parse_as_utf16_url (ctx->supl);
|
||||
@@ -4640,12 +4647,19 @@ loc_set_supl_server (GTask *task)
|
||||
MMSharedQmi *self;
|
||||
SetSuplServerContext *ctx;
|
||||
QmiMessageLocSetServerInput *input;
|
||||
guint32 ip;
|
||||
guint32 ip = 0;
|
||||
guint16 port;
|
||||
GError *error = NULL;
|
||||
|
||||
self = g_task_get_source_object (task);
|
||||
ctx = g_task_get_task_data (task);
|
||||
|
||||
if (!mm_parse_supl_address (ctx->supl, NULL, &ip, &port, &error)) {
|
||||
g_task_return_error (task, error);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
input = qmi_message_loc_set_server_input_new ();
|
||||
|
||||
/* For multimode devices, prefer UMTS by default */
|
||||
@@ -4654,7 +4668,7 @@ loc_set_supl_server (GTask *task)
|
||||
else if (mm_iface_modem_is_cdma (MM_IFACE_MODEM (self)))
|
||||
qmi_message_loc_set_server_input_set_server_type (input, QMI_LOC_SERVER_TYPE_CDMA_PDE, NULL);
|
||||
|
||||
if (mm_parse_supl_address (ctx->supl, NULL, &ip, &port, NULL))
|
||||
if (ip)
|
||||
qmi_message_loc_set_server_input_set_ipv4 (input, GUINT32_FROM_BE (ip), (guint32) port, NULL);
|
||||
else
|
||||
qmi_message_loc_set_server_input_set_url (input, ctx->supl, NULL);
|
||||
|
||||
Reference in New Issue
Block a user