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
This commit is contained in:
Bonn Ortloff
2023-03-28 20:08:55 -05:00
parent 2308276af5
commit bc7fa46feb
2 changed files with 2 additions and 2 deletions

2
.gitignore vendored
View File

@ -3,4 +3,4 @@
*.o
/strfry
/strfry-db/*.mdb
.vscode/c_cpp_properties.json
.vscode/*

View File

@ -70,7 +70,7 @@ void cmd_stream(const std::vector<std::string> &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 });