projects
/
framework
/
connectivity
/
connman.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: Split reply_pending function to two parts
[framework/connectivity/connman.git]
/
src
/
service.c
diff --git
a/src/service.c
b/src/service.c
index
2577677
..
c353e8e
100644
(file)
--- a/
src/service.c
+++ b/
src/service.c
@@
-3388,35
+3388,42
@@
static void remove_timeout(struct connman_service *service)
}
}
}
}
-
static void reply_pending(struct connman_service *service
, int error)
+
void __connman_service_reply_dbus_pending(DBusMessage *pending
, int error)
{
{
- remove_timeout(service);
-
- if (service->pending != NULL) {
+ if (pending != NULL) {
if (error > 0) {
DBusMessage *reply;
if (error > 0) {
DBusMessage *reply;
- reply = __connman_error_failed(service->pending,
- error);
+ reply = __connman_error_failed(pending, error);
if (reply != NULL)
g_dbus_send_message(connection, reply);
} else {
if (reply != NULL)
g_dbus_send_message(connection, reply);
} else {
- const char *sender;
+ const char *sender
, *path
;
- sender = dbus_message_get_interface(service->pending);
+ sender = dbus_message_get_interface(pending);
+ path = dbus_message_get_path(pending);
- DBG("sender %s
", sender
);
+ DBG("sender %s
path %s", sender, path
);
if (g_strcmp0(sender, CONNMAN_MANAGER_INTERFACE) == 0)
if (g_strcmp0(sender, CONNMAN_MANAGER_INTERFACE) == 0)
- g_dbus_send_reply(connection,
service->
pending,
- DBUS_TYPE_OBJECT_PATH, &
service->
path,
+ g_dbus_send_reply(connection, pending,
+ DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID);
else
DBUS_TYPE_INVALID);
else
- g_dbus_send_reply(connection,
service->
pending,
+ g_dbus_send_reply(connection, pending,
DBUS_TYPE_INVALID);
}
DBUS_TYPE_INVALID);
}
- dbus_message_unref(service->pending);
+ dbus_message_unref(pending);
+ }
+}
+
+static void reply_pending(struct connman_service *service, int error)
+{
+ remove_timeout(service);
+
+ if (service->pending != NULL) {
+ __connman_service_reply_dbus_pending(service->pending, error);
service->pending = NULL;
}
}
service->pending = NULL;
}
}