@ -832,7 +832,7 @@ func (s *Server) serveMap(w http.ResponseWriter, r *http.Request, mkey key.Machi
w . WriteHeader ( 200 )
w . WriteHeader ( 200 )
for {
for {
if resBytes , ok := s . takeRawMapMessage ( req . NodeKey ) ; ok {
if resBytes , ok := s . takeRawMapMessage ( req . NodeKey ) ; ok {
if err := s . sendMapMsg ( w , mkey, compress, resBytes ) ; err != nil {
if err := s . sendMapMsg ( w , compress, resBytes ) ; err != nil {
s . logf ( "sendMapMsg of raw message: %v" , err )
s . logf ( "sendMapMsg of raw message: %v" , err )
return
return
}
}
@ -864,7 +864,7 @@ func (s *Server) serveMap(w http.ResponseWriter, r *http.Request, mkey key.Machi
s . logf ( "json.Marshal: %v" , err )
s . logf ( "json.Marshal: %v" , err )
return
return
}
}
if err := s . sendMapMsg ( w , mkey, compress, resBytes ) ; err != nil {
if err := s . sendMapMsg ( w , compress, resBytes ) ; err != nil {
return
return
}
}
}
}
@ -895,7 +895,7 @@ func (s *Server) serveMap(w http.ResponseWriter, r *http.Request, mkey key.Machi
}
}
break keepAliveLoop
break keepAliveLoop
case <- keepAliveTimerCh :
case <- keepAliveTimerCh :
if err := s . sendMapMsg ( w , mkey, compress, keepAliveMsg ) ; err != nil {
if err := s . sendMapMsg ( w , compress, keepAliveMsg ) ; err != nil {
return
return
}
}
}
}
@ -1060,7 +1060,7 @@ func (s *Server) takeRawMapMessage(nk key.NodePublic) (mapResJSON []byte, ok boo
return mapResJSON , true
return mapResJSON , true
}
}
func ( s * Server ) sendMapMsg ( w http . ResponseWriter , mkey key . MachinePublic , compress bool , msg any ) error {
func ( s * Server ) sendMapMsg ( w http . ResponseWriter , compress bool , msg any ) error {
resBytes , err := s . encode ( compress , msg )
resBytes , err := s . encode ( compress , msg )
if err != nil {
if err != nil {
return err
return err