mirror of
https://github.com/yudai/gotty.git
synced 2026-01-09 02:58:50 +01:00
webtty: upgrade Run to use an errgroup to join 2 i/o routines
This commit is contained in:
parent
c830287cb0
commit
b5d904cb14
4 changed files with 52 additions and 41 deletions
|
|
@ -165,8 +165,11 @@ func (server *Server) processWSConn(ctx context.Context, conn *websocket.Conn) e
|
|||
}
|
||||
|
||||
err = tty.Run(ctx)
|
||||
if err != nil && !errors.Is(err, context.Canceled) {
|
||||
return err
|
||||
}
|
||||
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
func (server *Server) handleIndex(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue