*** empty log message ***

svn path=/trunk/boinc/; revision=864
This commit is contained in:
Hamid Aghdaee 2003-02-04 22:15:30 +00:00
parent a58b3fef4d
commit 33c9bb9e35
4 changed files with 12 additions and 9 deletions

View File

@ -68,7 +68,7 @@ CLIENT_STATE::CLIENT_STATE() {
platform_name = HOST;
exit_after = -1;
app_started = 0;
max_transfer_rate = 9999999;
max_transfer_rate = 9999;
max_bytes = 0;
user_idle = true;
use_http_proxy = false;

View File

@ -88,7 +88,7 @@ int main(int argc, char** argv) {
if (!gstate.do_something()) {
if (log_flags.time_debug) printf("SLEEP 1 SECOND\n");
fflush(stdout);
boinc_sleep(1);
// boinc_sleep(.01);
}
if (gstate.time_to_exit()) {

View File

@ -197,11 +197,14 @@ int NET_XFER_SET::remove(NET_XFER* nxp) {
//
int NET_XFER_SET::poll(int max_bytes, int& bytes_transferred) {
int n, retval;
struct timeval timeout;
bytes_transferred = 0;
while (1) {
retval = do_select(max_bytes, n);
if (retval) return retval;
timeout.tv_usec = 0;
timeout.tv_sec = 1;
retval = do_select(max_bytes, n, timeout);
if (retval) return retval;
if (n == 0) break;
max_bytes -= n;
bytes_transferred += n;
@ -212,8 +215,8 @@ 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 zeros;
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;
@ -229,7 +232,7 @@ int NET_XFER_SET::do_select(int max_bytes, int& bytes_transferred) {
bytes_transferred = 0;
fd_set read_fds, write_fds, error_fds;
memset(&zeros, 0, sizeof(zeros));
FD_ZERO(&read_fds);
FD_ZERO(&write_fds);
@ -248,7 +251,7 @@ int NET_XFER_SET::do_select(int max_bytes, int& bytes_transferred) {
}
FD_SET(net_xfers[i]->socket, &error_fds);
}
n = select(FD_SETSIZE, &read_fds, &write_fds, &error_fds, &zeros);
n = select(FD_SETSIZE, &read_fds, &write_fds, &error_fds, &timeout);
if (log_flags.net_xfer_debug) printf("select returned %d\n", n);
if (n == 0) return 0;
if (n < 0) return ERR_SELECT;

View File

@ -63,7 +63,7 @@ public:
int insert(NET_XFER*);
int remove(NET_XFER*);
int poll(int max_bytes, int& bytes_transferred);
int do_select(int max_bytes, int& bytes_transferred);
int do_select(int max_bytes, int& bytes_transferred, struct timeval timeout);
NET_XFER* lookup_fd(int); // lookup by fd
};