libcollectdclient: Propagate errors when signing / encrypting network packets.
[collectd.git] / src / curl_xml.c
index c67d9a3..9049d99 100644 (file)
@@ -885,11 +885,13 @@ static int cx_init_curl (cx_t *db) /* {{{ */
   if (db->post_body != NULL)
     curl_easy_setopt (db->curl, CURLOPT_POSTFIELDS, db->post_body);
 
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
   if (db->timeout >= 0)
-    curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, db->timeout);
+    curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout);
   else
     curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
        CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
 
   return (0);
 } /* }}} int cx_init_curl */