if (wp_context->request_id == 0)
wispr_portal_error(wp_context);
- else
- wispr_portal_context_ref(wp_context);
}
static gboolean wispr_input(const guint8 **data, gsize *length,
g_free(wp_context->wispr_password);
wp_context->wispr_password = g_strdup(password);
- wispr_portal_context_ref(wp_context);
-
wp_context->request_id = g_web_request_post(wp_context->web,
wp_context->wispr_msg.login_url,
"application/x-www-form-urlencoded",
wispr_input, wispr_portal_web_result,
wp_context);
- if (wp_context->request_id == 0)
- wispr_portal_context_unref(wp_context);
connman_wispr_message_init(&wp_context->wispr_msg);
}
DBG("");
- wp_context = wispr_portal_context_unref(wp_context);
- if (wp_context == NULL)
- return FALSE;
-
- if (wp_context->request_id == 0)
- return FALSE;
-
if (wp_context->wispr_result != CONNMAN_WISPR_RESULT_ONLINE) {
g_web_result_get_chunk(result, &chunk, &length);
if (length > 0) {
- wispr_portal_context_ref(wp_context);
-
g_web_parser_feed_data(wp_context->wispr_parser,
chunk, length);
return TRUE;
break;
if (g_web_result_get_header(result, "X-ConnMan-Status",
- &str) == TRUE)
+ &str) == TRUE) {
portal_manage_status(result, wp_context);
+ wispr_portal_context_unref(wp_context);
+ return FALSE;
+ }
else {
wispr_portal_context_ref(wp_context);
wp_context->request_id = g_web_request_get(wp_context->web,
redirect, wispr_portal_web_result,
wispr_route_request, wp_context);
- if (wp_context->request_id != 0)
- wispr_portal_context_ref(wp_context);
goto done;
case 400:
case 404:
if (__connman_service_online_check_failed(wp_context->service,
- wp_context->type) == 0)
+ wp_context->type) == 0) {
wispr_portal_error(wp_context);
+ wispr_portal_context_unref(wp_context);
+ return FALSE;
+ }
break;
default:
DBG("proxy %s", proxy);
- wp_context = wispr_portal_context_unref(wp_context);
if (wp_context == NULL)
return;
if (wp_context->token == 0) {
err = -EINVAL;
- goto done;
+ wispr_portal_context_unref(wp_context);
}
} else {
g_timeout_add_seconds(0, no_proxy_callback, wp_context);
}
- wispr_portal_context_ref(wp_context);
done:
g_strfreev(nameservers);