limit number of packets stored in SentPacketHandler

fixes #140
This commit is contained in:
Marten Seemann
2016-05-24 16:06:48 +07:00
parent 931687e9a4
commit e2254f1bbd
7 changed files with 52 additions and 2 deletions

View File

@@ -463,6 +463,11 @@ func (s *Session) maybeSendPacket() error {
func (s *Session) sendPacket() error {
s.smallPacketDelayedOccurranceTime = time.Time{} // zero
err := s.sentPacketHandler.CheckForError()
if err != nil {
return err
}
if !s.sentPacketHandler.CongestionAllowsSending() {
return nil
}