fix a race when multiple requests were handled at the same time

fixes #157
This commit is contained in:
Lucas Clemente
2016-05-31 19:05:33 +02:00
parent a7afffe700
commit 4b2ab55435
5 changed files with 24 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ package h2quic
import (
"bytes"
"net/http"
"sync"
"github.com/lucas-clemente/quic-go/protocol"
. "github.com/onsi/ginkgo"
@@ -29,7 +30,7 @@ var _ = Describe("Response Writer", func() {
BeforeEach(func() {
headerStream = &mockStream{}
dataStream = &mockStream{}
w = newResponseWriter(headerStream, dataStream, 5)
w = newResponseWriter(headerStream, &sync.Mutex{}, dataStream, 5)
})
It("writes status", func() {