Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: src/task.c

Issue 6513009: flimflam: Add L2TP/IPsec VPN plugin (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/flimflam.git@master
Patch Set: Remove local, add params Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/task.c
diff --git a/src/task.c b/src/task.c
index 708b270f22d5557e0b348d037af45261dda7d8e7..3614b2a54d0a8012c42fbbe91ade852c6c56ce4a 100644
--- a/src/task.c
+++ b/src/task.c
@@ -359,6 +359,7 @@ static DBusHandlerResult task_filter(DBusConnection *connection,
struct connman_task *task;
struct notify_data *notify;
const char *path, *member;
+ DBusMessage *reply = NULL;
if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -375,30 +376,33 @@ static DBusHandlerResult task_filter(DBusConnection *connection,
if (task == NULL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
- if (dbus_message_get_no_reply(message) == FALSE) {
- DBusMessage *reply;
- dbus_bool_t result;
+ member = dbus_message_get_member(message);
+ if (member == NULL)
+ goto send_reply;
+
+ notify = g_hash_table_lookup(task->notify, member);
+ if (notify == NULL)
+ goto send_reply;
+
+ if (notify->func)
+ reply = notify->func(task, message, notify->data);
+send_reply:
+ if (dbus_message_get_no_reply(message) == FALSE &&
+ reply == NULL) {
reply = dbus_message_new_method_return(message);
if (reply == NULL)
return DBUS_HANDLER_RESULT_NEED_MEMORY;
+ }
+
+ if (reply != NULL) {
+ dbus_bool_t result;
result = dbus_connection_send(connection, reply, NULL);
dbus_message_unref(reply);
}
- member = dbus_message_get_member(message);
- if (member == NULL)
- return DBUS_HANDLER_RESULT_HANDLED;
-
- notify = g_hash_table_lookup(task->notify, member);
- if (notify == NULL)
- return DBUS_HANDLER_RESULT_HANDLED;
-
- if (notify->func)
- notify->func(task, message, notify->data);
-
return DBUS_HANDLER_RESULT_HANDLED;
}
« scripts/libppp-plugin.c ('K') | « scripts/libppp-plugin.c ('k') | test/connect-vpn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698