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:
parent
f275a60401
commit
95866f54f4
1 changed files with 9 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue