Fix two more sleep bugs.

This commit is contained in:
Sacha committed 2014-07-13 08:15:14 +10:00
1 parent 6336435f81
commit 84df417a01
2 files changed
+3 -10

No files matched your search

+1 -5
View File
@@ -85,11 +85,7 @@ bool Connection::Connect(int maxTries) {
if (retval >= 0)
return true;
}
#ifdef _WIN32
Sleep(1);
#else
sleep(1);
#endif
sleep_ms(1);
}
// Let's not leak this socket.
+2 -5
View File
@@ -1,5 +1,6 @@
#include "net/resolve.h"
#include "base/logging.h"
#include "base/timeutil.h"
#include <stdio.h>
#include <stdlib.h>
@@ -98,11 +99,7 @@ bool DNSResolve(const std::string &host, const std::string &service, addrinfo **
int result = getaddrinfo(host.c_str(), servicep, &hints, res);
if (result == EAI_AGAIN) {
// Temporary failure. Since this already blocks, let's just try once more.
#ifdef _WIN32
Sleep(1);
#else
sleep(1);
#endif
sleep_ms(1);
result = getaddrinfo(host.c_str(), servicep, &hints, res);
}