Fix: call acting component's "port disconnected" method too
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 29 Mar 2017 06:27:53 +0000 (02:27 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:39 +0000 (12:57 -0400)
When a port is disconnected, call both upstream and downstream
components. It's okay to get notified as a component even if you
caused this notification.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/graph/connection-internal.h
lib/component/component.c
lib/component/connection.c
lib/component/port.c
lib/component/sink.c

index d22c7eea04e8af898f647957c1a9086ee687b95c..ac75320d6cf4480f397eca1780129f068a89866f 100644 (file)
@@ -70,7 +70,6 @@ struct bt_connection *bt_connection_create(struct bt_graph *graph,
                struct bt_port *downstream_port);
 
 BT_HIDDEN
-void bt_connection_disconnect_ports(struct bt_connection *conn,
-               struct bt_component *comp);
+void bt_connection_disconnect_ports(struct bt_connection *conn);
 
 #endif /* BABELTRACE_COMPONENT_CONNECTION_INTERNAL_H */
index e8c4b5af7c14e2167386c9d1886bfcd2ef20a442..47f83c861d3a17b69eb9ca3669a6472b61f85b63 100644 (file)
@@ -477,7 +477,7 @@ void bt_component_remove_port_at_index(struct bt_component *component,
 
        /* Disconnect both ports of this port's connection, if any */
        if (port->connection) {
-               bt_connection_disconnect_ports(port->connection, component);
+               bt_connection_disconnect_ports(port->connection);
        }
 
        /* Remove from parent's array of ports (weak refs) */
index d57a2cd49cd150774dbcbc3dbc44a118e54f5b09..5075c309885d42b792c6c3aef2249e858d4063f2 100644 (file)
@@ -89,8 +89,7 @@ end:
 }
 
 BT_HIDDEN
-void bt_connection_disconnect_ports(struct bt_connection *conn,
-               struct bt_component *acting_comp)
+void bt_connection_disconnect_ports(struct bt_connection *conn)
 {
        struct bt_component *downstream_comp = NULL;
        struct bt_component *upstream_comp = NULL;
@@ -109,12 +108,12 @@ void bt_connection_disconnect_ports(struct bt_connection *conn,
                conn->upstream_port = NULL;
        }
 
-       if (downstream_comp && downstream_comp != acting_comp) {
+       if (downstream_comp) {
                bt_component_port_disconnected(downstream_comp,
                        downstream_port);
        }
 
-       if (upstream_comp && upstream_comp != acting_comp) {
+       if (upstream_comp) {
                bt_component_port_disconnected(upstream_comp, upstream_port);
        }
 
index 68b1cb607ed398cd0cde8d94a45b6d8ae01677af..f1c5d1758bc9d6a38fb50b80b1646317b884fa5d 100644 (file)
@@ -166,7 +166,7 @@ int bt_port_disconnect(struct bt_port *port)
        }
 
        if (port->connection) {
-               bt_connection_disconnect_ports(port->connection, NULL);
+               bt_connection_disconnect_ports(port->connection);
        }
 
 end:
index 1f01d3191e3b9a9e436531732bfd19a91dcd825e..fbdb3a3e1248ac234c4e0f4af02316b4cff6216a 100644 (file)
@@ -162,7 +162,7 @@ bt_private_component_sink_get_input_private_port_at_index(
                        bt_component_from_private(private_component), index));
 }
 
-struct bt_private_port *bt_private_component_sink_get_default_private_input_port(
+struct bt_private_port *bt_private_component_sink_get_default_input_private_port(
                struct bt_private_component *private_component)
 {
        return bt_private_port_from_port(
This page took 0.026868 seconds and 4 git commands to generate.