Skip to content

Commit

Permalink
fix race condition causing spdystream deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
whyrusleeping committed Jun 10, 2015
1 parent 49dee11 commit 9fd42bb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions transport/spdystream/spdystream.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ func (c *conn) Serve(handler pst.StreamHandler) {
// -- at this moment -- not the solution. Either spdystream must
// change, or we must throttle another way. go-peerstream handles
// every new stream in its own goroutine.
go func() {
s.SendReply(http.Header{}, false)
handler((*stream)(s))
}()
s.SendReply(http.Header{}, false)
go handler((*stream)(s))
})
}

Expand Down

0 comments on commit 9fd42bb

Please sign in to comment.