Commit 5d845f2fb19f19152f5e29987df2524aa68db8cb

Con Kolivas 2011-09-02T10:13:33

If curl does not have sockopts, do not try to compile the json_rpc_call_sockopt_cb function, making it possible to build against older curl libraries.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/util.c b/util.c
index def60a8..5a26685 100644
--- a/util.c
+++ b/util.c
@@ -224,6 +224,7 @@ out:
 	return ptrlen;
 }
 
+#ifdef CURL_HAS_SOCKOPT
 int json_rpc_call_sockopt_cb(void *userdata, curl_socket_t fd, curlsocktype purpose)
 {
 	int keepalive = 1;
@@ -270,6 +271,7 @@ int json_rpc_call_sockopt_cb(void *userdata, curl_socket_t fd, curlsocktype purp
 
 	return 0;
 }
+#endif
 
 json_t *json_rpc_call(CURL *curl, const char *url,
 		      const char *userpass, const char *rpc_req,