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)
| 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"). |
| 356 | func (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 |
no test coverage detected