MCPcopy Create free account
hub / github.com/defold/defold / ProxyHandshakeShutdownThreadLocal

Function ProxyHandshakeShutdownThreadLocal

engine/dlib/src/test/test_httpclient.cpp:1694–1718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1692};
1693
1694static void ProxyHandshakeShutdownThreadLocal(void *args)
1695{
1696 ProxyShutdownThreadContext* ctx = (ProxyShutdownThreadContext*)args;
1697 while (!dmAtomicGet32(&ctx->m_GotIt) && !dmAtomicGet32(&ctx->m_Stop))
1698 {
1699 if (dmHttpClient::GetNumPoolConnections() == 0)
1700 {
1701 dmTime::Sleep(1000);
1702 continue;
1703 }
1704
1705 // The proxy socket is published before the CONNECT tunnel is upgraded to TLS.
1706 // Wait a bit so shutdown lands during the delayed SSL handshake on the test port.
1707 dmTime::Sleep(200 * 1000);
1708
1709 if (dmAtomicGet32(&ctx->m_Stop))
1710 break;
1711
1712 if (dmHttpClient::ShutdownConnectionPool() > 0) {
1713 dmAtomicStore32(&ctx->m_GotIt, 1);
1714 } else {
1715 break;
1716 }
1717 }
1718}
1719
1720static void ProxyThreadedShutdownDuringHandshake(int port)
1721{

Callers

nothing calls this directly

Calls 5

dmAtomicGet32Function · 0.85
GetNumPoolConnectionsFunction · 0.85
ShutdownConnectionPoolFunction · 0.85
dmAtomicStore32Function · 0.85
SleepFunction · 0.50

Tested by

no test coverage detected