*
* Connection Manager
*
- * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2012 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
g_free(url);
+ __connman_wispr_start(wpad->service,
+ CONNMAN_IPCONFIG_TYPE_IPV4);
+
return;
}
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)
return -EINVAL;
wpad = g_try_new0(struct connman_wpad, 1);
- if (wpad == NULL)
+ if (wpad == NULL) {
+ g_strfreev(nameservers);
return -ENOMEM;
+ }
wpad->service = service;
wpad->resolv = g_resolv_new(index);
if (wpad->resolv == NULL) {
+ g_strfreev(nameservers);
g_free(wpad);
return -ENOMEM;
}
for (i = 0; nameservers[i] != NULL; i++)
g_resolv_add_nameserver(wpad->resolv, nameservers[i], 53, 0);
+ g_strfreev(nameservers);
+
wpad->hostname = g_strdup_printf("wpad.%s", domainname);
DBG("hostname %s", wpad->hostname);
g_resolv_lookup_hostname(wpad->resolv, wpad->hostname,
wpad_result, wpad);
+ connman_service_ref(service);
g_hash_table_replace(wpad_list, GINT_TO_POINTER(index), wpad);
return 0;
if (index < 0)
return;
- g_hash_table_remove(wpad_list, GINT_TO_POINTER(index));
+ if (g_hash_table_remove(wpad_list, GINT_TO_POINTER(index)) == TRUE)
+ connman_service_unref(service);
}
int __connman_wpad_init(void)