implement a context for the stream

The context is cancelled when the write-side of the stream is closed.
This commit is contained in:
Marten Seemann
2017-07-29 09:18:33 +07:00
parent e02f5d5fbe
commit 8ef69143ba
5 changed files with 55 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package h2quic
import (
"bytes"
"context"
"io"
"net/http"
"sync"
@@ -37,6 +38,7 @@ func (s *mockStream) Close() error { s.closed = true; r
func (s *mockStream) Reset(error) { s.reset = true }
func (s *mockStream) CloseRemote(offset protocol.ByteCount) { s.remoteClosed = true }
func (s mockStream) StreamID() protocol.StreamID { return s.id }
func (s *mockStream) Context() context.Context { panic("not implemented") }
func (s *mockStream) SetDeadline(time.Time) error { panic("not implemented") }
func (s *mockStream) SetReadDeadline(time.Time) error { panic("not implemented") }
func (s *mockStream) SetWriteDeadline(time.Time) error { panic("not implemented") }