Commit f01f5991 authored by Tamaki Nishino's avatar Tamaki Nishino Committed by Alex Hultman

Use '> /dev/null 2>&1' redirection (#749)

parent 4926f5f5
......@@ -828,44 +828,44 @@ void testHTTP() {
FILE *nc;
// invalid data
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("invalid http", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("\r\n\r\n", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("\r\n", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("\r\n\r", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("\r", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("\n", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET \r\n", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET / HTTP/1.1\r\n", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET / HTTP/1.1\r\nHost: localhost:3000", nc);
pclose(nc);
// segmented GET
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET /segme", nc);
fflush(nc);
usleep(100000);
......@@ -884,7 +884,7 @@ void testHTTP() {
pclose(nc);
// segmented upgrade
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET /upgra", nc);
fflush(nc);
usleep(100000);
......@@ -907,14 +907,14 @@ void testHTTP() {
pclose(nc);
// slow GET should get disconnected
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
sleep(3);
fputs("GET /slowRequest HTTP/1.1\r\n\r\n", nc);
pclose(nc);
// post tests with increading data length
for (int j = 0; j < 10; j++) {
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("POST /postTest HTTP/1.1\r\nContent-Length: ", nc);
int contentLength = j * 1000000;
......@@ -931,24 +931,24 @@ void testHTTP() {
// todo: two-in-one GET, two-in-one GET, upgrade, etc
// segmented second GET
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET /packedTest HTTP/1.1\r\n\r\nGET /packedTest HTTP/", nc);
fflush(nc);
usleep(100000);
fputs("1.1\r\n\r\n", nc);
pclose(nc);
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET /packedTest HTTP/1.1\r\n\r\nGET /packedTest HTTP/1.1\r\n\r\n", nc);
pclose(nc);
// out of order responses
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("GET /firstRequest HTTP/1.1\r\n\r\nGET /secondRequest HTTP/1.1\r\n\r\n", nc);
pclose(nc);
// shutdown
nc = popen("nc localhost 3000 &> /dev/null", "w");
nc = popen("nc localhost 3000 > /dev/null 2>&1", "w");
fputs("PUT /closeServer HTTP/1.1\r\n\r\n", nc);
pclose(nc);
if (expectedRequests != 18) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment