projects
/
platform
/
upstream
/
connman.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "vpn: Export vpn_ipconfig_foreach as linker symbol" into tizen
[platform/upstream/connman.git]
/
src
/
proxy.c
diff --git
a/src/proxy.c
b/src/proxy.c
old mode 100644
(file)
new mode 100755
(executable)
index
b6775b6
..
e1bc420
--- a/
src/proxy.c
+++ b/
src/proxy.c
@@
-44,6
+44,9
@@
struct proxy_lookup {
static void remove_lookup(struct proxy_lookup *lookup)
{
static void remove_lookup(struct proxy_lookup *lookup)
{
+ if (lookup->watch > 0)
+ g_source_remove(lookup->watch);
+
lookup_list = g_slist_remove(lookup_list, lookup);
connman_service_unref(lookup->service);
lookup_list = g_slist_remove(lookup_list, lookup);
connman_service_unref(lookup->service);
@@
-69,7
+72,7
@@
static gboolean lookup_callback(gpointer user_data)
struct proxy_lookup *lookup = user_data;
GSList *list;
struct proxy_lookup *lookup = user_data;
GSList *list;
- if (
lookup == NULL
)
+ if (
!lookup
)
return FALSE;
lookup->watch = 0;
return FALSE;
lookup->watch = 0;
@@
-77,14
+80,14
@@
static gboolean lookup_callback(gpointer user_data)
for (list = driver_list; list; list = list->next) {
struct connman_proxy_driver *proxy = list->data;
for (list = driver_list; list; list = list->next) {
struct connman_proxy_driver *proxy = list->data;
- if (
proxy->request_lookup == NULL
)
+ if (
!proxy->request_lookup
)
continue;
lookup->proxy = proxy;
break;
}
continue;
lookup->proxy = proxy;
break;
}
- if (
lookup->proxy == NULL
||
+ if (
!lookup->proxy
||
lookup->proxy->request_lookup(lookup->service,
lookup->url) < 0) {
lookup->proxy->request_lookup(lookup->service,
lookup->url) < 0) {
@@
-106,11
+109,11
@@
unsigned int connman_proxy_lookup(const char *interface, const char *url,
DBG("interface %s url %s", interface, url);
DBG("interface %s url %s", interface, url);
- if (
interface == NULL
)
+ if (
!interface
)
return 0;
lookup = g_try_new0(struct proxy_lookup, 1);
return 0;
lookup = g_try_new0(struct proxy_lookup, 1);
- if (
lookup == NULL
)
+ if (
!lookup
)
return 0;
lookup->token = next_lookup_token++;
return 0;
lookup->token = next_lookup_token++;
@@
-120,7
+123,7
@@
unsigned int connman_proxy_lookup(const char *interface, const char *url,
lookup->url = g_strdup(url);
lookup->service = connman_service_ref(service);
lookup->url = g_strdup(url);
lookup->service = connman_service_ref(service);
- lookup->watch = g_
timeout_add_seconds(0,
lookup_callback, lookup);
+ lookup->watch = g_
idle_add(
lookup_callback, lookup);
if (lookup->watch == 0) {
g_free(lookup->url);
g_free(lookup);
if (lookup->watch == 0) {
g_free(lookup->url);
g_free(lookup);
@@
-149,14
+152,9
@@
void connman_proxy_lookup_cancel(unsigned int token)
lookup = NULL;
}
lookup = NULL;
}
- if (lookup != NULL) {
- if (lookup->watch > 0) {
- g_source_remove(lookup->watch);
- lookup->watch = 0;
- }
-
- if (lookup->proxy != NULL &&
- lookup->proxy->cancel_lookup != NULL)
+ if (lookup) {
+ if (lookup->proxy &&
+ lookup->proxy->cancel_lookup)
lookup->proxy->cancel_lookup(lookup->service,
lookup->url);
lookup->proxy->cancel_lookup(lookup->service,
lookup->url);
@@
-165,7
+163,7
@@
void connman_proxy_lookup_cancel(unsigned int token)
}
void connman_proxy_driver_lookup_notify(struct connman_service *service,
}
void connman_proxy_driver_lookup_notify(struct connman_service *service,
-
const char *url, const char *result)
+ const char *url, const char *result)
{
GSList *list, *matches = NULL;
{
GSList *list, *matches = NULL;
@@
-185,7
+183,7
@@
void connman_proxy_driver_lookup_notify(struct connman_service *service,
}
}
}
}
- if (matches
!= NULL
)
+ if (matches)
remove_lookups(matches);
}
remove_lookups(matches);
}