mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 17:18:20 +00:00
Tweaks to result handling to make things a little more sane.
This commit is contained in:
parent
2446a942e0
commit
1a456cf9f7
1 changed files with 10 additions and 3 deletions
13
src/Func.cc
13
src/Func.cc
|
@ -274,16 +274,23 @@ Val* Func::HandlePluginResult(Val* plugin_result, val_list* args, function_flavo
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( plugin_result->Type()->Tag() != yt->Tag() )
|
if ( plugin_result->Type()->Tag() != yt->Tag() && yt->Tag() != TYPE_ANY)
|
||||||
reporter->InternalError("plugin returned wrong type for function call");
|
{
|
||||||
}
|
char sbuf[1024];
|
||||||
|
snprintf(sbuf, 1024, "plugin returned wrong type (got %d, expecting %d) for %s", plugin_result->Type()->Tag(), yt->Tag(), this->Name());
|
||||||
|
reporter->InternalError(sbuf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Let the plugin handle the reference counting
|
||||||
loop_over_list(*args, i)
|
loop_over_list(*args, i)
|
||||||
Unref((*args)[i]);
|
Unref((*args)[i]);
|
||||||
|
*/
|
||||||
|
|
||||||
return plugin_result;
|
return plugin_result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue