From 5fce72eebb9b21dec89b84fbbd0d2fd8db1f4363 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 23 Aug 2002 00:53:00 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=373 --- client/client_state.C | 8 +++++--- client/cs_apps.C | 8 +++++++- client/cs_files.C | 19 ++++++++++++------- client/http.C | 5 ++++- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/client/client_state.C b/client/client_state.C index a267698d48..48036b56ed 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -644,9 +644,11 @@ bool CLIENT_STATE::garbage_collect() { } else { rp->wup->ref_cnt++; for (i=0; ioutput_files.size(); i++) { - // If one of the file infos had a failure, mark the result - // as done and report the error. The result, workunits, and - // file infos will be cleaned up after the server is notified + // If one of the file infos had a failure, + // mark the result as done and report the error. + // The result, workunits, and file infos + // will be cleaned up after the server is notified + // if (rp->output_files[i].file_info->had_failure()) { if (rp->state < RESULT_READY_TO_ACK) { rp->state = RESULT_READY_TO_ACK; diff --git a/client/cs_apps.C b/client/cs_apps.C index ed64c843f4..4f64cdbd17 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -71,6 +71,7 @@ int CLIENT_STATE::app_finished(ACTIVE_TASK& at) { FILE_INFO* fip; unsigned int i; char path[256]; + int retval; for (i=0; ioutput_files.size(); i++) { fip = rp->output_files[i].file_info; @@ -79,7 +80,12 @@ int CLIENT_STATE::app_finished(ACTIVE_TASK& at) { fip->delete_file(); } else { get_pathname(fip, path); - md5_file(path, fip->md5_cksum, fip->nbytes); + retval = md5_file(path, fip->md5_cksum, fip->nbytes); + if (retval) { + // an output file is unexpectedly absent. + // + fip->status = retval; + } } } diff --git a/client/cs_files.C b/client/cs_files.C index 0c436857ca..2fb4057bae 100644 --- a/client/cs_files.C +++ b/client/cs_files.C @@ -94,21 +94,24 @@ bool CLIENT_STATE::handle_pers_file_xfers() { for (i=0; ipers_file_xfer; - if (!fip->generated_locally && fip->status == FILE_NOT_PRESENT && !pfx) { - // Set up the persistent file transfer object. This will start - // the download when there is available bandwidth + if (pfx) continue; + if (!fip->generated_locally && fip->status == FILE_NOT_PRESENT) { + + // Set up the persistent file transfer object. + // This will start the download when there is available bandwidth // pfx = new PERS_FILE_XFER; pfx->init(fip, false); fip->pers_file_xfer = pfx; pers_xfers->insert( fip->pers_file_xfer ); action = true; - } else if (fip->upload_when_present && fip->status == FILE_PRESENT && !fip->uploaded && !pfx ) { - // Set up the persistent file transfer object. This will start - // the upload when there is available bandwidth + } else if (fip->upload_when_present && fip->status == FILE_PRESENT && !fip->uploaded) { + + // Set up the persistent file transfer object. + // This will start the upload when there is available bandwidth // pfx = new PERS_FILE_XFER; - pfx->init( fip, true ); + pfx->init(fip, true); fip->pers_file_xfer = pfx; pers_xfers->insert(fip->pers_file_xfer); action = true; @@ -117,8 +120,10 @@ bool CLIENT_STATE::handle_pers_file_xfers() { for (i=0; ipers_file_xfers.size(); i++) { pfx = pers_xfers->pers_file_xfers[i]; + // If the transfer finished, remove the PERS_FILE_XFER object // from the set and delete it + // if (pfx->xfer_done) { pfx->fip->pers_file_xfer = NULL; pers_xfers->remove(pfx); diff --git a/client/http.C b/client/http.C index 992338f41f..001251a703 100644 --- a/client/http.C +++ b/client/http.C @@ -292,7 +292,10 @@ int HTTP_OP::init_post2( strcpy(infile, in); file_offset = offset; retval = file_size(infile, content_length); - if (retval) return retval; + if (retval) { + printf("HTTP::init_post2: couldn't get file size\n"); + return retval; + } content_length -= (int)offset; } content_length += strlen(req1);