MCPcopy Create free account
hub / github.com/OpenVPN/openvpn3 / worker_thread

Function worker_thread

test/ovpncli/cli.cpp:368–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366static Client *the_client = nullptr; // GLOBAL
367
368static void worker_thread()
369{
370#if !defined(OPENVPN_OVPNCLI_SINGLE_THREAD)
371 openvpn_io::detail::signal_blocker signal_blocker; // signals should be handled by parent thread
372#endif
373 try {
374 std::cout << "Thread starting..." << std::endl;
375 ClientAPI::Status connect_status = the_client->connect();
376 if (connect_status.error)
377 {
378 std::cout << "connect error: ";
379 if (!connect_status.status.empty())
380 std::cout << connect_status.status << ": ";
381 std::cout << connect_status.message << std::endl;
382 }
383 }
384 catch (const std::exception& e)
385 {
386 std::cout << "Connect thread exception: " << e.what() << std::endl;
387 }
388 std::cout << "Thread finished" << std::endl;
389}
390
391static std::string read_profile(const char *fn, const std::string* profile_content)
392{

Callers 1

start_threadFunction · 0.85

Calls 3

connectMethod · 0.45
emptyMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected