From 37edf48838d6d812e1200210fc58c1145629b411 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 6 Oct 2019 15:37:05 +0200 Subject: [PATCH 1/5] appveyor: don't build for win32 Hopefully this is enough to unbreak AppVeyor, where we're running into resource limits. TBH, win64 is all we care about. --- .appveyor.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7be5f9a..d2620d4 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -2,7 +2,6 @@ image: Visual Studio 2017 environment: matrix: - CMAKE_GENERATOR: "Visual Studio 15 2017 Win64" - - CMAKE_GENERATOR: "Visual Studio 15 2017" build_script: - cmd: cmake -G "%CMAKE_GENERATOR%" . - cmd: cmake --build . -- /nologo /property:Configuration=Release From c8deb850a03c3baed69de2ceb8ebebe705c62e54 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 6 Oct 2019 15:38:29 +0200 Subject: [PATCH 2/5] libndt.hpp: ndt7: fix max message size --- libndt.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libndt.hpp b/libndt.hpp index 2f71fdc..2d05dfe 100644 --- a/libndt.hpp +++ b/libndt.hpp @@ -1945,7 +1945,7 @@ bool Client::ndt7_download() noexcept { } // The following value is the maximum amount of bytes that an implementation // SHOULD be prepared to handle when receiving ndt7 messages. - constexpr Size ndt7_bufsiz = (1 << 17); + constexpr Size ndt7_bufsiz = (1 << 24); std::unique_ptr buff{new uint8_t[ndt7_bufsiz]}; auto begin = std::chrono::steady_clock::now(); auto latest = begin; From 8318ec7867cdfc1f7cb0645dc38db59ca01c5c77 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 6 Oct 2019 15:42:20 +0200 Subject: [PATCH 3/5] libndt.hpp: avoid milli- vs micro potential ambiguity --- libndt.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libndt.hpp b/libndt.hpp index 2d05dfe..7f8c3f3 100644 --- a/libndt.hpp +++ b/libndt.hpp @@ -2010,7 +2010,7 @@ bool Client::ndt7_upload() noexcept { for (;;) { auto now = std::chrono::steady_clock::now(); std::chrono::duration elapsed = now - begin; - std::chrono::duration elapsed_ms = + std::chrono::duration elapsed_usec = std::chrono::duration_cast(elapsed); if (elapsed.count() > max_upload_time) { LIBNDT_EMIT_DEBUG("ndt7: upload has run for enough time"); @@ -2021,7 +2021,7 @@ bool Client::ndt7_upload() noexcept { if (interval.count() > measurement_interval) { nlohmann::json measurement; measurement["AppInfo"] = nlohmann::json(); - measurement["AppInfo"]["ElapsedTime"] = (std::uint64_t) elapsed_ms.count(); + measurement["AppInfo"]["ElapsedTime"] = (std::uint64_t) elapsed_usec.count(); measurement["AppInfo"]["NumBytes"] = total; #ifdef __linux__ // Read tcp_info data for the socket and print it as JSON. @@ -2030,7 +2030,7 @@ bool Client::ndt7_upload() noexcept { if (sys_getsockopt(sock_, IPPROTO_TCP, TCP_INFO, (void *)&tcpinfo, &tcpinfolen) == 0) { measurement["TCPInfo"] = nlohmann::json(); - measurement["TCPInfo"]["ElapsedTime"] = (std::uint64_t) elapsed_ms.count(); + measurement["TCPInfo"]["ElapsedTime"] = (std::uint64_t) elapsed_usec.count(); #define XX(lower_, upper_) measurement["TCPInfo"][#upper_] = (uint64_t)tcpinfo.lower_; NDT7_ENUM_TCP_INFO #undef XX From 652560338da96f11b68617c25b740b7bdd5601b3 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 6 Oct 2019 15:43:07 +0200 Subject: [PATCH 4/5] libndt.hpp: more explicit comment --- libndt.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libndt.hpp b/libndt.hpp index 7f8c3f3..cabcfb1 100644 --- a/libndt.hpp +++ b/libndt.hpp @@ -2039,7 +2039,7 @@ bool Client::ndt7_upload() noexcept { on_performance(nettest_flag_upload, 1, static_cast(total), elapsed.count(), max_upload_time); // This could fail if there are non-utf8 characters. This structure just - // contains integers and ASCII strings. + // contains integers and ASCII strings, so we should be good. std::string json = measurement.dump(); on_result("ndt7", "upload", json); From 734994ed3c8bcbf7e74457a5edc909eeda73066d Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Sun, 6 Oct 2019 15:44:06 +0200 Subject: [PATCH 5/5] libndt.hpp: remove stray \n in ndt7 upload --- libndt.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libndt.hpp b/libndt.hpp index cabcfb1..3fa7217 100644 --- a/libndt.hpp +++ b/libndt.hpp @@ -2042,7 +2042,6 @@ bool Client::ndt7_upload() noexcept { // contains integers and ASCII strings, so we should be good. std::string json = measurement.dump(); on_result("ndt7", "upload", json); - // Send measurement to the server. Err err = ws_send_frame(sock_, ws_opcode_text | ws_fin_flag, (uint8_t *)json.data(), json.size()); @@ -2050,7 +2049,6 @@ bool Client::ndt7_upload() noexcept { LIBNDT_EMIT_WARNING("ndt7: cannot send measurement"); return false; } - latest = now; } Err err = netx_sendn(sock_, frame.data(), frame.size());