SetOption runs a functional option against the server.
(option Option)
| 377 | |
| 378 | // SetOption runs a functional option against the server. |
| 379 | func (srv *Server) SetOption(option Option) error { |
| 380 | // NOTE: there is a potential race here for any option that doesn't call an |
| 381 | // internal method. We can't actually lock here because if something calls |
| 382 | // (as an example) AddHostKey, it will deadlock. |
| 383 | |
| 384 | //srv.mu.Lock() |
| 385 | //defer srv.mu.Unlock() |
| 386 | |
| 387 | return option(srv) |
| 388 | } |
| 389 | |
| 390 | func (srv *Server) getDoneChan() <-chan struct{} { |
| 391 | srv.mu.Lock() |
no outgoing calls