cURL / Mailing Lists / curl-library / Single Mail

curl-library

Persistent HTTPS connections

From: Andreas Rieke <andreas.rieke_at_isl.de>
Date: Sun, 21 Jan 2007 13:16:36 +0100

Hi,

I would like to use cURL for a single persistent HTTPS connection to
request some information every 5 seconds from a web server. However,
cURL seems to use a second connection after the first request is done,
and after that, a third one is used up to ten parallel connections.
After that, cURL tries to reuse the first connection, but unfortunately
the web server has closed that connection in between. Thus, a new
connection is established.

I use libcurl 16.0 from my C++ application under linux. In order to
reduce the 10 parallel connections to 3, I tried to change
CURLOPT_MAXCONNECTS to 3 directly after calling curl_easy_init, but
unfortunately, this crashed. Is this approach - maybe even setting it to
1 - the correct way to force cURL to use just one connection? If yes,
did I do something wrong that cURL crashes or is this a cURL bug? If no,
how can I get cURL to use just a single persistent connection?

Thanks in advance,

Andreas

BTW, this is the output from my debugger:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 545)]
Curl_ch_connc (data=0x8244218, c=0x0, newamount=3) at url.c:412
Received on 2007-01-21