Log packet size before la and ra.

This commit is contained in:
scruzin 2019-01-20 09:20:56 +10:30
parent fbad21bc76
commit 04ad1fec25
1 changed files with 2 additions and 2 deletions

View File

@ -399,7 +399,7 @@ func (pkt *packet) writeTo(c *Conn, queue bool) error {
return nil
}
} else {
// Send previously deferrd packet if combining it with the next one would exceed the chunk size.
// Send previously deferred packet if combining it with the next one would exceed the chunk size.
if len(c.deferred)+size+hSize > chunkSize {
c.log(DebugLevel, pkg+"sending deferred packet separately", "size", len(c.deferred))
_, err := c.write(c.deferred)
@ -411,7 +411,7 @@ func (pkt *packet) writeTo(c *Conn, queue bool) error {
}
// TODO(kortschak): Rewrite this horrific peice of premature optimisation.
c.log(DebugLevel, pkg+"sending packet", "la", c.link.conn.LocalAddr(), "ra", c.link.conn.RemoteAddr(), "size", size)
c.log(DebugLevel, pkg+"sending packet", "size", size, "la", c.link.conn.LocalAddr(), "ra", c.link.conn.RemoteAddr())
for size+hSize != 0 {
if chunkSize > size {
chunkSize = size