MCPcopy Create free account
hub / github.com/dobin/RedEdr / InitializeWebServer

Function InitializeWebServer

RedEdr/webserver.cpp:346–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344
345
346int InitializeWebServer(std::vector<HANDLE>& threads, int port) {
347 webserver_port = port;
348 hStopEventWeb = CreateEvent(NULL, TRUE, FALSE, NULL);
349 if (hStopEventWeb == NULL) {
350 LOG_A(LOG_ERROR, "WEB: Failed to create stop event");
351 return 1;
352 }
353 webserver_thread = CreateThread(NULL, 0, WebserverThread, NULL, 0, NULL);
354 if (webserver_thread == NULL) {
355 LOG_A(LOG_ERROR, "WEB: Failed to create thread for webserver");
356 CloseHandle(hStopEventWeb);
357 hStopEventWeb = NULL;
358 return 1;
359 }
360 LOG_A(LOG_DEBUG, "!Web: Thread started");
361 threads.push_back(webserver_thread);
362 return 0;
363}
364
365
366void StopWebServer() {

Callers 1

mainFunction · 0.85

Calls 1

LOG_AFunction · 0.70

Tested by

no test coverage detected