Deprecate RecordVal::Lookup(const char*, bool)

Replace with GetField(const char*) and GetFieldOrDefault(const char*).
This commit is contained in:
Jon Siwek 2020-05-19 21:09:40 -07:00
parent 2b4d80c849
commit 5bf2ed02d7
14 changed files with 128 additions and 80 deletions

View file

@ -21,8 +21,8 @@ DataEvent::DataEvent(RecordVal* args, File* file,
file_analysis::Analyzer* DataEvent::Instantiate(RecordVal* args, File* file)
{
auto chunk_val = args->Lookup("chunk_event");
auto stream_val = args->Lookup("stream_event");
const auto& chunk_val = args->GetField("chunk_event");
const auto& stream_val = args->GetField("stream_event");
if ( ! chunk_val && ! stream_val ) return nullptr;

View file

@ -32,9 +32,9 @@ Extract::~Extract()
safe_close(fd);
}
static IntrusivePtr<Val> get_extract_field_val(RecordVal* args, const char* name)
static const IntrusivePtr<Val>& get_extract_field_val(RecordVal* args, const char* name)
{
auto rval = args->Lookup(name);
const auto& rval = args->GetField(name);
if ( ! rval )
reporter->Error("File extraction analyzer missing arg field: %s", name);
@ -44,8 +44,8 @@ static IntrusivePtr<Val> get_extract_field_val(RecordVal* args, const char* name
file_analysis::Analyzer* Extract::Instantiate(RecordVal* args, File* file)
{
auto fname = get_extract_field_val(args, "extract_filename");
auto limit = get_extract_field_val(args, "extract_limit");
const auto& fname = get_extract_field_val(args, "extract_filename");
const auto& limit = get_extract_field_val(args, "extract_limit");
if ( ! fname || ! limit )
return nullptr;

View file

@ -32,16 +32,6 @@ using namespace file_analysis;
#define OCSP_STRING_BUF_SIZE 2048
static IntrusivePtr<Val> get_ocsp_type(RecordVal* args, const char* name)
{
auto rval = args->Lookup(name);
if ( ! rval )
reporter->Error("File extraction analyzer missing arg field: %s", name);
return rval;
}
static bool OCSP_RESPID_bio(OCSP_BASICRESP* basic_resp, BIO* bio)
{
#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER)