CURLIO (and libcwd): add number of established connections to http console.
I need to parse the debug output of libcurl for this, and choose to not do that for a Release build - at which point it makes little sense to even do it for a Debug build, since also the Alpha release are 'Release'. Even though it would probably have no impact on FPS, there would be like two persons looking at that number and understanding it.
This commit is contained in:
@@ -977,6 +977,7 @@ void CurlEasyRequest::resetState(void)
|
||||
mTimeoutPolicy = NULL;
|
||||
mTimeout = NULL;
|
||||
mHandleEventsTarget = NULL;
|
||||
mResult = CURLE_FAILED_INIT;
|
||||
applyDefaultOptions();
|
||||
}
|
||||
|
||||
@@ -1322,6 +1323,34 @@ void BufferedCurlEasyRequest::bad_socket(void)
|
||||
mResponder = NULL;
|
||||
}
|
||||
|
||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
||||
static AIPerServicePtr sConnections[64];
|
||||
|
||||
void BufferedCurlEasyRequest::connection_established(int connectionnr)
|
||||
{
|
||||
PerService_rat per_service_r(*mPerServicePtr);
|
||||
int n = per_service_r->connection_established();
|
||||
llassert(sConnections[connectionnr] == NULL); // Only one service can use a connection at a time.
|
||||
llassert_always(connectionnr < 64);
|
||||
sConnections[connectionnr] = mPerServicePtr;
|
||||
Dout(dc::curlio, (void*)get_lockobj() << " Connection established (#" << connectionnr << "). Now " << n << " connections [" << (void*)&*per_service_r << "].");
|
||||
llassert(sConnections[connectionnr] != NULL);
|
||||
}
|
||||
|
||||
void BufferedCurlEasyRequest::connection_closed(int connectionnr)
|
||||
{
|
||||
if (sConnections[connectionnr] == NULL)
|
||||
{
|
||||
Dout(dc::curlio, "Closing connection that never connected (#" << connectionnr << ").");
|
||||
return;
|
||||
}
|
||||
PerService_rat per_service_r(*sConnections[connectionnr]);
|
||||
int n = per_service_r->connection_closed();
|
||||
sConnections[connectionnr] = NULL;
|
||||
Dout(dc::curlio, (void*)get_lockobj() << " Connection closed (#" << connectionnr << "); " << n << " connections remaining [" << (void*)&*per_service_r << "].");
|
||||
}
|
||||
#endif
|
||||
|
||||
void BufferedCurlEasyRequest::resetState(void)
|
||||
{
|
||||
llassert(!mResponder);
|
||||
|
||||
Reference in New Issue
Block a user