cURL / Mailing Lists / curl-library / Single Mail


Re: Diegst and NTLM authentication ignore CURLOPT_PORT

From: tetetest tetetest <>
Date: Mon, 26 May 2008 10:43:55 +0400

* Kirill Senoshenko <> [Mon, 26 May 2008 11:04:24

> 2) Let me also ask for advice. The intent is to use cURL as a client
> library for monitoring HTTP resources. A client makes test connections
> on schedule to simulate user actions and to check whether the resource
> is available. It is correct to consider each connection attempt in
> isolation and to use a new HTTP connection for it to trap problems
> with DNS, TCP stack etc. that may get hidden when reusing the
> connection.

> [skip] ... Can I
> avoid this and ask cURL or the server to close the connection after
> full exchange including the authentication stage and what API calls
> would achieve this goal?

The best way I can think of is to use a separate easy handle for each

Thus you'll avoid problems with cached connections (and, hopefully, with
DNS cache too, though I am not quite sure in this case).

As the docs say, curl_easy_init() is quite cheap, so there is no
performance penalty. Then, curl_easy_cleanup() cleans up all data and
closes all persistent connections.
Received on 2008-05-26