From 85addc3dace368662bd65188a35a4674e8861da4 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Mon, 17 Jan 2022 20:02:54 +0100 Subject: [PATCH] UI, file-updater, rtmp-services: Enable curl ALPN support In the years since this code was added, ALPN is now widely supported, and NPN is being removed entirely in the latest version of nginx. It's time to start using ALPN! --- UI/remote-text.cpp | 9 --------- deps/file-updater/file-updater/file-updater.c | 5 ----- plugins/rtmp-services/service-specific/nimotv.c | 5 ----- plugins/rtmp-services/service-specific/showroom.c | 4 ---- plugins/rtmp-services/service-specific/younow.c | 5 ----- 5 files changed, 28 deletions(-) diff --git a/UI/remote-text.cpp b/UI/remote-text.cpp index 0bccc27b0..83afa9a53 100644 --- a/UI/remote-text.cpp +++ b/UI/remote-text.cpp @@ -77,11 +77,6 @@ void RemoteTextThread::run() curl_easy_setopt(curl.get(), CURLOPT_TIMEOUT, timeoutSec); -#if LIBCURL_VERSION_NUM >= 0x072400 - // A lot of servers don't yet support ALPN - curl_easy_setopt(curl.get(), CURLOPT_SSL_ENABLE_ALPN, 0); -#endif - if (!postData.empty()) { curl_easy_setopt(curl.get(), CURLOPT_POSTFIELDS, postData.c_str()); @@ -177,10 +172,6 @@ bool GetRemoteFile(const char *url, std::string &str, std::string &error, curl_easy_setopt(curl.get(), CURLOPT_TIMEOUT, timeoutSec); -#if LIBCURL_VERSION_NUM >= 0x072400 - // A lot of servers don't yet support ALPN - curl_easy_setopt(curl.get(), CURLOPT_SSL_ENABLE_ALPN, 0); -#endif if (!request_type.empty()) { if (request_type != "GET") curl_easy_setopt(curl.get(), diff --git a/deps/file-updater/file-updater/file-updater.c b/deps/file-updater/file-updater/file-updater.c index 5fec96abe..f53a44a15 100644 --- a/deps/file-updater/file-updater/file-updater.c +++ b/deps/file-updater/file-updater/file-updater.c @@ -127,11 +127,6 @@ static bool do_http_request(struct update_info *info, const char *url, curl_easy_setopt(info->curl, CURLOPT_HEADERDATA, info); } -#if LIBCURL_VERSION_NUM >= 0x072400 - // A lot of servers don't yet support ALPN - curl_easy_setopt(info->curl, CURLOPT_SSL_ENABLE_ALPN, 0); -#endif - code = curl_easy_perform(info->curl); if (code != CURLE_OK) { warn("Remote update of URL \"%s\" failed: %s", url, diff --git a/plugins/rtmp-services/service-specific/nimotv.c b/plugins/rtmp-services/service-specific/nimotv.c index c03279822..4e26ab888 100644 --- a/plugins/rtmp-services/service-specific/nimotv.c +++ b/plugins/rtmp-services/service-specific/nimotv.c @@ -94,11 +94,6 @@ const char *nimotv_get_ingest(const char *key) curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); curl_obs_set_revoke_setting(curl_handle); -#if LIBCURL_VERSION_NUM >= 0x072400 - // A lot of servers don't yet support ALPN - curl_easy_setopt(curl_handle, CURLOPT_SSL_ENABLE_ALPN, 0); -#endif - res = curl_easy_perform(curl_handle); dstr_free(&uri); diff --git a/plugins/rtmp-services/service-specific/showroom.c b/plugins/rtmp-services/service-specific/showroom.c index dfbcaf187..f10b5c9f2 100644 --- a/plugins/rtmp-services/service-specific/showroom.c +++ b/plugins/rtmp-services/service-specific/showroom.c @@ -125,10 +125,6 @@ struct showroom_ingest *showroom_get_ingest(const char *server, curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&json); curl_obs_set_revoke_setting(curl_handle); -#if LIBCURL_VERSION_NUM >= 0x072400 - curl_easy_setopt(curl_handle, CURLOPT_SSL_ENABLE_ALPN, 0); -#endif - res = curl_easy_perform(curl_handle); dstr_free(&uri); if (res != CURLE_OK) { diff --git a/plugins/rtmp-services/service-specific/younow.c b/plugins/rtmp-services/service-specific/younow.c index a6cfe385b..2914dc480 100644 --- a/plugins/rtmp-services/service-specific/younow.c +++ b/plugins/rtmp-services/service-specific/younow.c @@ -65,11 +65,6 @@ const char *younow_get_ingest(const char *server, const char *key) curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); curl_obs_set_revoke_setting(curl_handle); -#if LIBCURL_VERSION_NUM >= 0x072400 - // A lot of servers don't yet support ALPN - curl_easy_setopt(curl_handle, CURLOPT_SSL_ENABLE_ALPN, 0); -#endif - res = curl_easy_perform(curl_handle); dstr_free(&uri);