From a242cfb4e1909ee20a9ede674ed53efaea5cc438 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 16 May 2025 11:15:27 +0200 Subject: [PATCH] unetmsg: return the request data when issuing async requests Makes it possible to track and cancel requests Signed-off-by: Felix Fietkau --- .../unetmsg/files/usr/share/ucode/unetmsg/client.uc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/client.uc b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/client.uc index 293763572fa..1ed69822334 100644 --- a/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/client.uc +++ b/package/network/services/unetmsg/files/usr/share/ucode/unetmsg/client.uc @@ -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()