forked from quic-go/quic-go
Added session context to http.Request
This commit is contained in:
@@ -83,7 +83,7 @@ func (w *responseWriter) Write(p []byte) (int, error) {
|
||||
|
||||
func (w *responseWriter) Flush() {}
|
||||
|
||||
// TODO: Implement a functional CloseNotify method.
|
||||
// This is a NOP. Use http.Request.Context
|
||||
func (w *responseWriter) CloseNotify() <-chan bool { return make(<-chan bool) }
|
||||
|
||||
// test that we implement http.Flusher
|
||||
|
||||
@@ -170,6 +170,7 @@ func (s *Server) handleRequest(session streamCreator, headerStream quic.Stream,
|
||||
return err
|
||||
}
|
||||
|
||||
req.WithContext(session.Context())
|
||||
req.RemoteAddr = session.RemoteAddr().String()
|
||||
|
||||
if utils.Debug() {
|
||||
|
||||
@@ -65,7 +65,9 @@ func (s *mockSession) LocalAddr() net.Addr {
|
||||
func (s *mockSession) RemoteAddr() net.Addr {
|
||||
return &net.UDPAddr{IP: []byte{127, 0, 0, 1}, Port: 42}
|
||||
}
|
||||
func (s *mockSession) Context() context.Context { panic("not implemented") }
|
||||
func (s *mockSession) Context() context.Context {
|
||||
return context.Background()
|
||||
}
|
||||
|
||||
var _ = Describe("H2 server", func() {
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user