1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

ctl: advertise wifi-connected changes after updating props

If we advertise changes in Peer.Connected _before_ updating other props,
they're not available in the callbacks. Delay the notifications after we
parsed all props.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
David Herrmann 2014-05-08 15:23:53 +02:00
parent f275a60401
commit 95866f54f4

View file

@ -195,14 +195,6 @@ static int ctl_peer_parse_properties(struct ctl_peer *p,
}
}
if (connected_set && p->connected != connected) {
p->connected = connected;
if (p->connected)
ctl_fn_peer_connected(p);
else
ctl_fn_peer_disconnected(p);
}
if (interface) {
tmp = strdup(interface);
if (tmp) {
@ -243,6 +235,15 @@ static int ctl_peer_parse_properties(struct ctl_peer *p,
}
}
/* do notifications last */
if (connected_set && p->connected != connected) {
p->connected = connected;
if (p->connected)
ctl_fn_peer_connected(p);
else
ctl_fn_peer_disconnected(p);
}
return 0;
}