From 7c648782bc7c97be81c619acd8598c38b59c5832 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 3 Jul 2008 06:56:03 +0000 Subject: Introcuding a new timestamp for curl_easy_getinfo(): CURLINFO_APPCONNECT_TIME. This is set with the "application layer" handshake/connection is completed (typically SSL, TLS or SSH). By using this you can figure out the application layer's own connect time. You can extract the time stamp using curl's -w option and the new variable named 'time_appconnect'. This feature was sponsored by Lenny Rachitsky at NeuStar. --- src/writeout.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/writeout.c b/src/writeout.c index 2a0e37af2..1e77d062c 100644 --- a/src/writeout.c +++ b/src/writeout.c @@ -45,6 +45,7 @@ typedef enum { VAR_TOTAL_TIME, VAR_NAMELOOKUP_TIME, VAR_CONNECT_TIME, + VAR_APPCONNECT_TIME, VAR_PRETRANSFER_TIME, VAR_STARTTRANSFER_TIME, VAR_SIZE_DOWNLOAD, @@ -79,6 +80,7 @@ static const struct variable replacements[]={ {"time_total", VAR_TOTAL_TIME}, {"time_namelookup", VAR_NAMELOOKUP_TIME}, {"time_connect", VAR_CONNECT_TIME}, + {"time_appconnect", VAR_APPCONNECT_TIME}, {"time_pretransfer", VAR_PRETRANSFER_TIME}, {"time_starttransfer", VAR_STARTTRANSFER_TIME}, {"size_header", VAR_HEADER_SIZE}, @@ -183,14 +185,22 @@ void ourWriteOut(CURL *curl, const char *writeinfo) curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; + case VAR_APPCONNECT_TIME: + if(CURLE_OK == + curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, + &doubleinfo)) + fprintf(stream, "%.3f", doubleinfo); + break; case VAR_PRETRANSFER_TIME: if(CURLE_OK == - curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, &doubleinfo)) + curl_easy_getinfo(curl, CURLINFO_PRETRANSFER_TIME, + &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_STARTTRANSFER_TIME: if(CURLE_OK == - curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, &doubleinfo)) + curl_easy_getinfo(curl, CURLINFO_STARTTRANSFER_TIME, + &doubleinfo)) fprintf(stream, "%.3f", doubleinfo); break; case VAR_SIZE_UPLOAD: -- cgit v1.2.3