Lines Matching defs:curl

10 #include <curl/curl.h>
45 CURL *curl;
72 if (ctx->curl) {
73 curl_easy_cleanup(ctx->curl);
74 ctx->curl = NULL;
124 static int curl_cb_debug(CURL *curl, curl_infotype info, char *buf, size_t len,
1314 static CURLcode curl_cb_ssl(CURL *curl, void *sslctx, void *parm)
1353 CURL *curl;
1363 curl = curl_easy_init();
1364 if (curl == NULL)
1367 curl_easy_setopt(curl, CURLOPT_URL, address);
1368 curl_easy_setopt(curl, CURLOPT_POST, 1L);
1370 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_fname);
1371 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
1373 curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, curl_cb_ssl);
1374 curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, ctx);
1383 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
1387 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
1390 curl_easy_setopt(curl, CURLOPT_SSLCERT, client_cert);
1391 curl_easy_setopt(curl, CURLOPT_SSLKEY, client_key);
1395 curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
1396 curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curl_cb_debug);
1397 curl_easy_setopt(curl, CURLOPT_DEBUGDATA, ctx);
1398 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_cb_write);
1399 curl_easy_setopt(curl, CURLOPT_WRITEDATA, ctx);
1400 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
1402 curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
1403 curl_easy_setopt(curl, CURLOPT_USERNAME, username);
1404 curl_easy_setopt(curl, CURLOPT_PASSWORD, password);
1407 return curl;
1437 ctx->curl = setup_curl_post(ctx, ctx->svc_address, ca_fname, username,
1439 if (ctx->curl == NULL)
1459 curl_easy_setopt(ctx->curl, CURLOPT_HTTPHEADER, ctx->curl_hdr);
1519 curl_easy_setopt(ctx->curl, CURLOPT_POSTFIELDS, str);
1522 res = curl_easy_perform(ctx->curl);
1534 curl_easy_getinfo(ctx->curl, CURLINFO_RESPONSE_CODE, &http);
1619 CURL *curl;
1626 wpa_printf(MSG_DEBUG, "curl: Download file from %s to %s (ca=%s)",
1628 curl = curl_easy_init();
1629 if (curl == NULL)
1634 curl_easy_cleanup(curl);
1638 curl_easy_setopt(curl, CURLOPT_URL, url);
1640 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_fname);
1641 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
1642 curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
1644 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
1646 curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curl_cb_debug);
1647 curl_easy_setopt(curl, CURLOPT_DEBUGDATA, ctx);
1648 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
1649 curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
1650 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
1652 res = curl_easy_perform(curl);
1658 curl_easy_cleanup(curl);
1663 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http);
1664 wpa_printf(MSG_DEBUG, "curl: Server response code %ld", http);
1668 curl_easy_cleanup(curl);
1673 curl_easy_cleanup(curl);
1690 CURL *curl;
1694 wpa_printf(MSG_DEBUG, "curl: HTTP POST to %s", url);
1695 curl = setup_curl_post(ctx, url, ca_fname, username, password,
1697 if (curl == NULL)
1707 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, curl_hdr);
1709 curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
1712 res = curl_easy_perform(curl);
1722 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http);
1723 wpa_printf(MSG_DEBUG, "curl: Server response code %ld", http);