diff options
author | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-08-14 19:36:45 +0200 |
---|---|---|
committer | Zdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com> | 2009-08-14 19:36:45 +0200 |
commit | 97c2b59763339ad7d8a9a8fbbca0a2aa24c709f9 (patch) | |
tree | f89bcd90bd256759ee4fef937c12fcfdbc047131 | |
parent | 62dbb8f2725bd707fb4e00175f66b008d92a1a9b (diff) | |
download | abrt-97c2b59763339ad7d8a9a8fbbca0a2aa24c709f9.tar.gz abrt-97c2b59763339ad7d8a9a8fbbca0a2aa24c709f9.tar.xz abrt-97c2b59763339ad7d8a9a8fbbca0a2aa24c709f9.zip |
fixed creation of the base64 text
-rw-r--r-- | lib/Plugins/Bugzilla.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 429adfce..2a91b959 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -51,7 +51,14 @@ void CReporterBugzilla::DeleteXMLRPCClient() PRInt32 CReporterBugzilla::Base64Encode_cb(void *arg, const char *obuf, PRInt32 size) { CReporterBugzilla* bz = static_cast<CReporterBugzilla*>(arg); - bz->m_sAttchmentInBase64 += obuf; + int ii; + for (ii = 0; ii < size; ii++) + { + if (isprint(obuf[ii])) + { + bz->m_sAttchmentInBase64 += obuf[ii]; + } + } return 1; } @@ -194,7 +201,7 @@ void CReporterBugzilla::CreateNewBugDescription(const map_crash_report_t& pCrash if (pCrashReport.find(CD_COMMENT) != pCrashReport.end()) { comment = "\n\nCommnet\n" - "-----\n" + + "-----\n" + pCrashReport.find(CD_COMMENT)->second[CD_CONTENT]; } pDescription = "\nabrt detected crash.\n" + @@ -322,24 +329,17 @@ void CReporterBugzilla::AddAttachments(const std::string& pBugId, const map_cras { throw CABRTException(EXCEP_PLUGIN, "CReporterBugzilla::AddAttachemnt(): cannot initialize base64."); } + NSSBase64Encoder_Update(base64, reinterpret_cast<const unsigned char*>(it->second[CD_CONTENT].c_str()), it->second[CD_CONTENT].length()); NSSBase64Encoder_Destroy(base64, PR_FALSE); - std::string attchmentInBase64Printable = ""; - for (unsigned int ii = 0; ii < m_sAttchmentInBase64.length(); ii++) - { - if (isprint(m_sAttchmentInBase64[ii])) - { - attchmentInBase64Printable += m_sAttchmentInBase64[ii]; - } - } paramList.add(xmlrpc_c::value_string(pBugId)); attachmentParams["description"] = xmlrpc_c::value_string("File: " + it->first); attachmentParams["filename"] = xmlrpc_c::value_string(it->first); attachmentParams["contenttype"] = xmlrpc_c::value_string("text/plain"); - attachmentParams["data"] = xmlrpc_c::value_string(attchmentInBase64Printable); + attachmentParams["data"] = xmlrpc_c::value_string(m_sAttchmentInBase64); paramList.add(xmlrpc_c::value_struct(attachmentParams)); xmlrpc_c::rpcPtr rpc(new xmlrpc_c::rpc("bugzilla.addAttachment", paramList)); try |