diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-03-14 11:22:52 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-03-14 11:22:52 -0400 |
commit | e9231a987d64d2ad7e19dee30645409cab0b48e5 (patch) | |
tree | 61e8e1c61082df9cb6b1d1933b26ab167a3b1610 /indra | |
parent | 7f25ec566ed671119ecf3d47c4f3be54232969cb (diff) |
Fix a bug in leap.generate().
We weren't passing the WaitForReqid instance to WaitForReqid:wait().
Also remove 'reqid' from responses returned by leap.request() and generate().
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/scripts/lua/leap.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/scripts/lua/leap.lua b/indra/newview/scripts/lua/leap.lua index 2dd0d7b8ec..81728e7230 100644 --- a/indra/newview/scripts/lua/leap.lua +++ b/indra/newview/scripts/lua/leap.lua @@ -132,7 +132,7 @@ end -- See also send(), generate(). function leap.request(pump, data) local reqid = leap._requestSetup(pump, data) - waitfor = leap._pending[reqid] + local waitfor = leap._pending[reqid] -- print_debug('leap.request('..tostring(pump)..', '..inspect(data)..') about to wait on '.. -- tostring(waitfor)) local ok, response = pcall(waitfor.wait, waitfor) @@ -141,6 +141,7 @@ function leap.request(pump, data) -- kill off temporary WaitForReqid object, even if error leap._pending[reqid] = nil if ok then + response.reqid = nil return response else error(response) @@ -178,12 +179,14 @@ function leap.generate(pump, data, checklast) -- bearing that reqid. Stamp the outbound request with that reqid, and -- send it. local reqid = leap._requestSetup(pump, data) + local waitfor = leap._pending[reqid] local ok, response repeat - ok, response = pcall(leap._pending[reqid].wait) + ok, response = pcall(waitfor.wait, waitfor) if not ok then break end + response.reqid = nil coroutine.yield(response) until checklast and checklast(response) -- If we break the above loop, whether or not due to error, clean up. |