mirror of
https://github.com/curl/curl.git
synced 2026-06-04 01:24:16 +03:00
CURLINFO_NUM_CONNECTS and more
This commit is contained in:
parent
ebf7d22503
commit
f4bef25b5e
12 changed files with 164 additions and 9 deletions
|
|
@ -784,5 +784,7 @@ CURLcode Curl_connecthost(struct connectdata *conn, /* context */
|
|||
if(sockconn)
|
||||
*sockconn = sockfd; /* the socket descriptor we've connected */
|
||||
|
||||
data->info.numconnects++; /* to track the number of connections made */
|
||||
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 @@ CURLcode Curl_initinfo(struct SessionHandle *data)
|
|||
|
||||
info->header_size = 0;
|
||||
info->request_size = 0;
|
||||
info->numconnects = 0;
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
||||
|
|
@ -170,6 +171,9 @@ CURLcode Curl_getinfo(struct SessionHandle *data, CURLINFO info, ...)
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -624,6 +624,8 @@ struct PureInfo {
|
|||
long proxyauthavail;
|
||||
long httpauthavail;
|
||||
|
||||
long numconnects; /* how many new connection did libcurl created */
|
||||
|
||||
char *contenttype; /* the content type of the object */
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue