8 // Backup the stdio streambufs
9 streambuf * cin_streambuf = cin.rdbuf();
10 streambuf * cout_streambuf = cout.rdbuf();
11 streambuf * cerr_streambuf = cerr.rdbuf();
16 FCGX_InitRequest(&request, 0, 0);
18 while (FCGX_Accept_r(&request) == 0) {
19 fcgi_streambuf cin_fcgi_streambuf(request.in);
20 fcgi_streambuf cout_fcgi_streambuf(request.out);
21 fcgi_streambuf cerr_fcgi_streambuf(request.err);
23 cin.rdbuf(&cin_fcgi_streambuf);
24 cout.rdbuf(&cout_fcgi_streambuf);
25 cerr.rdbuf(&cerr_fcgi_streambuf);
27 IoTQuery * iotquery=new IoTQuery(&request);
28 iotquery->processQuery();
33 // restore stdio streambufs
34 cin.rdbuf(cin_streambuf);
35 cout.rdbuf(cout_streambuf);
36 cerr.rdbuf(cerr_streambuf);