mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
change StreamCallback to include the session
This commit is contained in:
parent
57b144bdef
commit
07e7708506
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue