summaryrefslogtreecommitdiff
path: root/src/wispr.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-05-02 16:46:10 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-04 11:10:21 +0300
commitc4abb85bde08d5ed68c9cc608225e95415887d7d (patch)
tree0df7a5ec813437d31019e39cc5bb7d21d7cb4c25 /src/wispr.c
parent815dc93c33a379abf346fbef1640bbf15f23b286 (diff)
downloadconnman-c4abb85bde08d5ed68c9cc608225e95415887d7d.tar.gz
connman-c4abb85bde08d5ed68c9cc608225e95415887d7d.tar.bz2
connman-c4abb85bde08d5ed68c9cc608225e95415887d7d.zip
wispr: Managing the case when user wants to login through the browser himself
Diffstat (limited to 'src/wispr.c')
-rw-r--r--src/wispr.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/wispr.c b/src/wispr.c
index 7a99034c..53e33e3e 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -520,6 +520,27 @@ static gboolean wispr_input(const guint8 **data, gsize *length,
return FALSE;
}
+static void wispr_portal_browser_reply_cb(struct connman_service *service,
+ connman_bool_t authentication_done,
+ const char *error, void *user_data)
+{
+ struct connman_wispr_portal_context *wp_context = user_data;
+
+ DBG("");
+
+ if (service == NULL || wp_context == NULL)
+ return;
+
+ if (authentication_done == FALSE) {
+ wispr_portal_error(wp_context);
+ free_wispr_routes(wp_context);
+ return;
+ }
+
+ /* Restarting the test */
+ __connman_wispr_start(service, wp_context->type);
+}
+
static void wispr_portal_request_wispr_login(struct connman_service *service,
connman_bool_t success,
const char *ssid, int ssid_len,
@@ -531,6 +552,14 @@ static void wispr_portal_request_wispr_login(struct connman_service *service,
DBG("");
+ if (error != NULL && g_strcmp0(error,
+ "net.connman.Agent.Error.LaunchBrowser") == 0) {
+ __connman_agent_request_browser(service,
+ wispr_portal_browser_reply_cb,
+ wp_context->redirect_url, wp_context);
+ return;
+ }
+
g_free(wp_context->wispr_username);
wp_context->wispr_username = g_strdup(username);
@@ -613,27 +642,6 @@ static gboolean wispr_manage_message(GWebResult *result,
return FALSE;
}
-static void wispr_portal_browser_reply_cb(struct connman_service *service,
- connman_bool_t authentication_done,
- const char *error, void *user_data)
-{
- struct connman_wispr_portal_context *wp_context = user_data;
-
- DBG("");
-
- if (service == NULL || wp_context == NULL)
- return;
-
- if (authentication_done == FALSE) {
- wispr_portal_error(wp_context);
- free_wispr_routes(wp_context);
- return;
- }
-
- /* Restarting the test */
- __connman_wispr_start(service, wp_context->type);
-}
-
static gboolean wispr_portal_web_result(GWebResult *result, gpointer user_data)
{
struct connman_wispr_portal_context *wp_context = user_data;