service: Return service proxy is configured PAC URL is not set
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 12 Jan 2011 22:37:42 +0000 (23:37 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 12 Jan 2011 23:37:16 +0000 (00:37 +0100)
If the proxy configured method is AUTO but the PAC URL is not set yet,
returning service->proxy will give the correct method when WPAD failed.

src/service.c

index 425a3ff..caee973 100644 (file)
@@ -1569,8 +1569,13 @@ enum connman_service_proxy_method connman_service_get_proxy_method(
        if (service == NULL)
                return CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN;
 
-       if (service->proxy_config != CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN)
+       if (service->proxy_config != CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN) {
+               if (service->proxy_config == CONNMAN_SERVICE_PROXY_METHOD_AUTO &&
+                               service->pac == NULL)
+                       return service->proxy;
+
                return service->proxy_config;
+       }
 
        return service->proxy;
 }