Skip to content

Commit

Permalink
client/lxd/instances: Consume ping messages from server for exec cont…
Browse files Browse the repository at this point in the history
…rol and stdin channels

Signed-off-by: Thomas Parrott <[email protected]>
  • Loading branch information
tomponline committed Nov 23, 2023
1 parent da237eb commit d654ae6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/lxd_instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,10 @@ func (r *ProtocolLXD) ExecInstance(instanceName string, exec api.InstanceExecPos
return nil, err
}

go func() {
_, _, _ = conn.ReadMessage() // Consume pings from server.
}()

go args.Control(conn)
}

Expand Down Expand Up @@ -1249,6 +1253,10 @@ func (r *ProtocolLXD) ExecInstance(instanceName string, exec api.InstanceExecPos
return nil, err
}

go func() {
_, _, _ = conn.ReadMessage() // Consume pings from server.
}()

conns = append(conns, conn)
dones[0] = ws.MirrorRead(conn, args.Stdin)
}
Expand Down

0 comments on commit d654ae6

Please sign in to comment.