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

Function handler

test/ovpncli/cli.cpp:451–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449#elif defined(OPENVPN_OVPNCLI_SINGLE_THREAD)
450
451static void handler(int signum)
452{
453 switch (signum)
454 {
455 case SIGTERM:
456 case SIGINT:
457 if (the_client)
458 the_client->set_clock_tick_action(Client::CT_STOP);
459 break;
460 case SIGHUP:
461 if (the_client)
462 the_client->set_clock_tick_action(Client::CT_RECONNECT);
463 break;
464 case SIGUSR1:
465 if (the_client)
466 the_client->set_clock_tick_action(Client::CT_STATS);
467 break;
468 case SIGUSR2:
469 {
470 // toggle pause/resume
471 static bool hup = false;
472 if (the_client)
473 {
474 if (hup)
475 the_client->set_clock_tick_action(Client::CT_RESUME);
476 else
477 the_client->set_clock_tick_action(Client::CT_PAUSE);
478 hup = !hup;
479 }
480 }
481 break;
482 default:
483 break;
484 }
485}
486
487static void start_thread(Client& client)
488{

Callers

nothing calls this directly

Calls 6

set_clock_tick_actionMethod · 0.80
print_statsMethod · 0.80
stopMethod · 0.45
reconnectMethod · 0.45
resumeMethod · 0.45
pauseMethod · 0.45

Tested by

no test coverage detected