create internal interfaces for send and receive streams

And use those for handling frames.
This commit is contained in:
Marten Seemann
2017-12-26 10:44:56 +07:00
parent 7a3209b3a4
commit e802491a8f
13 changed files with 391 additions and 58 deletions

View File

@@ -12,6 +12,14 @@ import (
"github.com/lucas-clemente/quic-go/internal/wire"
)
type sendStreamI interface {
SendStream
handleStopSendingFrame(*wire.StopSendingFrame)
popStreamFrame(maxBytes protocol.ByteCount) (*wire.StreamFrame, bool)
closeForShutdown(error)
handleMaxStreamDataFrame(*wire.MaxStreamDataFrame)
}
type sendStream struct {
mutex sync.Mutex
@@ -41,6 +49,7 @@ type sendStream struct {
}
var _ SendStream = &sendStream{}
var _ sendStreamI = &sendStream{}
func newSendStream(
streamID protocol.StreamID,