-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Description
I did this
........
.........
curl_global_init(CURL_GLOBAL_ALL);
g_curl = curl_easy_init();
curl_easy_setopt(g_curl, CURLOPT_URL, "http://10.11.1.4:9200/cn_es_rt_w_prod_risk_ex/cn_es_rt_w_prod_risk_ex");
curl_easy_setopt(g_curl, CURLOPT_VERBOSE, 0L);
curl_easy_setopt(g_curl, CURLOPT_NOPROGRESS, 1L);
curl_easy_setopt(g_curl, CURLOPT_WRITEFUNCTION, noop_cb);
curl_version_info_data *curl_ver_info = curl_version_info( CURLVERSION_NOW );
printf ("curl version: %s\n", curl_ver_info->version);
As shown below, call to easy_perform happens in an conditional infinite loop. Curl handle is reused.
while (!exit_flag)
{
............
................
............
curl_easy_setopt(g_curl, CURLOPT_POSTFIELDS,bfr_ptr); /// bfr_ptr is updated via records coming out of a FIFO..
res = curl_easy_perform(g_curl);
}
I expected the following
That the single instance of curl_easy would reuse the connection. Attached PCAP file capture output below.
curl/libcurl version
curl 7.48.0 (x86_64-pc-linux-gnu) libcurl/7.48.0 OpenSSL/1.0.1e zlib/1.2.3 libidn/1.18
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
OS version
centos-release-6-5.el6.centos.11.2.x86_64
Linux 36-JBOD 2.6.32-431.3.1.el6.x86_64 #1
PCAP shows new connection for each easy_perform
PCAP: Each easy_perform results in a NEW TCP connection