Lines Matching defs:curl
10 #include <curl/curl.h>
45 CURL *curl;
73 if (ctx->curl) {
74 curl_easy_cleanup(ctx->curl);
75 ctx->curl = NULL;
125 static int curl_cb_debug(CURL *curl, curl_infotype info, char *buf, size_t len,
1293 static CURLcode curl_cb_ssl(CURL *curl, void *sslctx, void *parm)
1332 CURL *curl;
1342 curl = curl_easy_init();
1343 if (curl == NULL)
1346 curl_easy_setopt(curl, CURLOPT_URL, address);
1347 curl_easy_setopt(curl, CURLOPT_POST, 1L);
1349 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_fname);
1350 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
1352 curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, curl_cb_ssl);
1353 curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, ctx);
1362 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
1366 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
1369 curl_easy_setopt(curl, CURLOPT_SSLCERT, client_cert);
1370 curl_easy_setopt(curl, CURLOPT_SSLKEY, client_key);
1374 curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
1375 curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curl_cb_debug);
1376 curl_easy_setopt(curl, CURLOPT_DEBUGDATA, ctx);
1377 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_cb_write);
1378 curl_easy_setopt(curl, CURLOPT_WRITEDATA, ctx);
1379 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
1381 curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
1382 curl_easy_setopt(curl, CURLOPT_USERNAME, username);
1383 curl_easy_setopt(curl, CURLOPT_PASSWORD, password);
1386 return curl;
1416 ctx->curl = setup_curl_post(ctx, ctx->svc_address, ca_fname, username,
1418 if (ctx->curl == NULL)
1438 curl_easy_setopt(ctx->curl, CURLOPT_HTTPHEADER, ctx->curl_hdr);
1498 curl_easy_setopt(ctx->curl, CURLOPT_POSTFIELDS, str);
1501 res = curl_easy_perform(ctx->curl);
1513 curl_easy_getinfo(ctx->curl, CURLINFO_RESPONSE_CODE, &http);
1598 CURL *curl;
1607 wpa_printf(MSG_DEBUG, "curl: Download file from %s to %s (ca=%s)",
1609 curl = curl_easy_init();
1610 if (curl == NULL)
1617 curl_easy_setopt(curl, CURLOPT_URL, url);
1619 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_fname);
1620 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
1621 curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
1623 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
1625 curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curl_cb_debug);
1626 curl_easy_setopt(curl, CURLOPT_DEBUGDATA, ctx);
1627 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
1628 curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
1629 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
1631 res = curl_easy_perform(curl);
1640 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http);
1641 wpa_printf(MSG_DEBUG, "curl: Server response code %ld", http);
1652 if (curl)
1653 curl_easy_cleanup(curl);
1671 CURL *curl;
1676 wpa_printf(MSG_DEBUG, "curl: HTTP POST to %s", url);
1677 curl = setup_curl_post(ctx, url, ca_fname, username, password,
1679 if (curl == NULL)
1689 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, curl_hdr);
1691 curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
1694 res = curl_easy_perform(curl);
1703 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http);
1704 wpa_printf(MSG_DEBUG, "curl: Server response code %ld", http);