wispr: Setting the relevant service property when a login is required
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mon, 3 Oct 2011 07:43:23 +0000 (10:43 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 5 Oct 2011 09:40:10 +0000 (11:40 +0200)
When a wispr redirect occurs we set login required to the service

Fixes BMC#23424

src/wispr.c

index 8a9e8eb..1f470f7 100644 (file)
@@ -482,9 +482,11 @@ static gboolean wispr_manage_message(GWebResult *result,
 
                wp_context->wispr_result = CONNMAN_WISPR_RESULT_LOGIN;
 
-               __connman_agent_request_login_input(wp_context->service,
+               if (__connman_agent_request_login_input(wp_context->service,
                                        wispr_portal_request_wispr_login,
-                                       wp_context);
+                                       wp_context) != -EIO)
+                       wispr_portal_error(wp_context);
+
                break;
        case 120: /* Falling down */
        case 140:
@@ -568,6 +570,8 @@ static gboolean wispr_portal_web_result(GWebResult *result, gpointer user_data)
 
                DBG("Redirect URL: %s", redirect);
 
+               __connman_service_request_login(wp_context->service);
+
                wp_context->request_id = g_web_request_get(wp_context->web,
                                redirect, wispr_portal_web_result, wp_context);