Only load plugins when it is necessary
This commit is contained in:
parent
cdfb4b4bb5
commit
8619ed1322
|
@ -433,9 +433,7 @@ Monitor::Monitor(
|
|||
}
|
||||
|
||||
#if ZM_PLUGINS_ON
|
||||
if ( purpose == ANALYSIS || purpose == QUERY )
|
||||
{
|
||||
if ( config.load_plugins || purpose == QUERY )
|
||||
if ( config.load_plugins && ( ( purpose == ANALYSIS ) || ( purpose == QUERY_PLUGINS ) ) )
|
||||
{
|
||||
Info("Load plugins from the directory %s ... ", config.path_plugins);
|
||||
ThePluginManager.setPluginExt(std::string(config.plugin_extension));
|
||||
|
@ -458,12 +456,11 @@ Monitor::Monitor(
|
|||
(!config.turnoff_native_analysis && iDoNativeMotDet));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // ZM_PLUGINS_ON
|
||||
|
||||
if ( ( ! mem_ptr ) || ! shared_data->valid )
|
||||
{
|
||||
if ( purpose != QUERY )
|
||||
if ( ( purpose != QUERY ) && ( purpose != QUERY_PLUGINS ) )
|
||||
{
|
||||
Error( "Shared data not initialised by capture daemon for monitor %s", name );
|
||||
exit( -1 );
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
typedef enum
|
||||
{
|
||||
QUERY=0,
|
||||
QUERY_PLUGINS,
|
||||
CAPTURE,
|
||||
ANALYSIS
|
||||
} Purpose;
|
||||
|
|
10
src/zmu.cpp
10
src/zmu.cpp
|
@ -426,7 +426,15 @@ int main( int argc, char *argv[] )
|
|||
|
||||
if ( mon_id > 0 )
|
||||
{
|
||||
Monitor *monitor = Monitor::Load( mon_id, function&(ZMU_QUERY|ZMU_ZONES|ZMU_LIST_PLUG), Monitor::QUERY );
|
||||
Monitor *monitor;
|
||||
if ( function & ZMU_LIST_PLUG )
|
||||
{
|
||||
monitor = Monitor::Load( mon_id, false, Monitor::QUERY_PLUGINS );
|
||||
}
|
||||
else
|
||||
{
|
||||
monitor = Monitor::Load( mon_id, function&(ZMU_QUERY|ZMU_ZONES), Monitor::QUERY );
|
||||
}
|
||||
if ( monitor )
|
||||
{
|
||||
if ( verbose )
|
||||
|
|
Loading…
Reference in New Issue