]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
unetmsg: return the request data when issuing async requests
authorFelix Fietkau <nbd@nbd.name>
Fri, 16 May 2025 09:15:27 +0000 (11:15 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 16 May 2025 11:01:41 +0000 (13:01 +0200)
Makes it possible to track and cancel requests

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/services/unetmsg/files/usr/share/ucode/unetmsg/client.uc

index 293763572fa25e7b8278f4f0175ad3ab9976ff04..1ed69822334543587720855daac31a45bd5f3c68 100644 (file)
@@ -76,8 +76,10 @@ function request(name, type, data, data_cb, complete_cb)
                cb: complete_cb
        });
 
-       if (!complete_cb)
-               req.await();
+       if (complete_cb)
+               return req;
+
+       req.await();
 }
 
 function connect()