From: Daniel Stenberg Date: Tue, 3 Sep 2013 21:32:08 +0000 (+0200) Subject: Curl_setopt: refuse CURL_HTTP_VERSION_2_0 if built without support X-Git-Tag: curl-7_33_0~166 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d707a975f645a2b25edb926f475b9abe94fe830a;p=thirdparty%2Fcurl.git Curl_setopt: refuse CURL_HTTP_VERSION_2_0 if built without support --- diff --git a/lib/url.c b/lib/url.c index 0ec0a96b92..f6da3ca268 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1203,7 +1203,12 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, * This sets a requested HTTP version to be used. The value is one of * the listed enums in curl/curl.h. */ - data->set.httpversion = va_arg(param, long); + arg = va_arg(param, long); +#ifndef USE_NGHTTP2 + if(arg == CURL_HTTP_VERSION_2_0) + return CURLE_UNSUPPORTED_PROTOCOL; +#endif + data->set.httpversion = arg; break; case CURLOPT_HTTPAUTH: