Curl_setopt: refuse CURL_HTTP_VERSION_2_0 if built without support

This commit is contained in:
Daniel Stenberg 2013-09-03 23:32:08 +02:00
parent ac487842a1
commit d707a975f6
1 changed files with 6 additions and 1 deletions

View File

@ -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: