diff options
Diffstat (limited to 'src/wispr.c')
-rw-r--r-- | src/wispr.c | 12 |
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: |