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

Function ProxyHandshakeShutdownThread

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

Source from the content-addressed store, hash-verified

749}
750
751static void ProxyHandshakeShutdownThread(void *args)
752{
753 ShutdownThreadContext* ctx = (ShutdownThreadContext*)args;
754 while (!dmAtomicGet32(&ctx->m_GotIt))
755 {
756 if (dmHttpClient::GetNumPoolConnections() == 0)
757 {
758 dmTime::Sleep(1000);
759 continue;
760 }
761
762 // The proxy socket is published before the CONNECT tunnel is upgraded to TLS.
763 // Wait a bit so shutdown lands during the delayed SSL handshake on the test port.
764 dmTime::Sleep(200 * 1000);
765
766 if (dmHttpClient::ShutdownConnectionPool() > 0) {
767 dmAtomicStore32(&ctx->m_GotIt, 1);
768 } else {
769 break;
770 }
771 }
772}
773
774TEST_P(dmHttpClientTest, ClientThreadedShutdown)
775{

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