mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-14 05:29:05 +01:00
unetmsg: only send publish notifications for remote publisher changes
handle_publish() notifies local subscribers about publisher state changes. The publish/subscribe handler in network_socket_handle_request() was calling it for both remote publish and subscribe changes, but subscriber changes are not relevant to local subscribers. Guard the handle_publish() calls with a msgtype == "publish" check, matching the local client paths in unetmsgd-client.uc which already have this guard. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
212040b5ca
commit
e0722d0ac4
1 changed files with 4 additions and 3 deletions
|
|
@ -104,7 +104,7 @@ function network_socket_handle_request(sock_data, req)
|
|||
return;
|
||||
if (args.enabled) {
|
||||
if (list[name]) {
|
||||
if (tx_auth)
|
||||
if (tx_auth && msgtype == "publish")
|
||||
core.handle_publish(null, name);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -124,13 +124,14 @@ function network_socket_handle_request(sock_data, req)
|
|||
network: sock_data.network,
|
||||
name: host,
|
||||
}, pubsub_proto);
|
||||
if (tx_auth)
|
||||
if (tx_auth && msgtype == "publish")
|
||||
core.handle_publish(null, name);
|
||||
list[name] = true;
|
||||
} else {
|
||||
if (!list[name])
|
||||
return 0;
|
||||
core.handle_publish(null, name);
|
||||
if (msgtype == "publish")
|
||||
core.handle_publish(null, name);
|
||||
delete core["remote_" + msgtype][name][host];
|
||||
delete list[name];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue