forked from quic-go/quic-go
remove Session.SendFrames
This commit is contained in:
11
session.go
11
session.go
@@ -205,17 +205,6 @@ func (s *Session) handleRstStreamFrame(r *bytes.Reader) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendFrames sends a number of frames to the client
|
|
||||||
func (s *Session) SendFrames(frames []frames.Frame) error {
|
|
||||||
for _, f := range frames {
|
|
||||||
err := s.SendFrame(f)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// SendFrame sends a frame to the client
|
// SendFrame sends a frame to the client
|
||||||
func (s *Session) SendFrame(frame frames.Frame) error {
|
func (s *Session) SendFrame(frame frames.Frame) error {
|
||||||
streamframe, ok := frame.(*frames.StreamFrame)
|
streamframe, ok := frame.(*frames.StreamFrame)
|
||||||
|
|||||||
@@ -68,12 +68,11 @@ func (s *Stream) ReadByte() (byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Stream) Write(p []byte) (int, error) {
|
func (s *Stream) Write(p []byte) (int, error) {
|
||||||
frame := &frames.StreamFrame{
|
err := s.Session.SendFrame(&frames.StreamFrame{
|
||||||
StreamID: s.StreamID,
|
StreamID: s.StreamID,
|
||||||
Offset: s.WriteOffset,
|
Offset: s.WriteOffset,
|
||||||
Data: p,
|
Data: p,
|
||||||
}
|
})
|
||||||
err := s.Session.SendFrames([]frames.Frame{frame})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@@ -81,6 +80,7 @@ func (s *Stream) Write(p []byte) (int, error) {
|
|||||||
return len(p), nil
|
return len(p), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Close imlpements io.Closer
|
||||||
func (s *Stream) Close() error {
|
func (s *Stream) Close() error {
|
||||||
return s.Session.SendFrame(&frames.StreamFrame{
|
return s.Session.SendFrame(&frames.StreamFrame{
|
||||||
StreamID: s.StreamID,
|
StreamID: s.StreamID,
|
||||||
|
|||||||
Reference in New Issue
Block a user