Skip to content

Commit 29749a8

Browse files
committed
Fix libcurl deprecation warning (CURLOPT_PROTOCOLS)
The release uses static builds, but note that if we were to dynamically link against an older version of libcurl without CURLOPT_PROTOCOLS_STR, we would detect an error from the unknown option and abort the download rather than allowing unsavory protocols. Fixes #929
1 parent 74aca10 commit 29749a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/engine/client/dl_main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ if (curl_easy_setopt(request_, option, value) != CURLE_OK) { \
172172
SETOPT( CURLOPT_USERAGENT, Str::Format( "%s %s", PRODUCT_NAME "/" PRODUCT_VERSION, curl_version() ).c_str() )
173173
SETOPT( CURLOPT_REFERER, Str::Format("%s%s", URI_SCHEME, Cvar::GetValue("cl_currentServerIP")).c_str() )
174174
SETOPT( CURLOPT_URL, url.c_str() )
175+
#if CURL_AT_LEAST_VERSION(7, 85, 0)
176+
SETOPT( CURLOPT_PROTOCOLS_STR, "http" )
177+
#else
175178
SETOPT( CURLOPT_PROTOCOLS, long(CURLPROTO_HTTP) )
179+
#endif
176180
SETOPT( CURLOPT_WRITEFUNCTION, curl_write_callback(LibcurlWriteCallback) )
177181
SETOPT( CURLOPT_WRITEDATA, static_cast<void*>(this) )
178182
SETOPT( CURLOPT_FAILONERROR, 1L )

0 commit comments

Comments
 (0)