broadband-bearer: handle NULL and character escaping of APN value

This commit is contained in:
Ben Chan
2013-04-04 12:40:10 -07:00
committed by Aleksander Morgado
parent 5554658cd2
commit 76ecc1301a

View File

@@ -753,7 +753,7 @@ find_cid_ready (MMBaseModem *modem,
DetailedConnectContext *ctx) DetailedConnectContext *ctx)
{ {
GVariant *result; GVariant *result;
gchar *command; gchar *apn, *command;
GError *error = NULL; GError *error = NULL;
const gchar *pdp_type; const gchar *pdp_type;
@@ -783,10 +783,12 @@ find_cid_ready (MMBaseModem *modem,
} }
ctx->cid = g_variant_get_uint32 (result); ctx->cid = g_variant_get_uint32 (result);
command = g_strdup_printf ("+CGDCONT=%u,\"%s\",\"%s\"", apn = mm_at_serial_port_quote_string (mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self))));
command = g_strdup_printf ("+CGDCONT=%u,\"%s\",%s",
ctx->cid, ctx->cid,
pdp_type, pdp_type,
mm_bearer_properties_get_apn (mm_bearer_peek_config (MM_BEARER (ctx->self)))); apn);
g_free (apn);
mm_base_modem_at_command_full (ctx->modem, mm_base_modem_at_command_full (ctx->modem,
ctx->primary, ctx->primary,
command, command,