(conf Config)
| 459 | } |
| 460 | |
| 461 | func (s *UdpServer) updateBaseConfig(conf Config) (err error) { |
| 462 | if s.config == nil { |
| 463 | s.config = &conf |
| 464 | s.log.SetLogLevel(conf.LogLevel) |
| 465 | return err |
| 466 | } |
| 467 | |
| 468 | // update |
| 469 | if s.config.LogLevel != conf.LogLevel { |
| 470 | log.Info("set base log level to %d", conf.LogLevel) |
| 471 | s.log.SetLogLevel(conf.LogLevel) |
| 472 | s.config.LogLevel = conf.LogLevel |
| 473 | } |
| 474 | |
| 475 | if s.config.DisableAgentValidation != conf.DisableAgentValidation { |
| 476 | if s.device != nil { |
| 477 | s.device.SetOption(core.DeviceOptions{ |
| 478 | DisableAgentPeerValidation: conf.DisableAgentValidation, |
| 479 | }) |
| 480 | } |
| 481 | s.config.DisableAgentValidation = conf.DisableAgentValidation |
| 482 | } |
| 483 | |
| 484 | if s.config.DefaultCipherScheme != conf.DefaultCipherScheme { |
| 485 | log.Info("set default cipher scheme to %d", conf.DefaultCipherScheme) |
| 486 | s.config.DefaultCipherScheme = conf.DefaultCipherScheme |
| 487 | } |
| 488 | |
| 489 | return err |
| 490 | } |
| 491 | |
| 492 | func (s *UdpServer) updateHttpConfig(httpConf HttpConfig) (err error) { |
| 493 | utils.CatchPanicThenRun(func() { |
no test coverage detected