diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-02-14 12:05:45 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-02-14 14:55:55 +0100 |
commit | c031212f6d2a50e0d8a85fa88fce559be9e62233 (patch) | |
tree | b08997b1c890dc9468e53893656198bcb051fb10 /src/wispr.c | |
parent | 26be4f3e78aea1bb6df7f77bcdb429a7e2b0329b (diff) | |
download | connman-c031212f6d2a50e0d8a85fa88fce559be9e62233.tar.gz connman-c031212f6d2a50e0d8a85fa88fce559be9e62233.tar.bz2 connman-c031212f6d2a50e0d8a85fa88fce559be9e62233.zip |
wispr: Provide a callback for agent browser request to handle the result
Diffstat (limited to 'src/wispr.c')
-rw-r--r-- | src/wispr.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/wispr.c b/src/wispr.c index 9c0ed438..fd674dc9 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -524,6 +524,24 @@ 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, + void *user_data) +{ + struct connman_wispr_portal_context *wp_context = user_data; + + if (service == NULL || wp_context == NULL) + return; + + if (authentication_done == FALSE) { + wispr_portal_error(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; @@ -569,14 +587,16 @@ static gboolean wispr_portal_web_result(GWebResult *result, gpointer user_data) portal_manage_status(result, wp_context); else __connman_agent_request_browser(wp_context->service, - NULL, wp_context->redirect_url, wp_context); + wispr_portal_browser_reply_cb, + wp_context->redirect_url, wp_context); break; case 302: if (g_web_result_get_header(result, "Location", &redirect) == FALSE) { __connman_agent_request_browser(wp_context->service, - NULL, wp_context->status_url, wp_context); + wispr_portal_browser_reply_cb, + wp_context->status_url, wp_context); break; } |