pion / stun

A Go implementation of STUN
https://pion.ly/
MIT License
625 stars 94 forks source link

m.Raw allocate is to small #20

Closed newzai closed 5 years ago

newzai commented 5 years ago

Your environment.

What did you do?

What did you expect?

m.Raw = make([] byte, 2048)

What happened?

clinet.go readUntiClosed , the m.Raw allocate buffer 1024 is to small , some DTLS data is big ,more then 1024,will raise the data is lost by local memory,

Sean-Der commented 5 years ago

Hey @newzai Thanks for the issue!

For pion/ice we only use m.Raw if we know something is a STUN packet. https://github.com/pion/ice/blob/master/candidate_base.go#L103

Are you talking about the cmd/stun-multiplex example? If you want to increase the buffer size I am happy to approve the PR!

thanks for using Pion :)

Sean-Der commented 5 years ago

Hi @newzai

I am closing this issue since we haven't heard back from you. Please re-open if this is still an issue!

Thanks for using Pion :)