| 48 | }; |
| 49 | |
| 50 | Result HttpAsyncFileServer::init(ThreadPool& pool, AsyncEventLoop& loop, StringSpan directoryToServe) |
| 51 | { |
| 52 | SC_TRY_MSG(eventLoop == nullptr, "HttpAsyncFileServer::init - already inited") |
| 53 | eventLoop = &loop; |
| 54 | threadPool = &pool; |
| 55 | |
| 56 | SC_TRY_MSG(FileSystem().existsAndIsDirectory(directoryToServe), "HttpAsyncFileServer::init invalid directory"); |
| 57 | SC_TRY(directory.assign(directoryToServe)); |
| 58 | return Result(true); |
| 59 | } |
| 60 | |
| 61 | Result HttpAsyncFileServer::close() |
| 62 | { |
no test coverage detected