mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02: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:
@@ -135,6 +135,9 @@ u64 httpfetch_caller_alloc_secure();
|
||||
// to stop any ongoing fetches for the given caller.
|
||||
void httpfetch_caller_free(u64 caller);
|
||||
|
||||
// Performs a synchronous HTTP request. This blocks and therefore should
|
||||
// only be used from background threads.
|
||||
void httpfetch_sync(const HTTPFetchRequest &fetch_request, HTTPFetchResult &fetch_result);
|
||||
// Performs a synchronous HTTP request that is interruptible if the current
|
||||
// thread is a Thread object. interval is the completion check interval in ms.
|
||||
// This blocks and therefore should only be used from background threads.
|
||||
// Returned is whether the request completed without interruption.
|
||||
bool httpfetch_sync_interruptible(const HTTPFetchRequest &fetch_request,
|
||||
HTTPFetchResult &fetch_result, long interval = 100);
|
||||
|
Reference in New Issue
Block a user