script test sleep input by user

This commit is contained in:
Hugo LAMY
2022-08-16 20:28:40 +02:00
parent 5c5f298493
commit 517f5dfc8a
2 changed files with 12 additions and 4 deletions

View File

@@ -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;