mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-03-14 23:09:45 +01:00
unetmsg: notify subscribers when remote peer connection drops
When a remote peer's connection drops (device powered off, unetmsgd
crash, network failure), network_rx_cleanup_state silently removed
the remote publish/subscribe handles without notifying local
subscribers. This meant local clients had no way to detect that a
remote peer had disappeared.
Call handle_publish for each channel where a remote publish handle
is removed during connection cleanup, so local subscribers receive
the publisher change notification and can react accordingly.
Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 7fd71f2c74)
This commit is contained in:
parent
40a7b55d70
commit
3091dbcb45
1 changed files with 5 additions and 1 deletions
|
|
@ -51,8 +51,12 @@ function network_rx_cleanup_state(name)
|
|||
for (let cur, sub in core.remote_subscribe)
|
||||
delete sub[name];
|
||||
|
||||
for (let cur, sub in core.remote_publish)
|
||||
for (let cur, sub in core.remote_publish) {
|
||||
if (!sub[name])
|
||||
continue;
|
||||
delete sub[name];
|
||||
core.handle_publish(null, cur);
|
||||
}
|
||||
}
|
||||
|
||||
function network_rx_socket_close(data)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue