dbus: Give NULL as the error parameter to dbus_bus_remove_match().

We didn't do anything anyway in case of failures. When we
give NULL as the error, dbus_bus_remove_match() can act
asynchronously, so it becomes faster. Also, the bus daemon
can avoid sending any replies, which reduces the amount of
traffic.
This commit is contained in:
Tanu Kaskinen 2012-01-01 19:44:26 +02:00
parent 6450ac2e6a
commit 7e4eef2179
2 changed files with 6 additions and 16 deletions

View file

@ -344,7 +344,7 @@ static int add_matches(struct userdata *u, pa_bool_t add) {
goto finish;
}
} else
dbus_bus_remove_match(pa_dbus_connection_get(u->dbus_connection), filter1, &e);
dbus_bus_remove_match(pa_dbus_connection_get(u->dbus_connection), filter1, NULL);
if (add) {
@ -352,11 +352,11 @@ static int add_matches(struct userdata *u, pa_bool_t add) {
if (dbus_error_is_set(&e)) {
pa_log("dbus_bus_add_match(%s) failed: %s", filter2, e.message);
dbus_bus_remove_match(pa_dbus_connection_get(u->dbus_connection), filter2, &e);
dbus_bus_remove_match(pa_dbus_connection_get(u->dbus_connection), filter2, NULL);
goto finish;
}
} else
dbus_bus_remove_match(pa_dbus_connection_get(u->dbus_connection), filter2, &e);
dbus_bus_remove_match(pa_dbus_connection_get(u->dbus_connection), filter2, NULL);
if (add) {
pa_assert_se(dbus_connection_add_filter(pa_dbus_connection_get(u->dbus_connection), filter_func, u, NULL));