Skip to content

Commit ca26232

Browse files
author
Sebastiano Merlino
committed
Moved to version 0.5.1
1 parent 5f4313e commit ca26232

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121

2222
AC_PREREQ(2.57)
2323
m4_define([libhttpserver_MAJOR_VERSION],[0])dnl
24-
m4_define([libhttpserver_MINOR_VERSION],[4])dnl
25-
m4_define([libhttpserver_REVISION],[1])dnl
24+
m4_define([libhttpserver_MINOR_VERSION],[5])dnl
25+
m4_define([libhttpserver_REVISION],[0])dnl
2626
m4_define([libhttpserver_PKG_VERSION],[libhttpserver_MAJOR_VERSION.libhttpserver_MINOR_VERSION.libhttpserver_REVISION])dnl
2727
m4_define([libhttpserver_LDF_VERSION],[libhttpserver_MAJOR_VERSION:libhttpserver_MINOR_VERSION:libhttpserver_REVISION])dnl
2828
AC_INIT([libhttpserver], libhttpserver_PKG_VERSION, [electrictwister2000@gmail.com])

debian/changelog.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
libhttpserver (0.5.1) unstable; urgency=low
2+
* Stabilized comet support
3+
* Added features to manage requests easily
4+
5+
-- Sebastiano Merlino <electrictwister2000@gmail.com> Tue, 10 Oct 2012 17:18:42 +0200
6+
17
libhttpserver (0.4.0) unstable; urgency=low
28
* Added support to Comet
39

test/Test.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ using namespace std;
1010

1111
webserver* ws_ptr;
1212

13+
/*
1314
void signal_callback_handler(int signum)
1415
{
1516
cout << "bye!" << endl;
1617
ws_ptr->stop();
1718
}
18-
19+
*/
1920
Test::Test() : http_resource()
2021
{
2122
}
@@ -26,7 +27,7 @@ Test2::Test2() : http_resource()
2627

2728
http_response Test::render_GET(const http_request& r)
2829
{
29-
cout << r.get_version() << endl;
30+
/* cout << r.get_version() << endl;
3031
cout << r.get_requestor() << endl;
3132
cout << r.get_requestor_port() << endl;
3233
cout << "PROVA: " << r.get_arg("prova") << endl;
@@ -37,13 +38,17 @@ http_response Test::render_GET(const http_request& r)
3738
r.get_headers(head);
3839
for(std::map<std::string, std::string, header_comparator>::const_iterator it = head.begin(); it != head.end(); ++it)
3940
cout << (*it).first << "-> " << (*it).second << endl;
40-
string pp = r.get_arg("prova");
41-
return http_file_response("/home/etr/progs/libhttpserver/test/noimg.png", 200, "image/png");
41+
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");
45+
cout << r.get_querystring() << endl;
46+
return http_file_response("/home/etr/progs/libhttpserver/test/noimg.png", 200, "image/png");
4247
}
4348

4449
http_response Test::render_POST(const http_request& r)
4550
{
46-
fstream filestr;
51+
/* fstream filestr;
4752
filestr.open("test.txt", fstream::out | fstream::app);
4853
filestr << r.get_content() << endl;
4954
filestr.close();
@@ -53,7 +58,11 @@ http_response Test::render_POST(const http_request& r)
5358
{
5459
cout << vv[i] << endl;
5560
}
56-
return http_string_response("OK",200);
61+
return http_string_response("OK",200);*/
62+
http_string_response s("OK",200);
63+
s.set_header(http_utils::http_header_location, "B");
64+
return s;
65+
// return long_polling_send_response("<script type=\"text/javascript\">alert(\"ciao\")</script>\n", "prova");
5766
}
5867

5968
http_response Test2::render_GET(const http_request& r)
@@ -69,7 +78,7 @@ http_response Test::render_PUT(const http_request& r)
6978

7079
int main()
7180
{
72-
signal(SIGINT, &signal_callback_handler);
81+
// signal(SIGINT, &signal_callback_handler);
7382
webserver ws = create_webserver(8080);
7483
ws_ptr = &ws;
7584
Test dt = Test();

0 commit comments

Comments
 (0)