From bc7fa46feb421c37918ca3efedfea4629ec0220f Mon Sep 17 00:00:00 2001 From: Bonn Ortloff Date: Tue, 28 Mar 2023 20:08:55 -0500 Subject: [PATCH] I submit to the might of DougSC The acceptEvent is expecting to parse a JSON string. Instead of evJson.get_string() try tao::json::to_string(evJson) and it worked --- .gitignore | 2 +- src/cmd_stream.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 99f7481..627fefc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ *.o /strfry /strfry-db/*.mdb -.vscode/c_cpp_properties.json +.vscode/* diff --git a/src/cmd_stream.cpp b/src/cmd_stream.cpp index ee47853..67e4677 100644 --- a/src/cmd_stream.cpp +++ b/src/cmd_stream.cpp @@ -70,7 +70,7 @@ void cmd_stream(const std::vector &subArgs) { // bortloff@github hacks in writePolicy here std::string okMsg; - auto res = writePolicy.acceptEvent(evJson.get_string(), hoytech::curr_time_s(), EventSourceType::Stream, ws.connected_addr, okMsg); + auto res = writePolicy.acceptEvent(tao::json::to_string(evJson), hoytech::curr_time_s(), EventSourceType::Stream, ws.connected_addr, okMsg); if (res == WritePolicyResult::Accept) { downloadedIds.emplace(from_hex(evJson.at("id").get_string())); writer.inbox.push_move({ std::move(evJson), EventSourceType::Stream, url });