summaryrefslogtreecommitdiffhomepage
path: root/plugins/fcgi/fcgi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/fcgi/fcgi.cpp')
-rw-r--r--plugins/fcgi/fcgi.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/fcgi/fcgi.cpp b/plugins/fcgi/fcgi.cpp
index 5a7ce65..7748845 100644
--- a/plugins/fcgi/fcgi.cpp
+++ b/plugins/fcgi/fcgi.cpp
@@ -357,7 +357,7 @@ std::string fcgi_plugin::fcgiQuery(FCGIContext& context)
std::lock_guard<std::mutex> socket_lock{socket->getMutex()};
if (!socket->is_open()) {
- //std::cout << "FCGI: Opening new socket" << std::endl;
+ std::cout << "FCGI: Opening new socket to " << app_addr << std::endl;
socket->open();
opening = true;
@@ -402,7 +402,12 @@ std::string fcgi_plugin::fcgiQuery(FCGIContext& context)
std::cerr << "Warning: Not all bytes written" << std::endl;
} catch (const fcgi_eof_error&) {
std::cerr << "FCGI Error: EOF on write" << std::endl; // seems to be ok here
+ m_sockets.erase(app_addr); // force new socket next time
return HttpStatus("500", "FCGI connection: EOF on write", context.SetResponseHeader);
+ } catch (const fcgi_broken_pipe_error&) {
+ std::cerr << "FCGI Error: Broken pipe on write" << std::endl; // seems to be ok here
+ m_sockets.erase(app_addr); // force new socket next time
+ return HttpStatus("500", "FCGI connection: Broken pipe on write", context.SetResponseHeader);
}
#if 0
@@ -418,7 +423,8 @@ std::string fcgi_plugin::fcgiQuery(FCGIContext& context)
try {
socket->read(inbuf);
} catch (const fcgi_eof_error&) {
- std::cerr << "FCGI Warning: Early EOF" << std::endl; // seems to be ok here
+ std::cerr << "FCGI Warning: Early EOF from application server. Break." << std::endl; // seems to be ok here
+ m_sockets.erase(app_addr); // force new socket next time
ended = true;
//return HttpStatus("500", "FCGI connection: EOF on read", context.SetResponseHeader);
}