MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / curlReady

Function curlReady

common/script/httpcall.cpp:40–47  ·  view source on GitHub ↗

Lazy so curl costs nothing until a script actually transfers. Single script thread + one run at a time, so no init race.

Source from the content-addressed store, hash-verified

38 // Lazy so curl costs nothing until a script actually transfers. Single
39 // script thread + one run at a time, so no init race.
40 bool curlReady(void)
41 {
42 static bool ready = false;
43 if (!ready) {
44 ready = curl_global_init(CURL_GLOBAL_DEFAULT) == CURLE_OK;
45 }
46 return ready;
47 }
48
49 // Allocation-safe on purpose. The prebuilt curl portlib carries no unwind
50 // info, so a std::bad_alloc out of append() — the realistic case on an O3DS

Callers 2

performFunction · 0.85
encodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected