diff --git a/example/main.go b/example/main.go index 0dee5ecc..e940e8a6 100644 --- a/example/main.go +++ b/example/main.go @@ -32,7 +32,7 @@ func main() { } } -func handleStream(stream *quic.Stream) []frames.Frame { +func handleStream(session *quic.Session, stream *quic.Stream) []frames.Frame { var reply bytes.Buffer h2framer := http2.NewFramer(&reply, stream) h2framer.ReadMetaHeaders = hpack.NewDecoder(1024, nil) diff --git a/session.go b/session.go index 21dcf921..69ad887d 100644 --- a/session.go +++ b/session.go @@ -13,7 +13,7 @@ import ( ) // StreamCallback gets a stream frame and returns a reply frame -type StreamCallback func(*Stream) []frames.Frame +type StreamCallback func(*Session, *Stream) []frames.Frame // A Session is a QUIC session type Session struct { @@ -156,7 +156,7 @@ func (s *Session) handleStreamFrame(r *bytes.Reader) error { } if !newStream { - replyFrames := s.streamCallback(stream) + replyFrames := s.streamCallback(s, stream) if replyFrames != nil { s.SendFrames(replyFrames) }