diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-06-15 16:00:20 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-06-18 10:56:52 +0300 |
commit | 3ca789e446848eed6ca3c00af080cd737d115dcb (patch) | |
tree | a535d92aa25341b6d8345901adff8652cee87f08 /src/service.c | |
parent | b8162e19cfc7b3ce25b72983c0df4de6e14cbafe (diff) | |
download | connman-3ca789e446848eed6ca3c00af080cd737d115dcb.tar.gz connman-3ca789e446848eed6ca3c00af080cd737d115dcb.tar.bz2 connman-3ca789e446848eed6ca3c00af080cd737d115dcb.zip |
service: Add support functions for pending replies
Diffstat (limited to 'src/service.c')
-rw-r--r-- | src/service.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c index c353e8ed..a3a0160a 100644 --- a/src/service.c +++ b/src/service.c @@ -3428,6 +3428,38 @@ static void reply_pending(struct connman_service *service, int error) } } +static void check_pending_msg(struct connman_service *service) +{ + if (service->pending == NULL) + return; + + DBG("service %p pending msg %p already exists", service, + service->pending); + dbus_message_unref(service->pending); +} + +void __connman_service_set_hidden_data(struct connman_service *service, + gpointer user_data) +{ + DBusMessage *pending = user_data; + + DBG("service %p pending %p", service, pending); + + check_pending_msg(service); + + service->pending = pending; +} + +void __connman_service_return_error(struct connman_service *service, + int error, gpointer user_data) +{ + DBG("service %p error %d user_data %p", service, error, user_data); + + __connman_service_set_hidden_data(service, user_data); + + reply_pending(service, error); +} + static gboolean connect_timeout(gpointer user_data) { struct connman_service *service = user_data; |