const char *status_url;
+ char *redirect_url;
+
/* WISPr specific */
GWebParser *wispr_parser;
struct connman_wispr_message wispr_msg;
g_web_unref(wp_context->web);
+ g_free(wp_context->redirect_url);
+
g_web_parser_unref(wp_context->wispr_parser);
connman_wispr_message_init(&wp_context->wispr_msg);
if (g_web_result_get_header(result, "X-ConnMan-Status",
&str) == TRUE)
portal_manage_status(result, wp_context);
+ else
+ __connman_agent_request_browser(wp_context->service,
+ NULL, wp_context->redirect_url, wp_context);
break;
case 302:
if (g_web_result_get_header(result, "Location",
- &redirect) == FALSE)
+ &redirect) == FALSE) {
+ __connman_agent_request_browser(wp_context->service,
+ NULL, wp_context->status_url, wp_context);
break;
+ }
DBG("Redirect URL: %s", redirect);
+ wp_context->redirect_url = g_strdup(redirect);
+
wp_context->request_id = g_web_request_get(wp_context->web,
redirect, wispr_portal_web_result, wp_context);