forked from quic-go/quic-go
@@ -118,6 +118,7 @@ func (s *stream) Read(p []byte) (int, error) {
|
||||
s.readOffset += protocol.ByteCount(m)
|
||||
|
||||
s.flowControlManager.AddBytesRead(s.streamID, protocol.ByteCount(m))
|
||||
s.onData() // so that a possible WINDOW_UPDATE is sent
|
||||
|
||||
if s.readPosInFrame >= int(frame.DataLen()) {
|
||||
fin := frame.FinBit
|
||||
|
||||
@@ -288,6 +288,17 @@ var _ = Describe("Stream", func() {
|
||||
Expect(err).To(MatchError(errOverlappingStreamData))
|
||||
})
|
||||
|
||||
It("calls onData", func() {
|
||||
frame := frames.StreamFrame{
|
||||
Offset: 0,
|
||||
Data: []byte{0xDE, 0xAD, 0xBE, 0xEF},
|
||||
}
|
||||
str.AddStreamFrame(&frame)
|
||||
b := make([]byte, 4)
|
||||
_, err := str.Read(b)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(onDataCalled).To(BeTrue())
|
||||
})
|
||||
})
|
||||
|
||||
Context("writing", func() {
|
||||
|
||||
Reference in New Issue
Block a user