mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Redis: Fix sync erase, add btest for it
This commit is contained in:
parent
e6f1eea1b7
commit
b067a6e588
3 changed files with 64 additions and 13 deletions
|
@ -447,21 +447,17 @@ void Redis::HandleGetResult(redisReply* reply, OperationResultCallback* callback
|
|||
void Redis::HandleEraseResult(redisReply* reply, OperationResultCallback* callback) {
|
||||
--active_ops;
|
||||
|
||||
if ( callback->IsSyncCallback() )
|
||||
reply_queue.push_back(reply);
|
||||
else {
|
||||
OperationResult res{ReturnCode::SUCCESS};
|
||||
OperationResult res{ReturnCode::SUCCESS};
|
||||
|
||||
if ( ! connected )
|
||||
res = {ReturnCode::NOT_CONNECTED};
|
||||
else if ( ! reply )
|
||||
res = {ReturnCode::OPERATION_FAILED, "Async erase operation returned null reply"};
|
||||
else if ( reply && reply->type == REDIS_REPLY_ERROR )
|
||||
res = {ReturnCode::OPERATION_FAILED, util::fmt("Async erase operation failed: %s", reply->str)};
|
||||
if ( ! connected )
|
||||
res = {ReturnCode::NOT_CONNECTED};
|
||||
else if ( ! reply )
|
||||
res = {ReturnCode::OPERATION_FAILED, "Async erase operation returned null reply"};
|
||||
else if ( reply && reply->type == REDIS_REPLY_ERROR )
|
||||
res = {ReturnCode::OPERATION_FAILED, util::fmt("Async erase operation failed: %s", reply->str)};
|
||||
|
||||
freeReplyObject(reply);
|
||||
CompleteCallback(callback, res);
|
||||
}
|
||||
freeReplyObject(reply);
|
||||
CompleteCallback(callback, res);
|
||||
}
|
||||
|
||||
void Redis::HandleGeneric(redisReply* reply) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue