Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SPDY implementations MUST synchronize stream creation (all the way to writing the frame) as stream IDs **MUST** increase monotonically. There was already synchronization on ID creation, but if CreateStream was called from different goroutines, the calls could interleave before writing the actual frames to the wire, getting out of order. (This is _incorrect_ and should cause the other side to STREAM_RST.) We fix this by moving the s.nextIdLock.Lock() out into the CreateStream call itself. This way, the frame will be written before letting the next stream grab the ID and write the frame. There are probably better ways of doing this, but this minimizes changes. License: Apache 2 Signed-off-by: Juan Batiz-Benet <[email protected]>
- Loading branch information