]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
setopt: Fix ALPN / NPN user option when built without HTTP2
authorJay Satiro <raysatiro@yahoo.com>
Wed, 4 Dec 2019 06:10:17 +0000 (01:10 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Thu, 5 Dec 2019 23:38:40 +0000 (18:38 -0500)
- Stop treating lack of HTTP2 as an unknown option error result for
  CURLOPT_SSL_ENABLE_ALPN and CURLOPT_SSL_ENABLE_NPN.

Prior to this change it was impossible to disable ALPN / NPN if libcurl
was built without HTTP2. Setting either option would result in
CURLE_UNKNOWN_OPTION and the respective internal option would not be
set. That was incorrect since ALPN and NPN are used independent of
HTTP2.

Reported-by: Shailesh Kapse
Fixes https://github.com/curl/curl/issues/4668
Closes https://github.com/curl/curl/pull/4672

lib/setopt.c

index d7b9ca28501a12bf2e5f35c8221fc02d0bd78392..57e1090ce39a0cf5b152655c1ace05d89af94aaf 100644 (file)
@@ -2613,14 +2613,12 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
     result = CURLE_NOT_BUILT_IN;
 #endif
     break;
-#ifdef USE_NGHTTP2
   case CURLOPT_SSL_ENABLE_NPN:
     data->set.ssl_enable_npn = (0 != va_arg(param, long)) ? TRUE : FALSE;
     break;
   case CURLOPT_SSL_ENABLE_ALPN:
     data->set.ssl_enable_alpn = (0 != va_arg(param, long)) ? TRUE : FALSE;
     break;
-#endif
 #ifdef USE_UNIX_SOCKETS
   case CURLOPT_UNIX_SOCKET_PATH:
     data->set.abstract_unix_socket = FALSE;