MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / OnAgentError

Method OnAgentError

server-source-code/internal/rdpproxy/session.go:356–368  ·  view source on GitHub ↗

OnAgentError is called when the agent sends rdp_proxy_error. The agent's human-readable message is preserved so the API layer can surface it to the client (e.g. "enable rdp-proxy-enabled: true", "Failed to connect to 3389").

(apiID string, sessionID string, message string)

Source from the content-addressed store, hash-verified

354// human-readable message is preserved so the API layer can surface it to the
355// client (e.g. "enable rdp-proxy-enabled: true", "Failed to connect to 3389").
356func (s *Sessions) OnAgentError(apiID string, sessionID string, message string) {
357 s.mu.RLock()
358 sess, ok := s.sessions[sessionID]
359 s.mu.RUnlock()
360 if !ok || sess.ApiID != apiID {
361 return
362 }
363 sess.signalAgentReady(AgentResult{Connected: false, ErrorMsg: message})
364 if s.log != nil {
365 s.log.Info("rdp proxy agent error", "session_id", sessionID, "api_id", apiID, "message", message)
366 }
367 sess.cleanup()
368}
369
370// OnAgentClosed is called when the agent sends rdp_proxy_closed. Two cases:
371// - Handshake never completed: the signal unblocks ServeCreateTicket with a

Callers 1

HandleRDPProxyMessageMethod · 0.80

Calls 2

signalAgentReadyMethod · 0.80
cleanupMethod · 0.80

Tested by

no test coverage detected