cURL / Mailing Lists / curl-users / Single Mail

curl-users

patch: curl_easy_getinfo(CURLINFO_.*_TIME)

From: Georg Horn <horn_at_koblenz-net.de>
Date: Tue, 20 Nov 2001 15:16:53 +0100

Hi,

as discussed with Daniel last week, i made a patch for curl-7.9.1
that avoids the problem with adding up all the dns-lookup-times,
connect-times etc. during several requests while reusing connections.

I also added another timer, CURLINFO_STARTTRANSFER_TIME. Its value
can be retrieved with curl_easy_getinfo(), and it should contain the time
it took from the start until the first byte is really about to be transferred
(after the first return from the select() call in transfer.c. This _is_
a great difference to CURLINFO_PRETRANSFER_TIME, as the following simple
example shows:

> src/curl -s -w 'total: %{time_total}, dns: %{time_namelookup}, conn: %{time_connect}, pretrans: %{time_pretransfer}, starttrans: %{time_starttransfer}.\n' http://www/cgi-bin/test-cgi http://www/cgi-bin/printenv -o /dev/null -o /dev/null
total: 0.073, dns: 0.009, conn: 0.010, pretrans: 0.011, starttrans: 0.047.
total: 0.044, dns: 0.008, conn: 0.008, pretrans: 0.008, starttrans: 0.044.

While the pretransfer time doesn't differ from the connect time, the
real transfer starts about 0.03 seconds after the connect and after
the request has been sent.

Further on, i changed the definition of the variable timespent (within struct
Progress) in file urldata.h to be double again, as it was in curl 7.7.3 (which
was the version i used 'till now). I always got total transfer times of zero,
while the dns- and connect-time was a few milliseconds...

I hope i haven't mixed up anything and that the patch can be included into
the next release...

The patch is attached to this email.

Bye,
Georg

Received on 2001-11-20