diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-09-03 23:32:08 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-09-04 22:29:38 +0200 |
commit | d707a975f645a2b25edb926f475b9abe94fe830a (patch) | |
tree | c5b06914c5dbaf0ab292c3fdccdf44fcdbdbd4cd /lib/url.c | |
parent | ac487842a18d77d31baee49a9dc022aa306b2ea1 (diff) |
Curl_setopt: refuse CURL_HTTP_VERSION_2_0 if built without support
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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: |