mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 09:38:19 +00:00
Redis: Add btests for the redis backend
This commit is contained in:
parent
52d94b781a
commit
08bebaa426
10 changed files with 252 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "zeek/storage/backend/redis/Redis.h"
|
||||
|
||||
#include "zeek/DebugLogger.h"
|
||||
#include "zeek/Func.h"
|
||||
#include "zeek/RunState.h"
|
||||
#include "zeek/Val.h"
|
||||
|
@ -93,6 +94,8 @@ ErrorResult Redis::DoOpen(RecordValPtr options) {
|
|||
async_mode = options->GetField<BoolVal>("async_mode")->Get() && ! zeek::run_state::reading_traces;
|
||||
key_prefix = options->GetField<StringVal>("key_prefix")->ToStdString();
|
||||
|
||||
DBG_LOG(DBG_STORAGE, "Redis backend: running in async mode? %d", async_mode);
|
||||
|
||||
redisOptions opt = {0};
|
||||
|
||||
StringValPtr host = options->GetField<StringVal>("server_host");
|
||||
|
@ -341,6 +344,7 @@ void Redis::HandleEraseResult(redisReply* reply, ErrorResultCallback* callback)
|
|||
}
|
||||
|
||||
void Redis::OnConnect(int status) {
|
||||
DBG_LOG(DBG_STORAGE, "Redis backend: connection event");
|
||||
if ( status == REDIS_OK ) {
|
||||
connected = true;
|
||||
return;
|
||||
|
@ -350,6 +354,7 @@ void Redis::OnConnect(int status) {
|
|||
}
|
||||
|
||||
void Redis::OnDisconnect(int status) {
|
||||
DBG_LOG(DBG_STORAGE, "Redis backend: disconnection event");
|
||||
if ( status == REDIS_OK ) {
|
||||
// TODO: this was an intentional disconnect, nothing to do?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue