cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Persistent HTTPS connections

From: Andreas Rieke <andreas.rieke_at_isl.de>
Date: Mon, 22 Jan 2007 17:23:03 +0100

Hi Daniel,

> 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

If it does, then it it because the server closed the connection. Have you
checked the response headers?

This is what happens in detail (when I have a long timeout configured on the server):
1. Connection starts, handles one HTTPS request and is not closed.
2. Connection starts, handles one HTTPS request and is not closed.
3. Connection starts, handles one HTTPS request and is not closed.
4. Connection starts, handles one HTTPS request and is not closed.
5. Connection starts, handles one HTTPS request and is not closed.
6. Connection starts, handles one HTTPS request and is not closed.
7. Connection starts, handles one HTTPS request and is not closed.
8. Connection starts, handles one HTTPS request and is not closed.
9. Connection starts, handles one HTTPS request and is not closed.
10. Connection starts, handles one HTTPS request and is not closed.
Second request is sent on the 1. connection.
Second request is sent on the 2. connection.
...

Since cURL sents the eleventh request on the first connection, too, it's obvious that the connection did not time out; I also reuse the same easy handle for all connections (although I use the multi interface because of asynchronous transfers).

How can I get cURL to use just one connection?

Thanks in advance,

Andreas
Received on 2007-01-22