From d0fac166e5f82abcd4778cc1f9823889b9b1befc Mon Sep 17 00:00:00 2001 From: bel2125 Date: Sat, 2 Sep 2017 20:09:12 +0200 Subject: [PATCH] Fix #ifdef error in unit test --- test/page6.lua | 16 ++++++++++++++++ test/public_server.c | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/page6.lua diff --git a/test/page6.lua b/test/page6.lua new file mode 100644 index 00000000..dc304397 --- /dev/null +++ b/test/page6.lua @@ -0,0 +1,16 @@ +mg.write("HTTP/1.0 200 OK\r\n") +mg.write("Content-Type: text/plain\r\n") +mg.write("\r\n") +mg.write(mg.request_info.request_method .. " " .. mg.request_info.request_uri .. " HTTP/" .. mg.request_info.http_version .. "\r\n") +for k,v in pairs(mg.request_info.http_headers) do + mg.write(k .. ": " .. v .. "\r\n") +end +mg.write("\r\n") + +repeat + local r = mg.read() + if (r) then + mg.write(r) + end +until not r + diff --git a/test/public_server.c b/test/public_server.c index f1892ceb..35d32a57 100644 --- a/test/public_server.c +++ b/test/public_server.c @@ -1102,12 +1102,12 @@ websocket_client_close_handler(const struct mg_connection *conn, ck_assert(pclient_data != NULL); WS_TEST_TRACE("Client %i: Close handler\n", pclient_data->clientId); + pclient_data->closed++; mark_point(); #else (void)user_data; - pclient_data->closed++; #endif /* __MACH__ */