Lines Matching refs:curl

10 #include <curl/curl.h>
34 CURL *curl;
61 if (ctx->curl) {
62 curl_easy_cleanup(ctx->curl);
63 ctx->curl = NULL;
113 static int curl_cb_debug(CURL *curl, curl_infotype info, char *buf, size_t len,
1214 static CURLcode curl_cb_ssl(CURL *curl, void *sslctx, void *parm)
1251 CURL *curl;
1256 curl = curl_easy_init();
1257 if (curl == NULL)
1260 curl_easy_setopt(curl, CURLOPT_URL, address);
1261 curl_easy_setopt(curl, CURLOPT_POST, 1L);
1263 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_fname);
1264 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
1266 curl_easy_setopt(curl, CURLOPT_SSL_CTX_FUNCTION, curl_cb_ssl);
1267 curl_easy_setopt(curl, CURLOPT_SSL_CTX_DATA, ctx);
1270 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
1273 curl_easy_setopt(curl, CURLOPT_SSLCERT, client_cert);
1274 curl_easy_setopt(curl, CURLOPT_SSLKEY, client_key);
1278 curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
1279 curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curl_cb_debug);
1280 curl_easy_setopt(curl, CURLOPT_DEBUGDATA, ctx);
1281 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_cb_write);
1282 curl_easy_setopt(curl, CURLOPT_WRITEDATA, ctx);
1283 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
1285 curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANYSAFE);
1286 curl_easy_setopt(curl, CURLOPT_USERNAME, username);
1287 curl_easy_setopt(curl, CURLOPT_PASSWORD, password);
1290 return curl;
1320 ctx->curl = setup_curl_post(ctx, ctx->svc_address, ca_fname, username,
1322 if (ctx->curl == NULL)
1342 curl_easy_setopt(ctx->curl, CURLOPT_HTTPHEADER, ctx->curl_hdr);
1402 curl_easy_setopt(ctx->curl, CURLOPT_POSTFIELDS, str);
1405 res = curl_easy_perform(ctx->curl);
1417 curl_easy_getinfo(ctx->curl, CURLINFO_RESPONSE_CODE, &http);
1502 CURL *curl;
1509 wpa_printf(MSG_DEBUG, "curl: Download file from %s to %s (ca=%s)",
1511 curl = curl_easy_init();
1512 if (curl == NULL)
1517 curl_easy_cleanup(curl);
1521 curl_easy_setopt(curl, CURLOPT_URL, url);
1523 curl_easy_setopt(curl, CURLOPT_CAINFO, ca_fname);
1524 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
1525 curl_easy_setopt(curl, CURLOPT_CERTINFO, 1L);
1527 curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
1529 curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, curl_cb_debug);
1530 curl_easy_setopt(curl, CURLOPT_DEBUGDATA, ctx);
1531 curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
1532 curl_easy_setopt(curl, CURLOPT_WRITEDATA, f);
1533 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
1535 res = curl_easy_perform(curl);
1541 curl_easy_cleanup(curl);
1546 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http);
1547 wpa_printf(MSG_DEBUG, "curl: Server response code %ld", http);
1551 curl_easy_cleanup(curl);
1556 curl_easy_cleanup(curl);
1573 CURL *curl;
1577 wpa_printf(MSG_DEBUG, "curl: HTTP POST to %s", url);
1578 curl = setup_curl_post(ctx, url, ca_fname, username, password,
1580 if (curl == NULL)
1590 curl_easy_setopt(curl, CURLOPT_HTTPHEADER, curl_hdr);
1592 curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
1595 res = curl_easy_perform(curl);
1605 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http);
1606 wpa_printf(MSG_DEBUG, "curl: Server response code %ld", http);