mirror of https://gogs.blitter.com/RLabs/xs
Merge branch 'keepalive-only-shellmode' of RLabs/xs into master
This commit is contained in:
commit
8c1f90aaff
8
xs/xs.go
8
xs/xs.go
|
@ -1078,10 +1078,6 @@ func main() { //nolint: funlen, gocyclo
|
||||||
fmt.Fprintln(os.Stderr, rejectUserMsg())
|
fmt.Fprintln(os.Stderr, rejectUserMsg())
|
||||||
rec.SetStatus(GeneralProtocolErr)
|
rec.SetStatus(GeneralProtocolErr)
|
||||||
} else {
|
} else {
|
||||||
// === Set up connection keepalive to server
|
|
||||||
conn.StartupKeepAlive() // goroutine, returns immediately
|
|
||||||
defer conn.ShutdownKeepAlive()
|
|
||||||
|
|
||||||
// === Set up chaffing to server
|
// === Set up chaffing to server
|
||||||
conn.SetupChaff(chaffFreqMin, chaffFreqMax, chaffBytesMax) // enable client->server chaffing
|
conn.SetupChaff(chaffFreqMin, chaffFreqMax, chaffBytesMax) // enable client->server chaffing
|
||||||
if chaffEnabled {
|
if chaffEnabled {
|
||||||
|
@ -1112,6 +1108,10 @@ func main() { //nolint: funlen, gocyclo
|
||||||
|
|
||||||
// === Session entry (shellMode or copyMode)
|
// === Session entry (shellMode or copyMode)
|
||||||
if shellMode {
|
if shellMode {
|
||||||
|
// === Set up connection keepalive to server
|
||||||
|
conn.StartupKeepAlive() // goroutine, returns immediately
|
||||||
|
defer conn.ShutdownKeepAlive()
|
||||||
|
|
||||||
// === (shell) launch tunnels
|
// === (shell) launch tunnels
|
||||||
launchTuns(&conn /*remoteHost,*/, tunSpecStr)
|
launchTuns(&conn /*remoteHost,*/, tunSpecStr)
|
||||||
doShellMode(isInteractive, &conn, oldState, rec)
|
doShellMode(isInteractive, &conn, oldState, rec)
|
||||||
|
|
10
xsd/xsd.go
10
xsd/xsd.go
|
@ -121,10 +121,6 @@ func runClientToServerCopyAs(who, ttype string, conn *xsnet.Conn, fpath string,
|
||||||
c.Stdout = os.Stdout
|
c.Stdout = os.Stdout
|
||||||
c.Stderr = os.Stderr
|
c.Stderr = os.Stderr
|
||||||
|
|
||||||
// === Set up connection keepalive to client
|
|
||||||
conn.StartupKeepAlive() // goroutine, returns immediately
|
|
||||||
defer conn.ShutdownKeepAlive()
|
|
||||||
|
|
||||||
if chaffing {
|
if chaffing {
|
||||||
conn.StartupChaff()
|
conn.StartupChaff()
|
||||||
}
|
}
|
||||||
|
@ -221,10 +217,6 @@ func runServerToClientCopyAs(who, ttype string, conn *xsnet.Conn, srcPath string
|
||||||
c.Stderr = stdErrBuffer
|
c.Stderr = stdErrBuffer
|
||||||
//c.Stderr = nil
|
//c.Stderr = nil
|
||||||
|
|
||||||
// === Set up connection keepalive to client
|
|
||||||
conn.StartupKeepAlive() // goroutine, returns immediately
|
|
||||||
defer conn.ShutdownKeepAlive()
|
|
||||||
|
|
||||||
if chaffing {
|
if chaffing {
|
||||||
conn.StartupChaff()
|
conn.StartupChaff()
|
||||||
}
|
}
|
||||||
|
@ -380,11 +372,11 @@ func runShellAs(who, hname, ttype, cmd string, interactive bool, //nolint:funlen
|
||||||
|
|
||||||
if chaffing {
|
if chaffing {
|
||||||
conn.StartupChaff()
|
conn.StartupChaff()
|
||||||
}
|
|
||||||
// #gv:s/label=\"runShellAs\$4\"/label=\"deferChaffShutdown\"/
|
// #gv:s/label=\"runShellAs\$4\"/label=\"deferChaffShutdown\"/
|
||||||
defer func() {
|
defer func() {
|
||||||
conn.ShutdownChaff()
|
conn.ShutdownChaff()
|
||||||
}()
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
// ..and the pty to stdout.
|
// ..and the pty to stdout.
|
||||||
// This may take some time exceeding that of the
|
// This may take some time exceeding that of the
|
||||||
|
|
Loading…
Reference in New Issue