Skip to content

Commit

Permalink
Add missing mutex RLock
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Merrony committed Aug 13, 2018
1 parent c926f75 commit 68cb144
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tello.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ func (tello *Tello) controlResponseListener() {
n, err := tello.ctrlConn.Read(buff)

// the initial connect response is different...
if tello.ctrlConnecting && n == 11 {
tello.ctrlMu.RLock()
connecting := tello.ctrlConnecting
tello.ctrlMu.RUnlock()
if connecting && n == 11 {
if bytes.ContainsAny(buff, "conn_ack:") {
// TODO handle returned video port?
//log.Printf("Debug: conn_ack received, buffer len: %d\n", n)
Expand Down

0 comments on commit 68cb144

Please sign in to comment.