mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-21 23:10:06 +00:00
CPunch
670d4a514c
this fixes a race condition where if 2 goroutines try to send a packet at the same time, they could end up being malformed due to the 2 separate calls to peer.conn.Write(). instead of writing the packet size to peer.conn.Write() directly, we make space in buf for the packet size, and patch it in place. this lets us get away with only having 1 call to peer.conn.Write() which will ensure that the full packet is written properly and be goroutine safe :3 |
||
---|---|---|
.. | ||
pool | ||
cnpeer.go | ||
encrypt.go | ||
event.go | ||
packet.go | ||
structs.go |