diff --git a/BlockChainLogger.cpp b/BlockChainLogger.cpp index c907b29..c6fc41b 100644 --- a/BlockChainLogger.cpp +++ b/BlockChainLogger.cpp @@ -26,7 +26,7 @@ void BlockChainLogger::run() { int offset = 0; while (true) { - if (expectedSize <= 0) { // 读取一个整型,表示后面跟着的json串的大小 + if (expectedSize <= 0) { // 读取一个整型,表示后面跟着的json串 size = ringBuffer.read(buffer, 4); if (size <= 0) { // 没有数据 // std::cout << "wait for data" << std::endl; diff --git a/main.cpp b/main.cpp index 8f162e7..f6ab6c0 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,7 @@ -#include #include -#include "utils/RedisUtil.h" #include "Server.h" #include "BlockChainLogger.h" - +#include /** * 1. 接收区块链下发的登录信息,加载相应用户的证书到redis数据库中。下发登录信息应包含登录超时时间。 @@ -20,13 +18,14 @@ using namespace std; int main() { + ndn::security::ntru::NTRUSignUtil::init(); Server server; - server.run(); std::thread t([]() { BlockChainLogger blockChainLogger; blockChainLogger.run(); }); - + server.run(); + ndn::security::ntru::NTRUSignUtil::clean(); // AddOrUpdateCertificateRequestMessage addOrUpdateCertificateRequestMessage; // addOrUpdateCertificateRequestMessage.parse("{\n"