summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-16 13:56:32 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-16 14:46:08 +0300
commit1b0448697474a2d0f78a083e606083478c0f1d69 (patch)
treebbc00d15f152b13f30d9c3f5c0ab0dc0b50b78df /src
parent4e637dcb37540463bc57b9e7ab33fcd011b91728 (diff)
downloadconnman-1b0448697474a2d0f78a083e606083478c0f1d69.tar.gz
connman-1b0448697474a2d0f78a083e606083478c0f1d69.tar.bz2
connman-1b0448697474a2d0f78a083e606083478c0f1d69.zip
wispr: Keep track of proxy callback timeout
Keep track of the zero-second no proxy callback timeout and remove it when freeing up the WISPr context.
Diffstat (limited to 'src')
-rw-r--r--src/wispr.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wispr.c b/src/wispr.c
index 7ee51886..342f9740 100644
--- a/src/wispr.c
+++ b/src/wispr.c
@@ -83,6 +83,8 @@ struct connman_wispr_portal_context {
enum connman_wispr_result wispr_result;
GSList *route_list;
+
+ guint timeout;
};
struct connman_wispr_portal {
@@ -174,6 +176,9 @@ static void free_connman_wispr_portal_context(struct connman_wispr_portal_contex
if (wp_context->request_id > 0)
g_web_cancel_request(wp_context->web, wp_context->request_id);
+ if (wp_context->timeout > 0)
+ g_source_remove(wp_context->timeout);
+
if (wp_context->web != NULL)
g_web_unref(wp_context->web);
@@ -787,6 +792,8 @@ static gboolean no_proxy_callback(gpointer user_data)
{
struct connman_wispr_portal_context *wp_context = user_data;
+ wp_context->timeout = 0;
+
proxy_callback("DIRECT", wp_context);
return FALSE;
@@ -875,8 +882,9 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context)
err = -EINVAL;
free_connman_wispr_portal_context(wp_context);
}
- } else {
- g_timeout_add_seconds(0, no_proxy_callback, wp_context);
+ } else if (wp_context->timeout == 0) {
+ wp_context->timeout =
+ g_timeout_add_seconds(0, no_proxy_callback, wp_context);
}
done: