How to reproduce:
Build Flexisip with SNMP support
snmpset -m FLEXISIP-MIB -v 2c -c private localhost FLEXISIP-MIB::flexisipMIB.flexisip.module..0 s
Verify that log "Congiguration of module changed for key...." but module is not reloaded
Root cause:
bool dirtyConfig=false is local variable.
When doConfigStateChanged is called twice with Changed->Committed - old value of local variable 'dirtyConfig' is destroyed
Fix:
Make dirtyConfig flag as a Module class member.
This is the easiest but not perfect solution as it affects all 'derived' classes (need to recompile all modules)
Anyway I don't see acceptable fix for this without affecting public header "module.hh"
Better suggestions:
To avoid adding members to public classes, I'd recommend to use 'private implementation' approach for storing all 'Module' internals
How to reproduce: Build Flexisip with SNMP support
snmpset -m FLEXISIP-MIB -v 2c -c private localhost FLEXISIP-MIB::flexisipMIB.flexisip.module..0 s
Verify that log "Congiguration of module changed for key...." but module is not reloaded
Root cause:
bool dirtyConfig=false is local variable. When doConfigStateChanged is called twice with Changed->Committed - old value of local variable 'dirtyConfig' is destroyed
Fix:
Make dirtyConfig flag as a Module class member. This is the easiest but not perfect solution as it affects all 'derived' classes (need to recompile all modules) Anyway I don't see acceptable fix for this without affecting public header "module.hh"
Better suggestions:
To avoid adding members to public classes, I'd recommend to use 'private implementation' approach for storing all 'Module' internals