Browse Source

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

nfactor-troky
Con Kolivas 14 years ago
parent
commit
5f54e164c9
  1. 1
      configure.ac
  2. 2
      util.c

1
configure.ac

@ -125,6 +125,7 @@ AM_CONDITIONAL([HAS_YASM], [test x$has_yasm = xtrue])
PKG_PROG_PKG_CONFIG() PKG_PROG_PKG_CONFIG()
LIBCURL_CHECK_CONFIG(, 7.10.1, , [AC_MSG_ERROR([Missing required libcurl dev >= 7.10.1])]) 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. dnl CCAN wants to know a lot of vars.
# All the configuration checks. Regrettably, the __attribute__ checks will # All the configuration checks. Regrettably, the __attribute__ checks will

2
util.c

@ -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_USERPWD, userpass);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
} }
#ifdef CURL_HAS_SOCKOPT
if (longpoll) if (longpoll)
curl_easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, json_rpc_call_sockopt_cb); curl_easy_setopt(curl, CURLOPT_SOCKOPTFUNCTION, json_rpc_call_sockopt_cb);
#endif
curl_easy_setopt(curl, CURLOPT_POST, 1); curl_easy_setopt(curl, CURLOPT_POST, 1);
if (opt_protocol) if (opt_protocol)

Loading…
Cancel
Save