diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-12-30 20:56:27 +0900 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-09 22:52:15 +0900 |
commit | d94bb930dc2778a39dd96050193743136a26fb0e (patch) | |
tree | 2eb3755fc82df74a28f433cf79b2ec2b7febd7d8 /server/bmp.go | |
parent | aff1c244ad0d88a814f2ce573800717ccd08b450 (diff) |
api: support bmp configuration
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/bmp.go')
-rw-r--r-- | server/bmp.go | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/server/bmp.go b/server/bmp.go index 90928acd..3f845b27 100644 --- a/server/bmp.go +++ b/server/bmp.go @@ -224,8 +224,10 @@ func (w *bmpWatcher) loop() error { case conn := <-w.endCh: host := conn.RemoteAddr().String() log.Debugf("bmp connection to %s killed", host) - w.connMap[host].conn = nil - go w.tryConnect(w.connMap[host]) + if _, y := w.connMap[host]; y { + w.connMap[host].conn = nil + go w.tryConnect(w.connMap[host]) + } } } } @@ -261,6 +263,16 @@ func (w *bmpWatcher) addServer(c config.BmpServerConfig) error { return <-ch } +func (w *bmpWatcher) deleteServer(c config.BmpServerConfig) error { + ch := make(chan error) + w.ctlCh <- &bmpConfig{ + config: c, + del: true, + errCh: ch, + } + return <-ch +} + func (w *bmpWatcher) watchingEventTypes() []watcherEventType { state := false pre := false |