mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Allow sync HTTP fetches to be interrupted to fix hanging (#14412)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
This commit is contained in:
parent
32f68f35cf
commit
f07e1026ac
6 changed files with 56 additions and 11 deletions
|
@ -114,9 +114,9 @@ int ModApiHttp::l_http_fetch_sync(lua_State *L)
|
|||
infostream << "Mod performs HTTP request with URL " << req.url << std::endl;
|
||||
|
||||
HTTPFetchResult res;
|
||||
httpfetch_sync(req, res);
|
||||
bool completed = httpfetch_sync_interruptible(req, res);
|
||||
|
||||
push_http_fetch_result(L, res, true);
|
||||
push_http_fetch_result(L, res, completed);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue