mirror of
https://github.com/yudai/gotty.git
synced 2026-01-20 00:06:10 +01:00
bug: fix issues w/ closed connection not closing running process
This commit is contained in:
parent
71b9db14e2
commit
c830287cb0
4 changed files with 12 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package localcommand
|
||||
|
||||
import (
|
||||
"context"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
|
|
@ -38,12 +39,12 @@ func (factory *Factory) Name() string {
|
|||
return "local command"
|
||||
}
|
||||
|
||||
func (factory *Factory) New(params map[string][]string, conn *websocket.Conn) (server.Slave, error) {
|
||||
func (factory *Factory) New(ctx context.Context, params map[string][]string, conn *websocket.Conn) (server.Slave, error) {
|
||||
argv := make([]string, len(factory.argv))
|
||||
copy(argv, factory.argv)
|
||||
if params["arg"] != nil && len(params["arg"]) > 0 {
|
||||
if len(params["arg"]) > 0 {
|
||||
argv = append(argv, params["arg"]...)
|
||||
}
|
||||
|
||||
return New(factory.command, argv, factory.opts...)
|
||||
return New(ctx, factory.command, argv, factory.opts...)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue