summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-18 21:33:55 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-01-23 20:18:23 +0100
commit68dc969f8ca242d0c4f927a417557288e4b1b75f (patch)
tree69f1a62a5f61d606cc703eee0c5f4227a126df1c
parentfa0cb7da0e096e01476eabef37c225404c7f6f26 (diff)
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
-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 88293fc513..7de54df043 100644
--- a/drivers/unix/packet_peer_udp_posix.cpp
+++ b/drivers/unix/packet_peer_udp_posix.cpp
@@ -275,6 +275,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 ddcfa9cdf8..9f1617d540 100644
--- a/platform/windows/packet_peer_udp_winsock.cpp
+++ b/platform/windows/packet_peer_udp_winsock.cpp
@@ -290,6 +290,7 @@ PacketPeerUDPWinsock::PacketPeerUDPWinsock() {
queue_count=0;
peer_port=0;
sock_type = IP::TYPE_NONE;
+ rb.resize(8);
}
PacketPeerUDPWinsock::~PacketPeerUDPWinsock() {