diff --git a/srcs/cgi-bin/cgi_cpp_sleep.cpp b/srcs/cgi-bin/cgi_cpp_sleep.cpp
index 303c074..0910855 100644
--- a/srcs/cgi-bin/cgi_cpp_sleep.cpp
+++ b/srcs/cgi-bin/cgi_cpp_sleep.cpp
@@ -3,9 +3,11 @@
int main (int ac, char **av, char ** env)
{
- std::string http_header;
- std::string http_body;
- std::string rq_body;
+ std::string http_header;
+ std::string http_body;
+ std::string rq_body;
+ size_t time;
+ std::stringstream ss;
std::cin >> rq_body;
@@ -14,7 +16,9 @@ int main (int ac, char **av, char ** env)
fill_response_basic(env, http_body, http_header, rq_body);
- sleep(60);
+ ss << get_value("sleep", rq_body);
+ ss >> time;
+ sleep(time);
std::cout << http_header << CRLF CRLF << http_body;
diff --git a/www/form_cgi.html b/www/form_cgi.html
index 500961a..c77148e 100644
--- a/www/form_cgi.html
+++ b/www/form_cgi.html
@@ -204,6 +204,8 @@
+
+
the request will sleep for one minute
@@ -427,6 +429,8 @@the request will sleep for one minute