From a7cdd98126462ebfe4d0193a82d7c525326fb873 Mon Sep 17 00:00:00 2001 From: Eric Heien Date: Thu, 6 Feb 2003 19:08:18 +0000 Subject: [PATCH] windows fix svn path=/trunk/boinc/; revision=874 --- client/cs_apps.C | 6 +----- client/http.C | 6 +++--- client/net_xfer.C | 12 ++++++------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/client/cs_apps.C b/client/cs_apps.C index b1693b7210..3c6d9fa1a5 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -167,9 +167,6 @@ bool CLIENT_STATE::start_apps() { // open_slot = active_tasks.get_free_slot(nslots); if (open_slot < 0) { - if (log_flags.task_debug) { - printf("start_apps(): all slots full\n"); - } return action; } rp = results[i]; @@ -196,8 +193,7 @@ bool CLIENT_STATE::start_apps() { atp->result->active_task_state = PROCESS_COULDNT_START; report_project_error( *(atp->result),retval, - "Couldn't start the app for this result.\n" - ); + "Couldn't start the app for this result.\n" ); } action = true; set_client_state_dirty("start_apps"); diff --git a/client/http.C b/client/http.C index 22fb2c9d4a..aa67019ea1 100644 --- a/client/http.C +++ b/client/http.C @@ -545,12 +545,12 @@ bool HTTP_OP_SET::poll() { } break; case HTTP_STATE_REPLY_BODY: - if (htp->error) { - action = true; + if (htp->error) { + action = true; if (log_flags.http_debug) printf("net_xfer returned error %d\n", htp->error); htp->http_op_state = HTTP_STATE_DONE; htp->http_op_retval = htp->error; - } + } else if (htp->io_done) { action = true; switch(htp->http_op_type) { diff --git a/client/net_xfer.C b/client/net_xfer.C index 6b8016fd63..427233cbbe 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -122,7 +122,7 @@ int NET_XFER::open_server() { errno = WSAGetLastError(); if (errno != WSAEINPROGRESS && errno != WSAEWOULDBLOCK) { closesocket(fd); - NetClose(); + NetClose(); return -1; } #else @@ -201,10 +201,12 @@ int NET_XFER_SET::poll(int max_bytes, int& bytes_transferred) { bytes_transferred = 0; while (1) { - timeout.tv_usec = 0; - timeout.tv_sec = 1; + timeout.tv_sec = timeout.tv_usec = 0; +#ifndef _WIN32 + timeout.tv_sec = 1; +#endif retval = do_select(max_bytes, n, timeout); - if (retval) return retval; + if (retval) return retval; if (n == 0) break; max_bytes -= n; bytes_transferred += n; @@ -216,7 +218,6 @@ int NET_XFER_SET::poll(int max_bytes, int& bytes_transferred) { // do a select and do I/O on as many sockets as possible. // int NET_XFER_SET::do_select(int max_bytes, int& bytes_transferred, struct timeval timeout) { - int n, fd, retval; socklen_t i; NET_XFER *nxp; @@ -233,7 +234,6 @@ int NET_XFER_SET::do_select(int max_bytes, int& bytes_transferred, struct timeva fd_set read_fds, write_fds, error_fds; - FD_ZERO(&read_fds); FD_ZERO(&write_fds); FD_ZERO(&error_fds);