Merge pull request #68 from QuentinPerez/mutex

Added mutex to avoid concurrent writes
This commit is contained in:
Iwasaki Yudai 2015-09-30 12:32:50 -07:00
commit 096f77c780
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()