X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fnncp%2Fcfg.go;h=3a642f68567ff4487630dab5e3b96b676d5cba34;hb=b4c6e5230f3bec679ceb9ca4207da08f7e9c53aa;hp=3400ed83a93e7d850f85da7b47653497592e14a9;hpb=093f249044a62ce4d988542c7267caf1da5d0968;p=nncp.git diff --git a/src/cypherpunks.ru/nncp/cfg.go b/src/cypherpunks.ru/nncp/cfg.go index 3400ed8..3a642f6 100644 --- a/src/cypherpunks.ru/nncp/cfg.go +++ b/src/cypherpunks.ru/nncp/cfg.go @@ -64,7 +64,7 @@ type NodeYAML struct { type CallYAML struct { Cron string Nice *int `nice,omitempty` - Xx *string `xx,omitempty` + Xx string `xx,omitempty` Addr *string `addr,omitempty` OnlineDeadline *uint `onlinedeadline,omitempty` MaxOnlineTime *uint `maxonlinetime,omitempty` @@ -187,15 +187,14 @@ func NewNode(name string, yml NodeYAML) (*Node, error) { nice = uint8(*callYml.Nice) } var xx TRxTx - if callYml.Xx != nil { - switch *callYml.Xx { - case "rx": - xx = TRx - case "tx": - xx = TTx - default: - return nil, errors.New("xx field must be either \"rx\" or \"tx\"") - } + switch callYml.Xx { + case "rx": + xx = TRx + case "tx": + xx = TTx + case "": + default: + return nil, errors.New("xx field must be either \"rx\" or \"tx\"") } var addr *string if callYml.Addr != nil { @@ -219,7 +218,7 @@ func NewNode(name string, yml NodeYAML) (*Node, error) { calls = append(calls, &Call{ Cron: expr, Nice: nice, - Xx: &xx, + Xx: xx, Addr: addr, OnlineDeadline: onlineDeadline, MaxOnlineTime: maxOnlineTime,