Updated connman to version 1.35
[platform/upstream/connman.git] / src / wispr.c
old mode 100644 (file)
new mode 100755 (executable)
index dcce93c..adf6230
@@ -143,6 +143,7 @@ static void free_wispr_routes(struct connman_wispr_portal_context *wp_context)
                                        route->address);
                        break;
                case CONNMAN_IPCONFIG_TYPE_UNKNOWN:
+               case CONNMAN_IPCONFIG_TYPE_ALL:
                        break;
                }
 
@@ -487,6 +488,7 @@ static bool wispr_route_request(const char *address, int ai_family,
                                gateway);
                break;
        case CONNMAN_IPCONFIG_TYPE_UNKNOWN:
+       case CONNMAN_IPCONFIG_TYPE_ALL:
                break;
        }
 
@@ -711,6 +713,11 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
        DBG("status: %03u", status);
 
        switch (status) {
+       case 000:
+               __connman_agent_request_browser(wp_context->service,
+                               wispr_portal_browser_reply_cb,
+                               wp_context->status_url, wp_context);
+               break;
        case 200:
                if (wp_context->wispr_msg.message_type >= 0)
                        break;
@@ -755,6 +762,11 @@ static bool wispr_portal_web_result(GWebResult *result, gpointer user_data)
                }
 
                break;
+       case 505:
+               __connman_agent_request_browser(wp_context->service,
+                               wispr_portal_browser_reply_cb,
+                               wp_context->status_url, wp_context);
+               break;
        default:
                break;
        }
@@ -820,8 +832,8 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context)
        int err = 0;
        int i;
 
-       DBG("wispr/portal context %p", wp_context);
-       DBG("service %p", wp_context->service);
+       DBG("wispr/portal context %p service %p", wp_context,
+               wp_context->service);
 
        service_type = connman_service_get_type(wp_context->service);
 
@@ -867,7 +879,9 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context)
                goto done;
        }
 
+#if !defined TIZEN_EXT
        if (getenv("CONNMAN_WEB_DEBUG"))
+#endif
                g_web_set_debug(wp_context->web, web_debug, "WEB");
 
        if (wp_context->type == CONNMAN_IPCONFIG_TYPE_IPV4) {
@@ -894,8 +908,7 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context)
                        free_connman_wispr_portal_context(wp_context);
                }
        } else if (wp_context->timeout == 0) {
-               wp_context->timeout =
-                       g_timeout_add_seconds(0, no_proxy_callback, wp_context);
+               wp_context->timeout = g_idle_add(no_proxy_callback, wp_context);
        }
 
 done:
@@ -914,6 +927,11 @@ int __connman_wispr_start(struct connman_service *service,
 
        DBG("service %p", service);
 
+#if defined TIZEN_EXT
+       if (connman_service_get_type(service) == CONNMAN_SERVICE_TYPE_CELLULAR)
+               return -EPERM;
+#endif
+
        if (!wispr_portal_list)
                return -EINVAL;