code: func (r *Router) addServer(area *areaInfo, s *metadata.Server) error {
  	// Make the manager on the fly if this is the first we've seen of it,
  	// and add it to the index.
  	info, ok := area.managers[s.Datacenter]
  	if !ok {
  		shutdownCh := make(chan struct{})
  		manager := New(r.logger, shutdownCh, area.cluster, area.pinger)
  		info = &managerInfo{
  			manager:    manager,
  			shutdownCh: shutdownCh,
  		}
  		area.managers[s.Datacenter] = info
  
  		managers := r.managers[s.Datacenter]
  		r.managers[s.Datacenter] = append(managers, manager)
  		go manager.Start()
  	}
  
  	// If TLS is enabled for the area, set it on the server so the manager
  	// knows to use TLS when pinging it.
  	if area.useTLS {
  		s.UseTLS = true
  	}
  
  	info.manager.AddServer(s)
  	return nil
  }
docs: // addServer does the work of AddServer once the write lock is held.