MCPcopy Index your code
hub / github.com/coder/coder / Accept

Method Accept

agent/agentssh/jetbrainstrack.go:73–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71}
72
73func (w *JetbrainsChannelWatcher) Accept() (gossh.Channel, <-chan *gossh.Request, error) {
74 disconnected := w.reportConnection(uuid.New(), MagicSessionTypeJetBrains, w.originAddr)
75
76 c, r, err := w.NewChannel.Accept()
77 if err != nil {
78 disconnected(1, err.Error())
79 return c, r, err
80 }
81 w.jetbrainsCounter.Add(1)
82 // nolint: gocritic // JetBrains is a proper noun and should be capitalized
83 w.logger.Debug(context.Background(), "JetBrains watcher accepted channel")
84
85 return &ChannelOnClose{
86 Channel: c,
87 done: func() {
88 w.jetbrainsCounter.Add(-1)
89 disconnected(0, "normal close")
90 // nolint: gocritic // JetBrains is a proper noun and should be capitalized
91 w.logger.Debug(context.Background(), "JetBrains channel closed",
92 codersdk.ConnectionDirectionAgentToClient.SlogField(),
93 codersdk.DisconnectReasonGraceful.SlogField(),
94 codersdk.DisconnectReasonGraceful.SlogExpectedField(),
95 )
96 },
97 }, r, err
98}
99
100type ChannelOnClose struct {
101 gossh.Channel

Callers 15

startRejectingListenerFunction · 0.45
TestAgent_DialFunction · 0.45
echoOnceFunction · 0.45
createTailnetMethod · 0.45
acceptLoopMethod · 0.45
handleDesktopVNCMethod · 0.45
ServeMethod · 0.45
listenForConnectionsMethod · 0.45
HandleSSHRequestMethod · 0.45
directStreamLocalHandlerFunction · 0.45
TestServer_X11Function · 0.45

Calls 6

reportConnectionMethod · 0.80
SlogExpectedFieldMethod · 0.80
NewMethod · 0.65
AddMethod · 0.65
ErrorMethod · 0.45
SlogFieldMethod · 0.45

Tested by 5

startRejectingListenerFunction · 0.36
TestAgent_DialFunction · 0.36
echoOnceFunction · 0.36
TestServer_X11Function · 0.36