forked from External/grumble
Use a RWMutex for server config locking instead of routing config gets and sets through Server#handler.
This commit is contained in:
parent
41f6af2334
commit
c785c45166
5 changed files with 62 additions and 61 deletions
|
|
@ -30,7 +30,7 @@ type ConfigValue struct {
|
|||
|
||||
// Set a config value
|
||||
func (c *ControlRPC) SetConfig(in *ConfigValue, out *ConfigValue) os.Error {
|
||||
servers[in.Id].SetConfig(in.Key, in.Value)
|
||||
servers[in.Id].cfg.Set(in.Key, in.Value)
|
||||
out.Id = in.Id
|
||||
out.Key = in.Key
|
||||
out.Value = in.Value
|
||||
|
|
@ -41,6 +41,6 @@ func (c *ControlRPC) SetConfig(in *ConfigValue, out *ConfigValue) os.Error {
|
|||
func (c *ControlRPC) GetConfig(in *ConfigValue, out *ConfigValue) os.Error {
|
||||
out.Id = in.Id
|
||||
out.Key = in.Key
|
||||
out.Value = servers[in.Id].GetConfig(in.Key)
|
||||
out.Value = servers[in.Id].cfg.StringValue(in.Key)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue