diff --git a/html/inc/submit_db.inc b/html/inc/submit_db.inc index 61c6e6b84b..9c5a0f66e2 100644 --- a/html/inc/submit_db.inc +++ b/html/inc/submit_db.inc @@ -100,11 +100,11 @@ class BoincUserSubmitApp { } static function delete_user($user_id) { $db = BoincDb::get(); - $db->delete_aux('user_submit_app', "user_id=$user_id"); + return $db->delete_aux('user_submit_app', "user_id=$user_id"); } function update($clause) { $db = BoincDb::get(); - $db->update_aux('user_submit_app', "$clause where user_id=$this->user_id and app_id=$this->app_id"); + return $db->update_aux('user_submit_app', "$clause where user_id=$this->user_id and app_id=$this->app_id"); } } @@ -121,7 +121,7 @@ class BoincJobFile { } function delete() { $db = BoincDb::get(); - $db->delete($this, 'job_file'); + return $db->delete_aux($this, 'job_file', "md5='$this->md5'"); } function update($clause) { $db = BoincDb::get(); @@ -142,13 +142,13 @@ class BoincBatchFileAssoc { } function delete() { $db = BoincDb::get(); - $db->delete_aux('batch_file_assoc', + return $db->delete_aux('batch_file_assoc', "job_file_id=$this->job_file_id and batch_id=$this->batch_id" ); } static function delete_batch($batch_id) { $db = BoincDb::get(); - $db->delete_aux('batch_file_assoc', + return $db->delete_aux('batch_file_assoc', "batch_id=$batch_id" ); } diff --git a/html/user/job_file.php b/html/user/job_file.php index 76edd37930..a4821a20e1 100644 --- a/html/user/job_file.php +++ b/html/user/job_file.php @@ -116,6 +116,9 @@ function query_files($r) { $jf_id = BoincJobFile::insert( "(md5, create_time, delete_time) values ('$md5', $now, $delete_time)" ); + if (!$jf_id) { + xml_error(-1, "query_file(): BoincJobFile::insert($md5) failed: ".BoincDb::error()); + } } // create batch association if needed // @@ -131,7 +134,12 @@ function query_files($r) { } } else { if ($job_file) { - $job_file->delete(); + $ret = $job_file->delete(); + if (!$ret) { + xml_error(-1, + "BoincJobFile::delete() failed: ".BoincDb::error() + ); + } } $absent_files[] = $i; } @@ -166,7 +174,7 @@ function upload_files($r) { "(md5, create_time, delete_time) values ('$md5', $now, $delete_time)" ); if (!$jf_id) { - xml_error(-1, "BoincJobFile::insert($md5) failed: ".BoincDb::error()); + xml_error(-1, "upload_files(): BoincJobFile::insert($md5) failed: ".BoincDb::error()); } if ($batch_id) { BoincBatchFileAssoc::insert( diff --git a/samples/condor/boinc_gahp.cpp b/samples/condor/boinc_gahp.cpp index f27cbc019e..eec33bdf3d 100644 --- a/samples/condor/boinc_gahp.cpp +++ b/samples/condor/boinc_gahp.cpp @@ -125,9 +125,11 @@ void filename_extension(const char* path, char* ext) { int compute_boinc_name(string path, LOCAL_FILE& f) { char md5[64], ext[256]; - return md5_file(path.c_str(), md5, f.nbytes); + int retval = md5_file(path.c_str(), md5, f.nbytes); + if (retval) return retval; filename_extension(path.c_str(), ext); sprintf(f.boinc_name, "%s%s", md5, ext); + return 0; } const char *escape_str(const string &str) { diff --git a/tools/remote_submit_test.cpp b/tools/remote_submit_test.cpp index 9bf213b1a7..774985fe74 100644 --- a/tools/remote_submit_test.cpp +++ b/tools/remote_submit_test.cpp @@ -19,6 +19,9 @@ #include "remote_submit.h" +using std::vector; +using std::string; + const char* project_url = "http://isaac.ssl.berkeley.edu/test/"; const char* authenticator = "157f96a018b0b2f2b466e2ce3c7f54db";