*** empty log message ***

svn path=/trunk/boinc/; revision=10115
This commit is contained in:
Walt Gribben 2006-05-09 02:00:04 +00:00
parent b6bed4b2d3
commit b31e5e1a15
2 changed files with 18 additions and 0 deletions

View File

@ -4540,3 +4540,11 @@ Charlie 8 May 2006
api/
x_opengl.C
Walt 8 May 2006
- Bug fix: DNS lookup when network was unavailable consumed all
available CPU. Fix limits times thru loop and adds a short
sleep before breaking out of it.
client/
client_state..C

View File

@ -362,6 +362,7 @@ void CLIENT_STATE::do_io_or_sleep(double x) {
struct timeval tv;
now = dtime();
double end_time = now + x;
int loops = 0;
while (1) {
curl_fds.zero();
@ -387,6 +388,15 @@ void CLIENT_STATE::do_io_or_sleep(double x) {
if (n==0) break;
// Limit number of times thru this loop. Can get
// stuck in while loop, if network isn't available,
// DNS lookups tend to eat CPU cycles.
//
if (loops++ > 99) {
boinc_sleep(.01);
break;
}
now = dtime();
if (now > end_time) break;
x = end_time - now;