1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-10 23:08:07 +00:00

Only use the sockoptfunction if the version of curl is recent enough.

This commit is contained in:
Con Kolivas 2011-07-25 10:58:32 +10:00
parent 2ca6c40991
commit 5f54e164c9
2 changed files with 3 additions and 0 deletions

View File

@ -125,6 +125,7 @@ AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
PKG_PROG_PKG_CONFIG()
LIBCURL_CHECK_CONFIG(, 7.10.1, , [AC_MSG_ERROR([Missing required libcurl dev >= 7.10.1])])
LIBCURL_CHECK_CONFIG(, 7.15.6, [AC_DEFINE([CURL_HAS_SOCKOPT], [1], [Defined if version of curl supports sockopts.])],)
dnl CCAN wants to know a lot of vars.
# All the configuration checks. Regrettably, the __attribute__ checks will

2
util.c
View File

@ -343,8 +343,10 @@ json_t *json_rpc_call(CURL *curl, const char *url,
curl_easy_setopt(curl, CURLOPT_USERPWD, userpass);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
}
#ifdef CURL_HAS_SOCKOPT
if (longpoll)
curl_easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, json_rpc_call_sockopt_cb);
#endif
curl_easy_setopt(curl, CURLOPT_POST, 1);
if (opt_protocol)