Static thread function that captures shared_ptr to data, not raw `this`
| 18 | |
| 19 | // Static thread function that captures shared_ptr to data, not raw `this` |
| 20 | static void serverThreadFunc(fl::shared_ptr<ServerThreadData> data) { |
| 21 | while (data->mRunning.load()) { |
| 22 | // Accept new clients (non-blocking) |
| 23 | // NOTE: Do NOT call update() here - the test's main thread handles |
| 24 | // data I/O via update()/readRequest(). Calling update() from both |
| 25 | // threads causes concurrent socket reads that corrupt chunked encoding. |
| 26 | data->mServer->acceptClients(); |
| 27 | |
| 28 | // Small sleep to prevent CPU spinning |
| 29 | fl::this_thread::sleep_for(fl::chrono::milliseconds(10)); // ok sleep for |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | ServerThread::ServerThread(fl::shared_ptr<fl::net::http::HttpStreamServer> server) { |
| 34 | mData = fl::make_shared<ServerThreadData>(); |
nothing calls this directly
no test coverage detected