diff options
Diffstat (limited to 'plugins/fcgi/fcgi.cpp')
-rw-r--r-- | plugins/fcgi/fcgi.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/fcgi/fcgi.cpp b/plugins/fcgi/fcgi.cpp index b9e279f..416ca24 100644 --- a/plugins/fcgi/fcgi.cpp +++ b/plugins/fcgi/fcgi.cpp @@ -347,6 +347,9 @@ std::string fcgi_plugin::fcgiQuery(FCGIContext& context) if (pos != app_addr.npos) { // host:port auto endpoints{m_resolver.resolve(app_addr.substr(0, pos), app_addr.substr(pos + 1))}; bool opening{false}; + + std::lock_guard<std::mutex> socket_lock{m_socket_mutex}; + if (!m_socket.is_open()) { std::cout << "FCGI: Opening new socket" << std::endl; boost::asio::connect(m_socket, endpoints); @@ -434,8 +437,17 @@ std::string fcgi_plugin::fcgiQuery(FCGIContext& context) } } } - } else { // Unix domain socket, or file to start + } else if (fs::is_socket(fs::path{app_addr})) { // Unix domain socket + // TODO + std::cerr << "FCGI Error: Unix domain sockets not yet implemented." << std::endl; + return HttpStatus("500", "FCGI configuration", context.SetResponseHeader); + } else if (fs::is_regular_file(fs::path{app_addr})) { // Executable to start // TODO + std::cerr << "FCGI Error: Executable FCGI not yet implemented." << std::endl; + return HttpStatus("500", "FCGI configuration", context.SetResponseHeader); + } else { + std::cerr << "FCGI Error: Invalid app_addr type." << std::endl; + return HttpStatus("500", "FCGI configuration", context.SetResponseHeader); } std::istringstream is_out{output_data}; |