BelledonneCommunications / flexisip

Linphone.org mirror for flexisip (git://git.linphone.org/flexisip.git)
http://flexisip.org
GNU Affero General Public License v3.0
140 stars 68 forks source link

Module config update doesn't work as expected #89

Open mnosov opened 4 years ago

mnosov commented 4 years ago

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