Added mutex to avoid concurrent writes

This commit is contained in:
Quentin Perez 2015-09-30 16:48:34 +02:00
parent 8f9d5ba582
commit 6500449916
2 changed files with 32 additions and 15 deletions

View file

@ -14,6 +14,7 @@ import (
"os/exec"
"strconv"
"strings"
"sync"
"text/template"
"github.com/braintree/manners"
@ -243,6 +244,7 @@ func (app *App) handleWS(w http.ResponseWriter, r *http.Request) {
connection: conn,
command: cmd,
pty: ptyIo,
writeMutex: &sync.Mutex{},
}
context.goHandleClient()