summaryrefslogtreecommitdiff
path: root/node/UdpSocket.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-19 23:10:34 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-03-19 23:10:34 -0700
commit4d0ad9abb654d3b987148f024ffeb1a04da2b574 (patch)
tree618419de22f7d80753467317dcf8eca6ec932f0f /node/UdpSocket.cpp
parent15e8c181063ecd32b2dc2eec9185d976005e0c43 (diff)
downloadinfinitytier-4d0ad9abb654d3b987148f024ffeb1a04da2b574.tar.gz
infinitytier-4d0ad9abb654d3b987148f024ffeb1a04da2b574.zip
Fix TRACE bug and new UDP socket code issue.
Diffstat (limited to 'node/UdpSocket.cpp')
-rw-r--r--node/UdpSocket.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/node/UdpSocket.cpp b/node/UdpSocket.cpp
index 03041cf3..8730428f 100644
--- a/node/UdpSocket.cpp
+++ b/node/UdpSocket.cpp
@@ -93,13 +93,11 @@ bool UdpSocket::notifyAvailableForRead(const SharedPtr<Socket> &self,SocketManag
{
Buffer<ZT_SOCKET_MAX_MESSAGE_LEN> buf;
InetAddress from;
- for(;;) {
- socklen_t salen = from.saddrSpaceLen();
- int n = (int)recvfrom(_sock,buf.data(),ZT_SOCKET_MAX_MESSAGE_LEN,0,from.saddr(),&salen);
- if (n > 0) {
- buf.setSize((unsigned int)n);
- sm->handleReceivedPacket(self,from,buf);
- } else break;
+ socklen_t salen = from.saddrSpaceLen();
+ int n = (int)recvfrom(_sock,buf.data(),ZT_SOCKET_MAX_MESSAGE_LEN,0,from.saddr(),&salen);
+ if (n > 0) {
+ buf.setSize((unsigned int)n);
+ sm->handleReceivedPacket(self,from,buf);
}
return true;
}