mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 21:57:36 +03:00
parse RST_STREAM frames
This commit is contained in:
parent
7e65940188
commit
c69992cae4
5 changed files with 130 additions and 1 deletions
11
session.go
11
session.go
|
@ -101,7 +101,7 @@ func (s *Session) HandlePacket(addr *net.UDPAddr, publicHeaderBinary []byte, pub
|
|||
case 0x0: // PAD
|
||||
return nil
|
||||
case 0x01:
|
||||
err = errors.New("unimplemented: RST_STREAM")
|
||||
err = s.handleRstStreamFrame(r)
|
||||
case 0x02:
|
||||
err = s.handleConnectionCloseFrame(r)
|
||||
case 0x03:
|
||||
|
@ -198,6 +198,15 @@ func (s *Session) handleStopWaitingFrame(r *bytes.Reader, publicHeader *PublicHe
|
|||
return nil
|
||||
}
|
||||
|
||||
func (s *Session) handleRstStreamFrame(r *bytes.Reader) error {
|
||||
frame, err := frames.ParseRstStreamFrame(r)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Printf("%#v\n", frame)
|
||||
return nil
|
||||
}
|
||||
|
||||
// SendFrames sends a number of frames to the client
|
||||
func (s *Session) SendFrames(frames []frames.Frame) error {
|
||||
var framesData bytes.Buffer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue