remove unneeded check for nil packets in session.sendConnectionClose

This was needed when logic in the packet packer was a lot more
complicated. Now that packing a CONNECTION_CLOSE is a separate code
path, this check isn't needed anymore.
This commit is contained in:
Marten Seemann
2017-07-10 21:10:47 +08:00
parent 6973d71697
commit 1d120f5ea1

View File

@@ -704,9 +704,6 @@ func (s *session) sendConnectionClose(quicErr *qerr.QuicError) error {
if err != nil {
return err
}
if packet == nil {
return errors.New("Session BUG: expected packet not to be nil")
}
s.logPacket(packet)
return s.conn.Write(packet.raw)
}