keep track of highest byte received in FlowController

ref #39
This commit is contained in:
Marten Seemann
2016-05-18 09:32:36 +07:00
parent d6ef71a54c
commit daeb601cdc
3 changed files with 30 additions and 5 deletions

View File

@@ -203,7 +203,8 @@ func (s *stream) Close() error {
// AddStreamFrame adds a new stream frame
func (s *stream) AddStreamFrame(frame *frames.StreamFrame) error {
maxOffset := frame.Offset + protocol.ByteCount(len(frame.Data))
if s.flowController.CheckFlowControlViolation(maxOffset) {
s.flowController.UpdateHighestReceived(maxOffset)
if s.flowController.CheckFlowControlViolation() {
return errFlowControlViolation
}