Skip to content

Commit

Permalink
modify message format
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Flash committed Jul 7, 2022
1 parent 93228f2 commit bcaa5ec
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/core/download_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ namespace core {

void publish_topic(Download* download, std::string_view topic) {
nlohmann::json message = {
{"id", nullptr},
{"jsonrpc", "2,0"},
{"jsonrpc", "2.0"},
{"result", {
{"torrent_hash_value", torrent::utils::transform_hex_str(download->info()->hash().str())},
{"event_name", topic},
{"time_stamp", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count()}
{"target", torrent::utils::transform_hex_str(download->info()->hash().str())},
{"event", topic},
{"timestamp", std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count()}
}
}
};
Expand Down

0 comments on commit bcaa5ec

Please sign in to comment.