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 ZM_PLUGINS_ON
|
||||||
if ( purpose == ANALYSIS || purpose == QUERY )
|
if ( config.load_plugins && ( ( purpose == ANALYSIS ) || ( purpose == QUERY_PLUGINS ) ) )
|
||||||
{
|
|
||||||
if ( config.load_plugins || purpose == QUERY )
|
|
||||||
{
|
{
|
||||||
Info("Load plugins from the directory %s ... ", config.path_plugins);
|
Info("Load plugins from the directory %s ... ", config.path_plugins);
|
||||||
ThePluginManager.setPluginExt(std::string(config.plugin_extension));
|
ThePluginManager.setPluginExt(std::string(config.plugin_extension));
|
||||||
|
@ -458,12 +456,11 @@ Monitor::Monitor(
|
||||||
(!config.turnoff_native_analysis && iDoNativeMotDet));
|
(!config.turnoff_native_analysis && iDoNativeMotDet));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif // ZM_PLUGINS_ON
|
#endif // ZM_PLUGINS_ON
|
||||||
|
|
||||||
if ( ( ! mem_ptr ) || ! shared_data->valid )
|
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 );
|
Error( "Shared data not initialised by capture daemon for monitor %s", name );
|
||||||
exit( -1 );
|
exit( -1 );
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
QUERY=0,
|
QUERY=0,
|
||||||
|
QUERY_PLUGINS,
|
||||||
CAPTURE,
|
CAPTURE,
|
||||||
ANALYSIS
|
ANALYSIS
|
||||||
} Purpose;
|
} Purpose;
|
||||||
|
|
10
src/zmu.cpp
10
src/zmu.cpp
|
@ -426,7 +426,15 @@ int main( int argc, char *argv[] )
|
||||||
|
|
||||||
if ( mon_id > 0 )
|
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 ( monitor )
|
||||||
{
|
{
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
|
|
Loading…
Reference in New Issue