Skip to content

Commit 2786018

Browse files
committed
Changed chunked request test script
1 parent af4821e commit 2786018

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cgi/client.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ void write(int fd, std::string data) {
1414
std::cout << data;
1515
}
1616

17-
int main(int, char **, char **) {
17+
int main(int argc, char **argv, char **) {
18+
if (argc != 2) {
19+
std::cerr << "usage ./client resource_to_request\n";
20+
return 1;
21+
}
22+
1823
int fd;
1924

2025
struct sockaddr_in addr;
@@ -32,7 +37,7 @@ int main(int, char **, char **) {
3237
}
3338
std::cout << "connected to: 127.0.0.1:8080" << std::endl;
3439
std::string msg;
35-
msg += "POST /listing/cgi/dump.php HTTP/1.1\r\n";
40+
msg += "POST " + std::string(argv[1]) + " HTTP/1.1\r\n";
3641
msg += "Host: 127.0.0.1\r\n";
3742
msg += "Transfer-Encoding: chunked\r\n";
3843
msg += "\r\n";

0 commit comments

Comments
 (0)