Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com --- lib/plugins/KerneloopsReporter.cpp | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/plugins/KerneloopsReporter.cpp b/lib/plugins/KerneloopsReporter.cpp index cee1bad..edb333b 100644 --- a/lib/plugins/KerneloopsReporter.cpp +++ b/lib/plugins/KerneloopsReporter.cpp @@ -90,24 +90,24 @@ std::string CKerneloopsReporter::Report(const map_crash_data_t& pCrashData, const map_plugin_settings_t& pSettings, const char *pArgs) { - CURLcode ret; + CURLcode ret = CURLE_OK;
update_client(_("Creating and submitting a report..."));
map_crash_data_t::const_iterator it = pCrashData.find(FILENAME_BACKTRACE); - if (it != pCrashData.end()) + if (it == pCrashData.end()) + throw CABRTException(EXCEP_PLUGIN, "Error sending kernel oops due to missing backtrace"); + + ret = http_post_to_kerneloops_site( + m_sSubmitURL.c_str(), + it->second[CD_CONTENT].c_str() + ); + if (ret != CURLE_OK) { - ret = http_post_to_kerneloops_site( - m_sSubmitURL.c_str(), - it->second[CD_CONTENT].c_str() - ); - if (ret != CURLE_OK) - { - char* err_str = xasprintf("Kernel oops has not been sent due to %s", curl_easy_strerror(ret)); - CABRTException e(EXCEP_PLUGIN, err_str); - free(err_str); - throw e; - } + char* err_str = xasprintf("Kernel oops has not been sent due to %s", curl_easy_strerror(ret)); + CABRTException e(EXCEP_PLUGIN, err_str); + free(err_str); + throw e; }
/* Server replies with:
On 09/01/2010 09:29 AM, Nikola Pajkovsky wrote:
Signed-off-by: Nikola Pajkovsky npajkovs@redhat.com
lib/plugins/KerneloopsReporter.cpp | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/plugins/KerneloopsReporter.cpp b/lib/plugins/KerneloopsReporter.cpp index cee1bad..edb333b 100644 --- a/lib/plugins/KerneloopsReporter.cpp +++ b/lib/plugins/KerneloopsReporter.cpp @@ -90,24 +90,24 @@ std::string CKerneloopsReporter::Report(const map_crash_data_t& pCrashData, const map_plugin_settings_t& pSettings, const char *pArgs) {
- CURLcode ret;
CURLcode ret = CURLE_OK;
update_client(_("Creating and submitting a report..."));
map_crash_data_t::const_iterator it = pCrashData.find(FILENAME_BACKTRACE);
- if (it != pCrashData.end())
- if (it == pCrashData.end())
throw CABRTException(EXCEP_PLUGIN, "Error sending kernel oops due to missing backtrace");
- the string should be translatable
- ret = http_post_to_kerneloops_site(
m_sSubmitURL.c_str(),
it->second[CD_CONTENT].c_str()
- );
- if (ret != CURLE_OK) {
ret = http_post_to_kerneloops_site(
m_sSubmitURL.c_str(),
it->second[CD_CONTENT].c_str()
);
if (ret != CURLE_OK)
{
char* err_str = xasprintf("Kernel oops has not been sent due to %s", curl_easy_strerror(ret));
CABRTException e(EXCEP_PLUGIN, err_str);
free(err_str);
throw e;
}
char* err_str = xasprintf("Kernel oops has not been sent due to %s", curl_easy_strerror(ret));
CABRTException e(EXCEP_PLUGIN, err_str);
free(err_str);
throw e;
}
/* Server replies with:
even the line: return "Kernel oops report was uploaded"; should be marked for translation.
The rest seems ok, run tested it.
crash-catcher@lists.fedorahosted.org