chiark / gitweb /
sd-bus: drop match cookie concept
authorLennart Poettering <lennart@poettering.net>
Fri, 29 Sep 2017 15:57:34 +0000 (17:57 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 29 Sep 2017 15:57:34 +0000 (17:57 +0200)
THe match cookie was used by kdbus to identify matches we install
uniquely. But given that kdbus is gone, the cookie serves no process
anymore, let's kill it.

src/libelogind/sd-bus/bus-control.c
src/libelogind/sd-bus/bus-control.h
src/libelogind/sd-bus/bus-internal.h
src/libelogind/sd-bus/bus-slot.c
src/libelogind/sd-bus/sd-bus.c

index 935aceab637d117dc9f7d08be041a2c609771038..226e54e034d52ff69bd6c0c9ad041a6ad383c0c1 100644 (file)
@@ -650,8 +650,7 @@ int bus_add_match_internal(
                 sd_bus *bus,
                 const char *match,
                 struct bus_match_component *components,
-                unsigned n_components,
-                uint64_t cookie) {
+                unsigned n_components) {
 
         assert(bus);
 
@@ -686,8 +685,7 @@ static int bus_remove_match_internal_dbus1(
 
 int bus_remove_match_internal(
                 sd_bus *bus,
-                const char *match,
-                uint64_t cookie) {
+                const char *match) {
 
         assert(bus);
 
index 91efc68d5765672a671944ef3632fb4cee5b0bbf..01c71874db861a3fc777f9cffa2bb7508bab146c 100644 (file)
@@ -23,8 +23,5 @@
 
 #include "bus-match.h"
 
-int bus_add_match_internal(sd_bus *bus, const char *match, struct bus_match_component *components, unsigned n_components, uint64_t cookie);
-int bus_remove_match_internal(sd_bus *bus, const char *match, uint64_t cookie);
-
-int bus_add_match_internal_kernel(sd_bus *bus, struct bus_match_component *components, unsigned n_components, uint64_t cookie);
-int bus_remove_match_internal_kernel(sd_bus *bus, uint64_t cookie);
+int bus_add_match_internal(sd_bus *bus, const char *match, struct bus_match_component *components, unsigned n_components);
+int bus_remove_match_internal(sd_bus *bus, const char *match);
index 57c60a4c014c9099dee26fadc632fbb5f488e322..aeaa30144353569376a1efb81f3b9f5b7e7e7b2b 100644 (file)
@@ -53,7 +53,6 @@ struct filter_callback {
 struct match_callback {
         sd_bus_message_handler_t callback;
 
-        uint64_t cookie;
         unsigned last_iteration;
 
         char *match_string;
@@ -287,8 +286,6 @@ struct sd_bus {
         uint64_t hello_flags;
         uint64_t attach_flags;
 
-        uint64_t match_cookie;
-
         sd_event_source *input_io_event_source;
         sd_event_source *output_io_event_source;
         sd_event_source *time_event_source;
index cd5e9767470906d25ee7f37e93f344e508616f53..9fba5634a8d6b1fe89e23a614e0e89a1687604ac 100644 (file)
@@ -93,7 +93,7 @@ void bus_slot_disconnect(sd_bus_slot *slot) {
         case BUS_MATCH_CALLBACK:
 
                 if (slot->match_added)
-                        bus_remove_match_internal(slot->bus, slot->match_callback.match_string, slot->match_callback.cookie);
+                        bus_remove_match_internal(slot->bus, slot->match_callback.match_string);
 
                 slot->bus->match_callbacks_modified = true;
                 bus_match_remove(&slot->bus->match_callbacks, &slot->match_callback);
index 9a41897c5ab5832210a063f4f996ce0c2e5f4bdb..a674b9ea8dca80384d501d985255d046ab86d97a 100644 (file)
@@ -2892,7 +2892,6 @@ _public_ int sd_bus_add_match(
         }
 
         s->match_callback.callback = callback;
-        s->match_callback.cookie = ++bus->match_cookie;
 
         if (bus->bus_client) {
                 enum bus_match_scope scope;
@@ -2912,7 +2911,7 @@ _public_ int sd_bus_add_match(
                                 goto finish;
                         }
 
-                        r = bus_add_match_internal(bus, s->match_callback.match_string, components, n_components, s->match_callback.cookie);
+                        r = bus_add_match_internal(bus, s->match_callback.match_string, components, n_components);
                         if (r < 0)
                                 goto finish;