connect() now constructs its packet with a buf to avoid needless packet resizing later.

This commit is contained in:
scruzin 2019-01-20 08:52:58 +10:30
parent 969e2f4fa9
commit fbad21bc76
1 changed files with 3 additions and 1 deletions

View File

@ -186,8 +186,10 @@ func connect(c *Conn) error {
return err
}
c.log(DebugLevel, pkg+"negotiating")
var buf [256]byte
for !c.isPlaying {
pkt := packet{}
pkt := packet{buf: buf[:]}
err = pkt.readFrom(c)
if err != nil {
break