[Cppcms-users] async connections and response headers
Brought to you by:
artyom-beilis
|
From: Frank E. <fra...@an...> - 2010-07-13 18:20:20
|
hi,
i have an async application:
class Test : public cppcms::application {
public:
Test(cppcms::service &srv)
: cppcms::application(srv) {
dispatcher().assign("^/test", &Test::test, this);
}
void main(std::string url) {
if(!dispatcher().dispatch(url)) {
response().status(404);
response().finalize();
release_context()->async_complete_response();
}
}
void test() {
response().set_content_header("text/plain");
response().out() << "test";
response().finalize();
release_context()->async_complete_response();
}
};
int main(int argc, char *argv[]) {
try {
cppcms::service srv(argc, argv);
booster::intrusive_ptr<Test> app = new Test(srv);
srv.applications_pool().mount(app, cppcms::mount_point("test"));
srv.run();
} catch(std::exception const &e) {
std::cerr << e.what() << std::endl;
}
}
if i start the application using scgi behind nginx and i call
http://.../test/test i get the expected 'test' string in the browser,
but the application sends nothing else (i.e. no response headers) and
the nginx log emits the following:
upstream sent neither valid HTTP/1.0 header nor "Status" header line
while reading response header from upstream
whats wrong here?
thanks,
frank
|