diff --git a/checkin_notes b/checkin_notes index efeb949d23..fc6c5f4db5 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1418,3 +1418,17 @@ Charlie 6 Feb 2012 client/ client_state.cpp + +David 7 Feb 2012 + - client: HTTP range request errors are permanent. + + client/ + http_curl.cpp,h + pers_file_xfer.cpp + file_xfer.cpp + lib/ + gui_rpc_client_ops.cpp + error_numbers.h + str_util.cpp + html/ops/ + bolt_refresh.php diff --git a/client/file_xfer.cpp b/client/file_xfer.cpp index d0ba9f051d..39946340c3 100644 --- a/client/file_xfer.cpp +++ b/client/file_xfer.cpp @@ -83,7 +83,7 @@ int FILE_XFER::init_upload(FILE_INFO& file_info) { fip = &file_info; get_pathname(fip, pathname, sizeof(pathname)); if (!boinc_file_exists(pathname)) { - return ERR_FILE_NOT_FOUND; + return ERR_NOT_FOUND; } is_upload = true; diff --git a/client/http_curl.cpp b/client/http_curl.cpp index 9100c408cd..a09130c3d4 100644 --- a/client/http_curl.cpp +++ b/client/http_curl.cpp @@ -419,7 +419,7 @@ int HTTP_OP::libcurl_exec( if (log_flags.http_debug) { msg_printf(project, MSG_INFO, "Couldn't create curlEasy handle"); } - return ERR_HTTP_ERROR; // returns 0 (CURLM_OK) on successful handle creation + return ERR_HTTP_TRANSIENT; // returns 0 (CURLM_OK) on successful handle creation } // the following seems to be a no-op @@ -708,7 +708,7 @@ int HTTP_OP::libcurl_exec( msg_printf(0, MSG_INTERNAL_ERROR, "Couldn't add curlEasy handle to curlMulti" ); - return ERR_HTTP_ERROR; + return ERR_HTTP_TRANSIENT; // returns 0 (CURLM_OK) on successful handle creation } @@ -974,10 +974,11 @@ void HTTP_OP::handle_messages(CURLMsg *pcurlMsg) { } switch (response) { case HTTP_STATUS_NOT_FOUND: - http_op_retval = ERR_FILE_NOT_FOUND; + case HTTP_STATUS_RANGE_REQUEST_ERROR: + http_op_retval = ERR_HTTP_PERMANENT; break; default: - http_op_retval = ERR_HTTP_ERROR; + http_op_retval = ERR_HTTP_TRANSIENT; } } net_status.http_op_succeeded(); @@ -992,7 +993,7 @@ void HTTP_OP::handle_messages(CURLMsg *pcurlMsg) { http_op_retval = ERR_CONNECT; break; default: - http_op_retval = ERR_HTTP_ERROR; + http_op_retval = ERR_HTTP_TRANSIENT; } // trigger a check for whether we're connected, diff --git a/client/http_curl.h b/client/http_curl.h index 1f3c1a485f..e49f9bcf31 100644 --- a/client/http_curl.h +++ b/client/http_curl.h @@ -139,8 +139,8 @@ public: // 0 // ERR_GETHOSTBYNAME (if no such host) // ERR_CONNECT (if server down) - // ERR_FILE_NOT_FOUND (if 404) - // ERR_HTTP_ERROR (other failures) + // ERR_HTTP_PERMANENT (if 404 or 416) + // ERR_HTTP_TRANSIENT (other failures) bool is_background; // this operation shouldn't trigger a reference-site check // and a user alert if it fails. diff --git a/client/pers_file_xfer.cpp b/client/pers_file_xfer.cpp index ea097aef2e..18cd8a7570 100644 --- a/client/pers_file_xfer.cpp +++ b/client/pers_file_xfer.cpp @@ -141,7 +141,7 @@ int PERS_FILE_XFER::create_xfer() { } fxp->file_xfer_retval = retval; - if (retval == ERR_FILE_NOT_FOUND) { + if (retval == ERR_HTTP_PERMANENT) { permanent_failure(retval); } else { transient_failure(retval); @@ -249,8 +249,7 @@ bool PERS_FILE_XFER::poll() { permanent_failure(fxp->file_xfer_retval); break; case ERR_NOT_FOUND: - case ERR_FILE_NOT_FOUND: - case HTTP_STATUS_NOT_FOUND: // won't happen - converted in http_curl.C + case ERR_HTTP_PERMANENT: if (is_upload) { // if we get a "not found" on an upload, // the project must not have a file_upload_handler. diff --git a/html/ops/bolt_refresh.php b/html/ops/bolt_refresh.php index b635939bb9..7e8c8a74c1 100644 --- a/html/ops/bolt_refresh.php +++ b/html/ops/bolt_refresh.php @@ -29,7 +29,6 @@ function notify_user($user) { You are due for refresh on the following units from "; foreach($user->refresh as $r) { - echo " } } diff --git a/lib/error_numbers.h b/lib/error_numbers.h index 1e87f90e3c..2f0509dfe7 100644 --- a/lib/error_numbers.h +++ b/lib/error_numbers.h @@ -138,7 +138,8 @@ #define ERR_LISTEN -181 #define ERR_TIMEOUT -182 #define ERR_PROJECT_DOWN -183 -#define ERR_HTTP_ERROR -184 +#define ERR_HTTP_TRANSIENT -184 + // HTTP errors other than 404 and 416 #define ERR_RESULT_START -185 #define ERR_RESULT_DOWNLOAD -186 #define ERR_RESULT_UPLOAD -187 @@ -178,8 +179,8 @@ #define ERR_ABORTED_BY_PROJECT -221 #define ERR_GETGRNAM -222 #define ERR_CHOWN -223 -#define ERR_FILE_NOT_FOUND -224 - // represents HTTP 404 error +#define ERR_HTTP_PERMANENT -224 + // represents HTTP 404 or 416 error #define ERR_BAD_FILENAME -225 #define ERR_TOO_MANY_EXITS -226 #define ERR_RMDIR -227 diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index e0afcfc238..f2dcfddc2a 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -2260,7 +2260,7 @@ int RPC_CLIENT::get_global_prefs_working_struct(GLOBAL_PREFS& prefs, GLOBAL_PREF prefs.parse(xp, "", found_venue, mask); if (!mask.are_prefs_set()) { - return ERR_FILE_NOT_FOUND; + return ERR_NOT_FOUND; } return 0; } @@ -2323,7 +2323,7 @@ int RPC_CLIENT::get_global_prefs_override_struct(GLOBAL_PREFS& prefs, GLOBAL_PRE prefs.parse(xp, "", found_venue, mask); if (!mask.are_prefs_set()) { - return ERR_FILE_NOT_FOUND; + return ERR_NOT_FOUND; } return 0; } diff --git a/lib/str_util.cpp b/lib/str_util.cpp index ed442d2ef8..175bc767c0 100644 --- a/lib/str_util.cpp +++ b/lib/str_util.cpp @@ -504,7 +504,6 @@ const char* boincerror(int which_error) { case ERR_LISTEN: return "listen() failed"; case ERR_TIMEOUT: return "timeout"; case ERR_PROJECT_DOWN: return "project down"; - case ERR_HTTP_ERROR: return "HTTP error"; case ERR_RESULT_START: return "result start failed"; case ERR_RESULT_DOWNLOAD: return "result download failed"; case ERR_RESULT_UPLOAD: return "result upload failed"; @@ -538,7 +537,8 @@ const char* boincerror(int which_error) { case ERR_ABORTED_BY_PROJECT: return "Aborted by project"; case ERR_GETGRNAM: return "getgrnam() failed"; case ERR_CHOWN: return "chown() failed"; - case ERR_FILE_NOT_FOUND: return "file not found"; + case ERR_HTTP_PERMANENT: return "permanent HTTP error"; + case ERR_HTTP_TRANSIENT: return "transient HTTP error"; case ERR_BAD_FILENAME: return "file name is empty or has '..'"; case ERR_TOO_MANY_EXITS: return "application exited too many times"; case ERR_RMDIR: return "rmdir() failed";