aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli2017-01-18 21:33:55 +0100
committerFabio Alessandrelli2017-03-22 21:05:27 +0100
commit7dbccc9a57c7579be7f3edcf99b35cf4804b4723 (patch)
treefbd40c9379ba675cb9afe10d1fc266b31c1ae192
parentcab9ad76570760f170ae15026b57b2dcfe6431ff (diff)
downloadgodot-7dbccc9a57c7579be7f3edcf99b35cf4804b4723.tar.gz
godot-7dbccc9a57c7579be7f3edcf99b35cf4804b4723.tar.zst
godot-7dbccc9a57c7579be7f3edcf99b35cf4804b4723.zip
Fix bug causing UDP socket to close after the first send if not listening
The ring buffer for receiving packets was not resized in constructor (cherry picked from commit 68dc969f8ca242d0c4f927a417557288e4b1b75f)
-rw-r--r--drivers/unix/packet_peer_udp_posix.cpp1
-rw-r--r--platform/windows/packet_peer_udp_winsock.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp
index 4040aaaf4..4e48e8350 100644
--- a/drivers/unix/packet_peer_udp_posix.cpp
+++ b/drivers/unix/packet_peer_udp_posix.cpp
@@ -269,6 +269,7 @@ PacketPeerUDPPosix::PacketPeerUDPPosix() {
queue_count = 0;
peer_port = 0;
sock_type = IP::TYPE_NONE;
+ rb.resize(8);
}
PacketPeerUDPPosix::~PacketPeerUDPPosix() {
diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp
index e326a5a6f..5290eebc4 100644
--- a/platform/windows/packet_peer_udp_winsock.cpp
+++ b/platform/windows/packet_peer_udp_winsock.cpp
@@ -278,6 +278,7 @@ PacketPeerUDPWinsock::PacketPeerUDPWinsock() {
queue_count = 0;
peer_port = 0;
sock_type = IP::TYPE_NONE;
+ rb.resize(8);
}
PacketPeerUDPWinsock::~PacketPeerUDPWinsock() {