mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-17 00:38:50 +00:00
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:
2
.gitignore
vendored
2
.gitignore
vendored
@ -3,4 +3,4 @@
|
|||||||
*.o
|
*.o
|
||||||
/strfry
|
/strfry
|
||||||
/strfry-db/*.mdb
|
/strfry-db/*.mdb
|
||||||
.vscode/c_cpp_properties.json
|
.vscode/*
|
||||||
|
@ -70,7 +70,7 @@ void cmd_stream(const std::vector<std::string> &subArgs) {
|
|||||||
|
|
||||||
// bortloff@github hacks in writePolicy here
|
// bortloff@github hacks in writePolicy here
|
||||||
std::string okMsg;
|
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) {
|
if (res == WritePolicyResult::Accept) {
|
||||||
downloadedIds.emplace(from_hex(evJson.at("id").get_string()));
|
downloadedIds.emplace(from_hex(evJson.at("id").get_string()));
|
||||||
writer.inbox.push_move({ std::move(evJson), EventSourceType::Stream, url });
|
writer.inbox.push_move({ std::move(evJson), EventSourceType::Stream, url });
|
||||||
|
Reference in New Issue
Block a user