Index: include/curl/curl.h =================================================================== RCS file: /cvsroot/curl/curl/include/curl/curl.h,v retrieving revision 1.265 diff -u -r1.265 curl.h --- include/curl/curl.h 6 Oct 2004 07:50:18 -0000 1.265 +++ include/curl/curl.h 19 Oct 2004 12:45:33 -0000 @@ -1179,9 +1179,10 @@ CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, + CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, /* Fill in new entries below here! */ - CURLINFO_LASTONE = 26 + CURLINFO_LASTONE = 27 } CURLINFO; /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as Index: lib/connect.c =================================================================== RCS file: /cvsroot/curl/curl/lib/connect.c,v retrieving revision 1.118 diff -u -r1.118 connect.c --- lib/connect.c 11 Oct 2004 17:23:41 -0000 1.118 +++ lib/connect.c 19 Oct 2004 12:45:34 -0000 @@ -784,5 +784,7 @@ if(sockconn) *sockconn = sockfd; /* the socket descriptor we've connected */ + data->info.numconnects++; /* to track the number of connections made */ + return CURLE_OK; } Index: lib/getinfo.c =================================================================== RCS file: /cvsroot/curl/curl/lib/getinfo.c,v retrieving revision 1.38 diff -u -r1.38 getinfo.c --- lib/getinfo.c 30 Sep 2004 21:01:23 -0000 1.38 +++ lib/getinfo.c 19 Oct 2004 12:45:34 -0000 @@ -38,7 +38,7 @@ #include "memdebug.h" /* - * This is supposed to be called in the beginning of a permform() session + * This is supposed to be called in the beginning of a perform() session * and should reset all session-info variables */ CURLcode Curl_initinfo(struct SessionHandle *data) @@ -63,6 +63,7 @@ info->header_size = 0; info->request_size = 0; + info->numconnects = 0; return CURLE_OK; } @@ -170,6 +171,9 @@ case CURLINFO_OS_ERRNO: *param_longp = data->state.os_errno; break; + case CURLINFO_NUM_CONNECTS: + *param_longp = data->info.numconnects; + break; default: return CURLE_BAD_FUNCTION_ARGUMENT; } Index: lib/urldata.h =================================================================== RCS file: /cvsroot/curl/curl/lib/urldata.h,v retrieving revision 1.240 diff -u -r1.240 urldata.h --- lib/urldata.h 6 Oct 2004 07:50:18 -0000 1.240 +++ lib/urldata.h 19 Oct 2004 12:45:35 -0000 @@ -624,6 +624,8 @@ long proxyauthavail; long httpauthavail; + long numconnects; /* how many new connection did libcurl created */ + char *contenttype; /* the content type of the object */ };