Skip to content

Commit 94d92f0

Browse files
dschoGit for Windows Build Agent
authored andcommitted
fixup??? http: optionally load libcurl lazily
The `curl_global_trace()` function is now used, as of `jk/curl-global-trace-components`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent ce0433f commit 94d92f0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compat/lazyload-curl.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ static curl_global_sslset_type curl_global_sslset_func;
106106
typedef void (*curl_global_cleanup_type)(void);
107107
static curl_global_cleanup_type curl_global_cleanup_func;
108108

109+
typedef CURLcode (*curl_global_trace_type)(const char *config);
110+
static curl_global_trace_type curl_global_trace_func;
111+
109112
typedef struct curl_slist *(*curl_slist_append_type)(struct curl_slist *list, const char *data);
110113
static curl_slist_append_type curl_slist_append_func;
111114

@@ -201,6 +204,7 @@ static void lazy_load_curl(void)
201204
curl_global_init_func = (curl_global_init_type)load_function(libcurl, "curl_global_init");
202205
curl_global_sslset_func = (curl_global_sslset_type)load_function(libcurl, "curl_global_sslset");
203206
curl_global_cleanup_func = (curl_global_cleanup_type)load_function(libcurl, "curl_global_cleanup");
207+
curl_global_trace_func = (curl_global_trace_type)load_function(libcurl, "curl_global_trace");
204208
curl_slist_append_func = (curl_slist_append_type)load_function(libcurl, "curl_slist_append");
205209
curl_slist_free_all_func = (curl_slist_free_all_type)load_function(libcurl, "curl_slist_free_all");
206210
curl_easy_strerror_func = (curl_easy_strerror_type)load_function(libcurl, "curl_easy_strerror");
@@ -268,6 +272,12 @@ void curl_global_cleanup(void)
268272
curl_global_cleanup_func();
269273
}
270274

275+
CURLcode curl_global_trace(const char *config)
276+
{
277+
lazy_load_curl();
278+
return curl_global_trace_func(config);
279+
}
280+
271281
struct curl_slist *curl_slist_append(struct curl_slist *list, const char *data)
272282
{
273283
lazy_load_curl();

0 commit comments

Comments
 (0)