MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / deactivate

Method deactivate

Libraries/Http/HttpConnection.cpp:1444–1468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1442}
1443
1444bool HttpConnectionsPool::deactivate(HttpConnection::ID connectionID)
1445{
1446 HttpConnection& connection = connections[connectionID.index];
1447 if (connection.state == HttpConnection::State::Inactive)
1448 {
1449 return false;
1450 }
1451
1452 connection.reset();
1453 numConnections--;
1454
1455 if (numConnections == 0)
1456 {
1457 highestActiveConnection = 0;
1458 }
1459 else if (connectionID.index == highestActiveConnection)
1460 {
1461 while (highestActiveConnection > 0 and
1462 connections[highestActiveConnection].state == HttpConnection::State::Inactive)
1463 {
1464 highestActiveConnection--;
1465 }
1466 }
1467 return true;
1468}
1469
1470Result HttpConnectionsPool::Memory::assignTo(HttpConnectionsPool::Configuration conf,
1471 SpanWithStride<HttpConnection> connectionsSpan)

Callers 1

deactivateConnectionMethod · 0.80

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected