mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
Cleaner fix for issues #22,#33
This commit is contained in:
parent
9ca5ccae32
commit
5ee09de99a
3 changed files with 14 additions and 16 deletions
13
xsd/xsd.go
13
xsd/xsd.go
|
@ -327,16 +327,6 @@ func runShellAs(who, hname, ttype, cmd string, interactive bool, //nolint:funlen
|
|||
// #gv:s/label=\"runShellAs\$1\"/label=\"deferPtmxClose\"/
|
||||
defer func() {
|
||||
//logger.LogDebug(fmt.Sprintf("[Exited process was %d]", c.Process.Pid))
|
||||
|
||||
//Ensure socket has sent all data to client prior to closing
|
||||
//NOTE: This is not ideal, as it would be better to somehow
|
||||
//determine if there is any pending outgoing (write) data to the
|
||||
//underlying socket (TCP/KCP) prior to closing; however Go's net pkg
|
||||
//completely hides lower-level stuff. net.Conn.Close() according to
|
||||
//docs sends written data in the background, so how best to determine
|
||||
//all data has been sent? -rlm 2022-10-04
|
||||
|
||||
time.Sleep(100 * time.Millisecond) //Empirically determined :^/
|
||||
_ = ptmx.Close()
|
||||
}()
|
||||
|
||||
|
@ -869,9 +859,6 @@ func main() { //nolint:funlen,gocyclo
|
|||
// Returned hopefully via an EOF or exit/logout;
|
||||
logger.LogNotice(fmt.Sprintf("[s->c copy completed for %s@%s, status %d]\n", rec.Who(), hname, cmdStatus)) //nolint:errcheck
|
||||
}
|
||||
// HACK: Bug #22: (xc) Need to wait for rcvr to get final data
|
||||
// TODO: Await specific msg from client to inform they have gotten all data from the tarpipe
|
||||
time.Sleep(900 * time.Millisecond) //nolint:gomnd // Let rcvr set this on setup?
|
||||
|
||||
// Clear current op so user can enter next, or EOF
|
||||
rec.SetOp([]byte{0})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue