mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
checking if fromNode is specified for startup messages
This commit is contained in:
parent
82303510cf
commit
55c5560361
1 changed files with 8 additions and 2 deletions
|
@ -78,9 +78,15 @@ func (s *server) readStartupFolder() {
|
|||
|
||||
// Check if fromNode field is specified, and remove the message if blank.
|
||||
for i := range sams {
|
||||
if sams[i].Message.FromNode == "" {
|
||||
switch {
|
||||
case sams[i].Message.FromNode == "":
|
||||
sams = append(sams[:i], sams[i+1:]...)
|
||||
er := fmt.Errorf(" error: missing fromNode field in startup message, discaring message")
|
||||
er := fmt.Errorf(" error: missing value in fromNode field in startup message, discarding message")
|
||||
s.errorKernel.errSend(s.processInitial, Message{}, er)
|
||||
|
||||
case sams[i].Message.ToNode == "" && len(sams[i].Message.ToNodes) == 0:
|
||||
sams = append(sams[:i], sams[i+1:]...)
|
||||
er := fmt.Errorf(" error: missing value in both toNode and toNodes fields in startup message, discarding message")
|
||||
s.errorKernel.errSend(s.processInitial, Message{}, er)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue