1
0
forked from lug/matterbridge

Update shazow/ssh-chat dependency (#947)

This commit is contained in:
Wim
2019-11-17 21:42:41 +01:00
committed by GitHub
parent 0917dc8766
commit d4253d7a55
17 changed files with 1518 additions and 16 deletions

View File

@@ -7,14 +7,17 @@ import (
"sync"
"time"
"github.com/shazow/ssh-chat/sshd/terminal"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/terminal"
)
var keepaliveInterval = time.Second * 30
var keepaliveRequest = "keepalive@ssh-chat"
// ErrNoSessionChannel is returned when there is no session channel.
var ErrNoSessionChannel = errors.New("no session channel")
// ErrNotSessionChannel is returned when a channel is not a session channel.
var ErrNotSessionChannel = errors.New("terminal requires session channel")
// Connection is an interface with fields necessary to operate an sshd host.
@@ -52,7 +55,7 @@ func (c sshConn) Name() string {
return c.User()
}
// Extending ssh/terminal to include a closer interface
// Terminal extends ssh/terminal to include a close method
type Terminal struct {
terminal.Terminal
Conn Connection
@@ -103,7 +106,7 @@ func NewTerminal(conn *ssh.ServerConn, ch ssh.NewChannel) (*Terminal, error) {
return &term, nil
}
// Find session channel and make a Terminal from it
// NewSession Finds a session channel and make a Terminal from it
func NewSession(conn *ssh.ServerConn, channels <-chan ssh.NewChannel) (*Terminal, error) {
// Make a terminal from the first session found
for ch := range channels {