@@ -19,15 +19,15 @@ type localForwardChannelData struct {
19
19
OriginPort uint32
20
20
}
21
21
22
- // ChannelAcceptWatcher is used to track jetbrains port forwarding (gateway )
23
- // connections . If the port forward is something other than jetbrains , this
24
- // struct is a noop.
25
- type ChannelAcceptWatcher struct {
22
+ // JetbrainsChannelWatcher is used to track JetBrains port forwarded (Gateway )
23
+ // channels . If the port forward is something other than JetBrains , this struct
24
+ // is a noop.
25
+ type JetbrainsChannelWatcher struct {
26
26
gossh.NewChannel
27
27
jetbrainsCounter * atomic.Int64
28
28
}
29
29
30
- func NewChannelAcceptWatcher (ctx ssh.Context , logger slog.Logger , newChannel gossh.NewChannel , counter * atomic.Int64 ) gossh.NewChannel {
30
+ func NewJetbrainsChannelWatcher (ctx ssh.Context , logger slog.Logger , newChannel gossh.NewChannel , counter * atomic.Int64 ) gossh.NewChannel {
31
31
d := localForwardChannelData {}
32
32
if err := gossh .Unmarshal (newChannel .ExtraData (), & d ); err != nil {
33
33
// If the data fails to unmarshal, do nothing.
@@ -58,13 +58,13 @@ func NewChannelAcceptWatcher(ctx ssh.Context, logger slog.Logger, newChannel gos
58
58
logger .Debug (ctx , "discovered forwarded JetBrains process" ,
59
59
slog .F ("destination_port" , d .DestPort ))
60
60
61
- return & ChannelAcceptWatcher {
61
+ return & JetbrainsChannelWatcher {
62
62
NewChannel : newChannel ,
63
63
jetbrainsCounter : counter ,
64
64
}
65
65
}
66
66
67
- func (w * ChannelAcceptWatcher ) Accept () (gossh.Channel , <- chan * gossh.Request , error ) {
67
+ func (w * JetbrainsChannelWatcher ) Accept () (gossh.Channel , <- chan * gossh.Request , error ) {
68
68
c , r , err := w .NewChannel .Accept ()
69
69
if err != nil {
70
70
return c , r , err
0 commit comments