MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / OnAgentClosed

Method OnAgentClosed

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

OnAgentClosed is called when the agent sends rdp_proxy_closed. Two cases: - Handshake never completed: the signal unblocks ServeCreateTicket with a failure. The "Agent closed..." text is only ever surfaced here. - Handshake already completed: readyOnce drops the failure signal (the stored result sta

(apiID string, sessionID string)

Source from the content-addressed store, hash-verified

374// stored result stays Connected=true); cleanup still runs to close the
375// TCP bridge. This is the normal end-of-session path.
376func (s *Sessions) OnAgentClosed(apiID string, sessionID string) {
377 s.mu.RLock()
378 sess, ok := s.sessions[sessionID]
379 s.mu.RUnlock()
380 if !ok || sess.ApiID != apiID {
381 return
382 }
383 sess.signalAgentReady(AgentResult{Connected: false, ErrorMsg: "Agent closed the RDP proxy connection"})
384 sess.cleanup()
385}
386
387// WaitAgentReady waits for the initial handshake on the named session.
388func (s *Sessions) WaitAgentReady(ctx context.Context, sessionID string, timeout time.Duration) (AgentResult, error) {

Callers 1

HandleRDPProxyMessageMethod · 0.80

Calls 2

signalAgentReadyMethod · 0.80
cleanupMethod · 0.80

Tested by

no test coverage detected