mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Type: return IntrusivePtr
This commit is contained in:
parent
0a6ddfb6b5
commit
ba35ebec4c
38 changed files with 319 additions and 334 deletions
|
@ -449,16 +449,13 @@ bool Manager::IsDisabled(const analyzer::Tag& tag)
|
|||
disabled = internal_const_val("Files::disable")->AsTableVal();
|
||||
|
||||
Val* index = val_mgr->GetCount(bool(tag));
|
||||
Val* yield = disabled->Lookup(index);
|
||||
auto yield = disabled->Lookup(index);
|
||||
Unref(index);
|
||||
|
||||
if ( ! yield )
|
||||
return false;
|
||||
|
||||
bool rval = yield->AsBool();
|
||||
Unref(yield);
|
||||
|
||||
return rval;
|
||||
return yield->AsBool();
|
||||
}
|
||||
|
||||
Analyzer* Manager::InstantiateAnalyzer(const Tag& tag, RecordVal* args, File* f) const
|
||||
|
|
|
@ -11,9 +11,8 @@ module FileExtract;
|
|||
function FileExtract::__set_limit%(file_id: string, args: any, n: count%): bool
|
||||
%{
|
||||
using BifType::Record::Files::AnalyzerArgs;
|
||||
RecordVal* rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
|
||||
bool result = file_mgr->SetExtractionLimit(file_id->CheckString(), rv, n);
|
||||
Unref(rv);
|
||||
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
|
||||
bool result = file_mgr->SetExtractionLimit(file_id->CheckString(), rv.get(), n);
|
||||
return val_mgr->GetBool(result);
|
||||
%}
|
||||
|
||||
|
|
|
@ -523,9 +523,9 @@ X509Val::~X509Val()
|
|||
X509_free(certificate);
|
||||
}
|
||||
|
||||
Val* X509Val::DoClone(CloneState* state)
|
||||
IntrusivePtr<Val> X509Val::DoClone(CloneState* state)
|
||||
{
|
||||
auto copy = new X509Val();
|
||||
auto copy = make_intrusive<X509Val>();
|
||||
if ( certificate )
|
||||
copy->certificate = X509_dup(certificate);
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ public:
|
|||
*
|
||||
* @return A cloned X509Val.
|
||||
*/
|
||||
Val* DoClone(CloneState* state) override;
|
||||
IntrusivePtr<Val> DoClone(CloneState* state) override;
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
|
|
|
@ -42,10 +42,9 @@ function Files::__set_reassembly_buffer%(file_id: string, max: count%): bool
|
|||
function Files::__add_analyzer%(file_id: string, tag: Files::Tag, args: any%): bool
|
||||
%{
|
||||
using BifType::Record::Files::AnalyzerArgs;
|
||||
RecordVal* rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
|
||||
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
|
||||
bool result = file_mgr->AddAnalyzer(file_id->CheckString(),
|
||||
file_mgr->GetComponentTag(tag), rv);
|
||||
Unref(rv);
|
||||
file_mgr->GetComponentTag(tag), rv.get());
|
||||
return val_mgr->GetBool(result);
|
||||
%}
|
||||
|
||||
|
@ -53,10 +52,9 @@ function Files::__add_analyzer%(file_id: string, tag: Files::Tag, args: any%): b
|
|||
function Files::__remove_analyzer%(file_id: string, tag: Files::Tag, args: any%): bool
|
||||
%{
|
||||
using BifType::Record::Files::AnalyzerArgs;
|
||||
RecordVal* rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
|
||||
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
|
||||
bool result = file_mgr->RemoveAnalyzer(file_id->CheckString(),
|
||||
file_mgr->GetComponentTag(tag) , rv);
|
||||
Unref(rv);
|
||||
file_mgr->GetComponentTag(tag) , rv.get());
|
||||
return val_mgr->GetBool(result);
|
||||
%}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue