wispr: Adding wispr logic entries in service and wpad
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Mon, 29 Aug 2011 15:25:01 +0000 (18:25 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 12 Sep 2011 17:45:04 +0000 (19:45 +0200)
src/service.c
src/wpad.c

index 195b8e9..841d9a3 100644 (file)
@@ -4018,6 +4018,8 @@ static int service_indicate_state(struct connman_service *service)
 
                default_changed();
 
+               __connman_wispr_stop(service);
+
                __connman_wpad_stop(service);
 
                update_nameservers(service);
@@ -4138,17 +4140,22 @@ static void check_proxy_setup(struct connman_service *service)
         */
 
        if (service->proxy != CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN)
-               return;
+               goto done;
 
        if (service->proxy_config != CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN &&
                (service->proxy_config != CONNMAN_SERVICE_PROXY_METHOD_AUTO ||
                        service->pac != NULL))
-               return;
+               goto done;
 
        if (__connman_wpad_start(service) < 0) {
                service->proxy = CONNMAN_SERVICE_PROXY_METHOD_DIRECT;
                __connman_notifier_proxy_changed(service);
        }
+
+       return;
+
+done:
+       __connman_wispr_start(service, CONNMAN_IPCONFIG_TYPE_IPV4);
 }
 
 int __connman_service_ipconfig_indicate_state(struct connman_service *service,
@@ -4198,6 +4205,8 @@ int __connman_service_ipconfig_indicate_state(struct connman_service *service,
 
                if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
                        check_proxy_setup(service);
+               else
+                       __connman_wispr_start(service, type);
                break;
        case CONNMAN_SERVICE_STATE_ONLINE:
                break;
index 0069c49..931423c 100644 (file)
@@ -85,6 +85,9 @@ static void wpad_result(GResolvResultStatus status,
 
                g_free(url);
 
+               __connman_wispr_start(wpad->service,
+                                       CONNMAN_IPCONFIG_TYPE_IPV4);
+
                return;
        }
 
@@ -113,6 +116,9 @@ static void wpad_result(GResolvResultStatus status,
 failed:
        connman_service_set_proxy_method(wpad->service,
                                CONNMAN_SERVICE_PROXY_METHOD_DIRECT);
+
+       __connman_wispr_start(wpad->service,
+                                       CONNMAN_IPCONFIG_TYPE_IPV4);
 }
 
 int __connman_wpad_start(struct connman_service *service)