diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-05-05 23:05:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-05 23:05:52 +0200 |
commit | a853b0a2f7df5258ec64635df5d3ff06ceb5e1aa (patch) | |
tree | 66521ff9e00d98a9bbf808818750bbfc19a73803 | |
parent | d6e5215860e2ff236508e4d424f4815870d49fca (diff) | |
parent | 5c6715a291e0e843b56f0a168191b3d89657d43f (diff) |
Merge pull request #8656 from Faless/fix_udp_wait
Fix UDP::wait() deadlock
-rw-r--r-- | drivers/unix/packet_peer_udp_posix.cpp | 2 | ||||
-rw-r--r-- | platform/windows/packet_peer_udp_winsock.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 5dbccd4b63..74ceb3946a 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -216,6 +216,8 @@ Error PacketPeerUDPPosix::_poll(bool p_wait) { len = sizeof(struct sockaddr_storage); ++queue_count; + if (p_wait) + break; }; // TODO: Should ECONNRESET be handled here? diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index f69c0bd2ed..f3b91c1b56 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -203,6 +203,8 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) { len = sizeof(struct sockaddr_storage); ++queue_count; + if (p_wait) + break; }; if (ret == SOCKET_ERROR) { |