Fastcgi++ is a library for easing the implementation of fastcgi servers in C++. And here is the very simple use case that I want to do: to check for the existence of a file, and if doesn't exist, to generate some error message. Here is the code, look for the question signs.
struct the_fastcgi_server_t: Fastcgipp::Request<char>
using namespace Fastcgipp;
Fastcgipp::Http::Environment<char> const &env =
// Can I resolve the file?
target_js = path_processor( env.scriptName );
} catch ( file_not_found_exc_t const& e )
// TODO How do I set a standard 404 here???!!
// ... Here I fill the response.
The answer is basically as here:
That is, use a fragment of code like this one
out << "Status: 404 Not found\r\n\r\n";
in the response method. It is not standard http, but FastCGI is just a wrapper over CGI, and that's how CGI does it.