]> git.lizzy.rs Git - minetest.git/blobdiff - src/httpfetch.h
Remove legacy unused define DIGGING_PARTICLES_AMOUNT
[minetest.git] / src / httpfetch.h
index c44c8d2d3894449f8ffd3f98045a5cfff9e0d15a..29fb540d022f0755baca593a6644170321ff5f82 100644 (file)
@@ -61,7 +61,7 @@ struct HTTPFetchRequest
        // If not empty, should contain entries such as "Accept: text/html"
        std::vector<std::string> extra_headers;
 
-       //useragent to use
+       // useragent to use
        std::string useragent;
 
        HTTPFetchRequest();
@@ -78,25 +78,16 @@ struct HTTPFetchResult
        unsigned long request_id;
 
        HTTPFetchResult()
+           : succeeded(false), timeout(false), response_code(0), data(""),
+             caller(HTTPFETCH_DISCARD), request_id(0)
        {
-               succeeded = false;
-               timeout = false;
-               response_code = 0;
-               data = "";
-               caller = HTTPFETCH_DISCARD;
-               request_id = 0;
        }
 
        HTTPFetchResult(const HTTPFetchRequest &fetch_request)
+           : succeeded(false), timeout(false), response_code(0), data(""),
+             caller(fetch_request.caller), request_id(fetch_request.request_id)
        {
-               succeeded = false;
-               timeout = false;
-               response_code = 0;
-               data = "";
-               caller = fetch_request.caller;
-               request_id = fetch_request.request_id;
        }
-
 };
 
 // Initializes the httpfetch module
@@ -116,6 +107,9 @@ bool httpfetch_async_get(unsigned long caller, HTTPFetchResult &fetch_result);
 // Not required if you want to set caller = HTTPFETCH_DISCARD
 unsigned long httpfetch_caller_alloc();
 
+// Allocates a non-predictable caller ID for httpfetch_async
+unsigned long httpfetch_caller_alloc_secure();
+
 // Frees a caller ID allocated with httpfetch_caller_alloc
 // Note: This can be expensive, because the httpfetch thread is told
 // to stop any ongoing fetches for the given caller.
@@ -123,8 +117,6 @@ void httpfetch_caller_free(unsigned long 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);
-
+void httpfetch_sync(const HTTPFetchRequest &fetch_request, HTTPFetchResult &fetch_result);
 
 #endif // !HTTPFETCH_HEADER