Don't leak eventfd
This commit is contained in:
@@ -28,6 +28,10 @@ Server::Server(int port, const std::function<void(Request*)>& callback, int thre
|
|||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Server::~Server() {
|
||||||
|
PCHECK(close(close_fd_) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
void Server::Serve() {
|
void Server::Serve() {
|
||||||
std::vector<std::thread> threads;
|
std::vector<std::thread> threads;
|
||||||
for (int i = 0; i < threads_ - 1; ++i) {
|
for (int i = 0; i < threads_ - 1; ++i) {
|
||||||
|
|||||||
2
server.h
2
server.h
@@ -11,6 +11,8 @@ namespace firecgi {
|
|||||||
class Server {
|
class Server {
|
||||||
public:
|
public:
|
||||||
Server(int port, const std::function<void(Request*)>& callback, int threads=1, int max_request_len=(16*1024));
|
Server(int port, const std::function<void(Request*)>& callback, int threads=1, int max_request_len=(16*1024));
|
||||||
|
~Server();
|
||||||
|
|
||||||
void Serve();
|
void Serve();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
void RegisterSignalHandlers();
|
void RegisterSignalHandlers();
|
||||||
|
|||||||
Reference in New Issue
Block a user