]> git.mxchange.org Git - simgear.git/commitdiff
Guard usage of CURLMOPT_MAX_TOTAL_CONNECTIONS
authorJames Turner <zakalawe@mac.com>
Wed, 25 May 2016 19:08:20 +0000 (20:08 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
Check the Curl patch version to avoid breaking on older
sustems.

simgear/io/HTTPClient.cxx

index 2d7aebb0b9d65364a71738f0284167967717d5c1..4fcb4d7b9df5de21854f6c367cde0faa2e8f2c46 100644 (file)
@@ -80,7 +80,9 @@ public:
         // see https://curl.haxx.se/libcurl/c/CURLMOPT_PIPELINING.html
         // we request HTTP 1.1 pipelining
         curl_multi_setopt(curlMulti, CURLMOPT_PIPELINING, 1 /* aka CURLPIPE_HTTP1 */);
+#if (LIBCURL_VERSION_MINOR >= 30)
         curl_multi_setopt(curlMulti, CURLMOPT_MAX_TOTAL_CONNECTIONS, (long) maxConnections);
+#endif
         curl_multi_setopt(curlMulti, CURLMOPT_MAX_PIPELINE_LENGTH,
                           (long) maxPipelineDepth);
         curl_multi_setopt(curlMulti, CURLMOPT_MAX_HOST_CONNECTIONS,
@@ -138,7 +140,9 @@ Client::~Client()
 void Client::setMaxConnections(unsigned int maxCon)
 {
     d->maxConnections = maxCon;
+#if (LIBCURL_VERSION_MINOR >= 30)
     curl_multi_setopt(d->curlMulti, CURLMOPT_MAX_TOTAL_CONNECTIONS, (long) maxCon);
+#endif
 }
 
 void Client::setMaxHostConnections(unsigned int maxHostCon)