MCPcopy Create free account
hub / github.com/3proxy/3proxy / CommandHandler

Function CommandHandler

src/3proxy.c:55–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void __stdcall CommandHandler( DWORD dwCommand )
56{
57 switch( dwCommand )
58 {
59 case SERVICE_CONTROL_STOP:
60 case SERVICE_CONTROL_SHUTDOWN:
61 SetStatus( SERVICE_STOP_PENDING, 0, 1 );
62 conf.timetoexit = 1;
63 conf.paused++;
64 Sleep(2000);
65 SetStatus( SERVICE_STOPPED, 0, 0 );
66#ifndef NOODBC
67 pthread_mutex_lock(&log_mutex);
68 close_sql();
69 pthread_mutex_unlock(&log_mutex);
70#endif
71 break;
72 case SERVICE_CONTROL_PAUSE:
73 SetStatus( SERVICE_PAUSE_PENDING, 0, 1 );
74 conf.paused++;
75 SetStatus( SERVICE_PAUSED, 0, 0 );
76 break;
77 case SERVICE_CONTROL_CONTINUE:
78 SetStatus( SERVICE_CONTINUE_PENDING, 0, 1 );
79 conf.needreload = 1;
80 SetStatus( SERVICE_RUNNING, 0, 0 );
81 break;
82 default: ;
83 }
84}
85
86
87void __stdcall ServiceMain(int argc, unsigned char* argv[] )

Callers

nothing calls this directly

Calls 2

SetStatusFunction · 0.85
close_sqlFunction · 0.85

Tested by

no test coverage detected