@@ -39,11 +39,15 @@ void Test::render_GET(const http_request& r, http_response** res)
3939 for(std::map<std::string, std::string, header_comparator>::const_iterator it = head.begin(); it != head.end(); ++it)
4040 cout << (*it).first << "-> " << (*it).second << endl;
4141 string pp = r.get_arg("prova"); */
42- std::vector<std::string> topics;
43- topics.push_back (" prova" );
44- // return long_polling_receive_response("", 200, "", topics, 10, "keepalive\n");
42+
43+ /*
4544 cout << r.get_querystring() << endl;
4645 *res = new http_file_response("/home/etr/progs/libhttpserver/test/noimg.png", 200, "image/png");
46+ */
47+
48+ std::vector<std::string> topics;
49+ topics.push_back (" prova" );
50+ *res = new long_polling_receive_response (" " , 200 , " " , topics, false , 10 , " keepalive\n " );
4751}
4852
4953void Test::render_POST (const http_request& r, http_response** res)
@@ -59,13 +63,17 @@ void Test::render_POST(const http_request& r, http_response** res)
5963 cout << vv[i] << endl;
6064 }
6165 return http_string_response("OK",200);*/
66+
67+ /*
6268 http_string_response* s = new http_string_response("OK",100);
6369 s->set_header(http_utils::http_header_location, "B");
6470 s->set_cookie("Ciccio", "Puppo");
6571 s->set_cookie("Peppe", "Puppo");
6672 cout << s->get_cookie("Ciccio") << endl;
6773 *res = s;
68- // return long_polling_send_response("<script type=\"text/javascript\">alert(\"ciao\")</script>\n", "prova");
74+ */
75+
76+ *res = new long_polling_send_response (" hi!!!!\n " , " prova" );
6977}
7078
7179void Test2::render_GET (const http_request& r, http_response** res)
0 commit comments