Static "Hello world" page
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
#include "fastcgi.h"
|
||||
#include "fastcgi_conn.h"
|
||||
|
||||
FastCGIServer::FastCGIServer(int port) {
|
||||
FastCGIServer::FastCGIServer(int port, const std::function<void(std::unique_ptr<FastCGIRequest>)>& callback)
|
||||
: callback_(callback) {
|
||||
LOG(INFO) << "listening on [::1]:" << port;
|
||||
|
||||
listen_sock_ = socket(AF_INET6, SOCK_STREAM, 0);
|
||||
@@ -38,7 +39,7 @@ void FastCGIServer::Serve() {
|
||||
PCHECK(client_sock >= 0) << "accept()";
|
||||
CHECK_EQ(client_addr.sin6_family, AF_INET6);
|
||||
|
||||
auto *conn = new FastCGIConn(client_sock, client_addr);
|
||||
auto *conn = new FastCGIConn(client_sock, client_addr, callback_);
|
||||
std::thread thread([conn]() { conn->Serve(); });
|
||||
thread.detach();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user