Skip to content

Commit b546232

Browse files
author
chengxin
committed
【ENH】参数为空做校验,避免签名的时候异常
1 parent f1b6c7c commit b546232

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/push_socket/push_client_impl.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ void TIGER_API::PushClientImpl::connect()
4040
// create a worker thread to perform asynchronous network connections
4141
worker_thread_ = std::shared_ptr<std::thread>(new std::thread([this]
4242
{
43-
4443
socket_->connect();
4544

4645
LOG(INFO) << "io_service run on work thread";

src/push_socket/push_socket.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,17 @@ void TIGER_API::PushSocket::close_session()
208208

209209
void TIGER_API::PushSocket::send_authentication()
210210
{
211+
if (client_config_.tiger_id.empty())
212+
{
213+
LOG(ERROR) << "tiger_id is empty";
214+
return;
215+
}
216+
if (client_config_.private_key.empty())
217+
{
218+
LOG(ERROR) << "private_key is empty";
219+
return;
220+
}
221+
211222
//tiger_id sign by private_key
212223
utility::string_t sign = Utils::get_sign(client_config_.private_key, client_config_.tiger_id);
213224

0 commit comments

Comments
 (0)