X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=input_stats.cpp;h=5b7dc59ae762696f2eca6e9ad12fc4e54fc6272b;hp=eee597b273d42cb4b83b2c530bb9913254fe788c;hb=ccad164a0a43a9a026af76d61b35068e7b5d3ab8;hpb=0229f4414b3b63934c057030deb88cbf6926bb1f diff --git a/input_stats.cpp b/input_stats.cpp index eee597b..5b7dc59 100644 --- a/input_stats.cpp +++ b/input_stats.cpp @@ -52,7 +52,14 @@ void InputStatsThread::do_work() now = time(nullptr); for (size_t i = 0; i < inputs.size(); ++i) { InputStats stats = inputs[i]->get_stats(); - fprintf(fp, "%s %llu %llu", stats.url.c_str(), + for (const char ch : stats.url) { + if (isspace(ch) || !isprint(ch)) { + putc('_', fp); + } else { + putc(ch, fp); + } + } + fprintf(fp, " %llu %llu", (long long unsigned)(stats.bytes_received), (long long unsigned)(stats.data_bytes_received)); if (stats.connect_time == -1) {