diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-17 12:34:56 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-17 12:34:56 +0200 |
commit | c68353314b7bf0d559fb832bda1ceb55b16837fd (patch) | |
tree | 406d03c041390450edff4984b5012933abe80e12 /lib | |
parent | b5219ba3dd15f990f9abffc8e81f1cdd3a908854 (diff) | |
download | abrt-c68353314b7bf0d559fb832bda1ceb55b16837fd.tar.gz abrt-c68353314b7bf0d559fb832bda1ceb55b16837fd.tar.xz abrt-c68353314b7bf0d559fb832bda1ceb55b16837fd.zip |
abrt_rh_support: handle 404 errors better
Also remove unused class memeber in CCpp analyser
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Plugins/CCpp.cpp | 16 | ||||
-rw-r--r-- | lib/Plugins/CCpp.h | 1 | ||||
-rw-r--r-- | lib/Utils/abrt_rh_support.cpp | 14 |
3 files changed, 20 insertions, 11 deletions
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 39ae30f6..d0455b9e 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -846,7 +846,7 @@ static int set_limits() if (!isdigit_str(ent->d_name)) continue; - char limits_name[sizeof("/proc/%s/limits") + sizeof(int)]; + char limits_name[sizeof("/proc/%s/limits") + sizeof(long)*3]; snprintf(limits_name, sizeof(limits_name), "/proc/%s/limits", ent->d_name); FILE *limits_fp = fopen(limits_name, "r"); if (!limits_fp) { @@ -937,17 +937,17 @@ void CAnalyzerCCpp::Init() if (fp) { /* we care only about the first char, if it's - not '0' then we don't have to change it, - because it means that it's already != 0 - */ + * not '0' then we don't have to change it, + * because it means that it's already != 0 + */ char pipe_limit[2]; - if (fgets(pipe_limit, sizeof(pipe_limit), fp)) - m_sOldCorePipeLimit = pipe_limit; + if (!fgets(pipe_limit, sizeof(pipe_limit), fp)) + pipe_limit[0] = '1'; /* not 0 */ fclose(fp); - if(m_sOldCorePipeLimit[0] == '0') + if (pipe_limit[0] == '0') { fp = fopen(CORE_PIPE_LIMIT_IFACE, "w"); - if(fp) + if (fp) { fputs(CORE_PIPE_LIMIT, fp); fclose(fp); diff --git a/lib/Plugins/CCpp.h b/lib/Plugins/CCpp.h index 98f60f12..afdc2c6e 100644 --- a/lib/Plugins/CCpp.h +++ b/lib/Plugins/CCpp.h @@ -34,7 +34,6 @@ class CAnalyzerCCpp : public CAnalyzer bool m_bInstallDebugInfo; unsigned m_nDebugInfoCacheMB; std::string m_sOldCorePattern; - std::string m_sOldCorePipeLimit; std::string m_sDebugInfo; std::string m_sDebugInfoDirs; diff --git a/lib/Utils/abrt_rh_support.cpp b/lib/Utils/abrt_rh_support.cpp index 5ff75652..3a14850b 100644 --- a/lib/Utils/abrt_rh_support.cpp +++ b/lib/Utils/abrt_rh_support.cpp @@ -396,9 +396,18 @@ send_report_to_new_case(const char* baseURL, free_abrt_post_state(case_state); goto redirect_case; } - /* fall through */ + goto bad_resp_code; + + case 404: + /* Not strictly necessary, but makes this typical error less cryptic: + * instead of returning html-encoded body, we show short concise message, + * and show offending URL (typos in which is a typical cause) */ + retval = xasprintf("error in case creation, " + "HTTP code: 404 (Not found), URL:'%s'", case_url.c_str()); + break; default: + bad_resp_code: errmsg = case_state->curl_error_msg; if (errmsg) retval = xasprintf("error in case creation: %s", errmsg); @@ -408,7 +417,8 @@ send_report_to_new_case(const char* baseURL, if ((!errmsg || !errmsg[0]) && case_state->body && case_state->body[0]) errmsg = case_state->body; if (errmsg) - retval = xasprintf("error in case creation, server says: '%s'", errmsg); + retval = xasprintf("error in case creation, HTTP code: %d, server says: '%s'", + case_state->http_resp_code, errmsg); else retval = xasprintf("error in case creation, HTTP code: %d", case_state->http_resp_code); |