diff options
Diffstat (limited to 'src/service/ocsp-service.cpp')
-rw-r--r-- | src/service/ocsp-service.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/service/ocsp-service.cpp b/src/service/ocsp-service.cpp index 7bb0ea1..8743de2 100644 --- a/src/service/ocsp-service.cpp +++ b/src/service/ocsp-service.cpp @@ -20,6 +20,7 @@ * @brief */ #include "service/ocsp-service.h" +#include "common/command-id.h" #include <cchecker/log.h> @@ -40,10 +41,11 @@ void OcspService::onMessageProcess(const ConnShPtr &connection) auto in = connection->receive(); connection->send(this->process(connection, in)); + if (m_logic.setup() != NO_ERROR) throw std::logic_error("Cannot setup logic."); - LogDebug("Start to process message on ocsp service."); + LogDebug("Finish processing message on ocsp service."); } RawBuffer OcspService::process(const ConnShPtr &, RawBuffer &data) @@ -51,14 +53,14 @@ RawBuffer OcspService::process(const ConnShPtr &, RawBuffer &data) BinaryQueue q; q.push(data); - int cmd; - q.Deserialize(cmd); + CommandId cid; + q.Deserialize(cid); LogInfo("Request dispatch on ocsp-service."); - switch (static_cast<CommandId>(cmd)) { + switch (cid) { case CommandId::CC_OCSP_SYN: { - // TODO(sangwan.kwon) : set protocol with client - return BinaryQueue::Serialize(1).pop(); + LogDebug("Success to get SYN cmd. reply ACK cmd."); + return BinaryQueue::Serialize(CommandId::CC_OCSP_ACK).pop(); } case CommandId::CC_OCSP_ACK: default: |