diff --git a/checkin_notes b/checkin_notes index 29eb8ebc19..5dea02eb5d 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6377,3 +6377,19 @@ David 7 Sept 2010 util.inc user/ create_profile.php + +David 7 Sept 2010 + - server (job submission): allow input templates to specify the + URL, size, and MD5 of input files. + This supports "non-local" input files, + i.e. files not present on the project server. + + NOTE: as implemented, + this requires a separate input template for each job. + It would be slightly better to let you specify the + URL/size/MD5 in the create_work() call. + + From Zoltan Farkas (SZTAKI) + + tools/ + backend_lib.cpp diff --git a/tools/backend_lib.cpp b/tools/backend_lib.cpp index 8f99b8a8a2..277ed331d8 100644 --- a/tools/backend_lib.cpp +++ b/tools/backend_lib.cpp @@ -187,9 +187,9 @@ static int process_wu_template( ) { char* p; char buf[BLOB_SIZE], md5[33], path[256], url[256], top_download_path[256]; - string out, cmdline; + string out, cmdline, md5str, urlstr; int retval, file_number; - double nbytes; + double nbytes, nbytesdef; char open_name[256]; bool found=false; int nfiles_parsed = 0; @@ -198,7 +198,8 @@ static int process_wu_template( for (p=strtok(tmplate, "\n"); p; p=strtok(0, "\n")) { if (match_tag(p, "")) { bool generated_locally = false; - file_number = -1; + file_number = nbytesdef = -1; + md5str = urlstr = ""; out += "\n"; while (1) { p = strtok(0, "\n"); @@ -207,7 +208,20 @@ static int process_wu_template( continue; } else if (parse_bool(p, "generated_locally", generated_locally)) { continue; + } else if (parse_str(p, "", urlstr)) { + continue; + } else if (parse_str(p, "", md5str)) { + continue; + } else if (parse_double(p, "", nbytesdef)) { + continue; } else if (match_tag(p, "")) { + if (nbytesdef != -1 || md5str != "" || urlstr != "") { + if (nbytesdef == -1 || md5str == "" || urlstr == "") { + fprintf(stderr, "All file properties must be defined " + "if at least one defined (url, md5_cksum, nbytes)!\n"); + return ERR_XML_PARSE; + } + } if (file_number < 0) { fprintf(stderr, "No file number found\n"); return ERR_XML_PARSE; @@ -227,7 +241,7 @@ static int process_wu_template( "\n", infiles[file_number] ); - } else { + } else if (nbytesdef == -1) { dir_hier_path( infiles[file_number], config_loc.download_dir, config_loc.uldl_dir_fanout, path, true @@ -270,6 +284,18 @@ static int process_wu_template( md5, nbytes ); + } else { + sprintf(buf, + " %s\n" + " %s\n" + " %s\n" + " %.0f\n" + "\n", + infiles[file_number], + urlstr.c_str(), + md5str.c_str(), + nbytesdef + ); } out += buf; break;