summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-19 13:55:23 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-19 13:55:23 +0100
commitb348085ac9f3d4a7ded81026bffa962a065bdf97 (patch)
treedb5fda2df01df4ed7bed0e17f12bf3e5dfd2cbc6 /lib
parent6edf29e32c72e2d860019b2b987012fe52ac49a0 (diff)
downloadabrt-b348085ac9f3d4a7ded81026bffa962a065bdf97.tar.gz
abrt-b348085ac9f3d4a7ded81026bffa962a065bdf97.tar.xz
abrt-b348085ac9f3d4a7ded81026bffa962a065bdf97.zip
Eliminate ATT file type - use TXT or BIN
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Plugins/Bugzilla.cpp2
-rw-r--r--lib/Plugins/Catcut.cpp6
-rw-r--r--lib/Plugins/Logger.conf4
-rw-r--r--lib/Plugins/Logger.cpp2
-rw-r--r--lib/Plugins/Mailx.cpp12
-rw-r--r--lib/Plugins/TicketUploader.cpp5
-rw-r--r--lib/Utils/make_descr.cpp68
7 files changed, 42 insertions, 57 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index 6f0f8d7b..f963eb9c 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -360,7 +360,7 @@ void ctx::add_attachments(const char* bug_id_str, const map_crash_report_t& pCra
const std::string &type = it->second[CD_TYPE];
const std::string &content = it->second[CD_CONTENT];
- if (type == CD_ATT)
+ if (type == CD_TXT && content.length() > CD_TEXT_ATT_SIZE)
{
char *encoded64 = encode_base64(content.c_str(), content.length());
// fails only when you write query. when it's done it never fails.
diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp
index 27b868dc..b69038fb 100644
--- a/lib/Plugins/Catcut.cpp
+++ b/lib/Plugins/Catcut.cpp
@@ -390,9 +390,9 @@ ctx::add_attachments(const char* xmlrpc_URL,
map_crash_report_t::const_iterator it = pCrashReport.begin();
for (; it != pCrashReport.end(); it++)
{
- if (it->second[CD_TYPE] == CD_ATT)
+ if (it->second[CD_TYPE] == CD_TXT && it->second[CD_TYPE].size() > CD_TEXT_ATT_SIZE)
{
- update_client(_("Attaching (CD_ATT): %s"), it->first.c_str());
+ update_client(_("Attaching (text): %s"), it->first.c_str());
string description = "File: " + it->first;
string URL = request_upload(auth_cookie,
@@ -410,7 +410,7 @@ ctx::add_attachments(const char* xmlrpc_URL,
}
else if (it->second[CD_TYPE] == CD_BIN)
{
- update_client(_("Attaching (CD_ATT): %s"), it->first.c_str());
+ update_client(_("Attaching binary: %s"), it->first.c_str());
string description = "File: " + it->first;
string URL = request_upload(auth_cookie,
diff --git a/lib/Plugins/Logger.conf b/lib/Plugins/Logger.conf
index 39ba47e1..8809963c 100644
--- a/lib/Plugins/Logger.conf
+++ b/lib/Plugins/Logger.conf
@@ -1,6 +1,6 @@
# Configuration for Logger plugin
-LogPath = /var/log/abrt-logger
+LogPath = /var/log/abrt.log
AppendLogs = yes
-Enabled = yes \ No newline at end of file
+Enabled = yes
diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp
index a0dea424..d6cc124e 100644
--- a/lib/Plugins/Logger.cpp
+++ b/lib/Plugins/Logger.cpp
@@ -28,7 +28,7 @@
#include "ABRTException.h"
CLogger::CLogger() :
- m_sLogPath("/var/log/abrt-logger"),
+ m_sLogPath("/var/log/abrt.log"),
m_bAppendLogs(true)
{}
diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp
index df33e84c..2f8448f5 100644
--- a/lib/Plugins/Mailx.cpp
+++ b/lib/Plugins/Mailx.cpp
@@ -74,7 +74,7 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport,
args = append_str_to_vector(args, arg_size, MAILX_COMMAND);
//TODO: move email body generation to make_descr.cpp
- std::string binaryFiles, commonFiles, bigTextFiles, additionalFiles, UUIDFile;
+ std::string binaryFiles, commonFiles, additionalFiles, UUIDFile;
map_crash_report_t::const_iterator it;
for (it = pCrashReport.begin(); it != pCrashReport.end(); it++)
{
@@ -105,13 +105,6 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport,
commonFiles += "\n\n";
}
}
- if (it->second[CD_TYPE] == CD_ATT)
- {
- bigTextFiles += it->first;
- bigTextFiles += "\n-----\n";
- bigTextFiles += it->second[CD_CONTENT];
- bigTextFiles += "\n\n";
- }
if (it->second[CD_TYPE] == CD_BIN)
{
binaryFiles += " -a ";
@@ -133,9 +126,6 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport,
emailBody += "\nAdditional information\n";
emailBody += "=====\n\n";
emailBody += additionalFiles;
- emailBody += "\nOther information\n";
- emailBody += "=====\n\n";
- emailBody += bigTextFiles;
emailBody += '\n';
args = append_str_to_vector(args, arg_size, "-s");
diff --git a/lib/Plugins/TicketUploader.cpp b/lib/Plugins/TicketUploader.cpp
index 608ee40b..7483768d 100644
--- a/lib/Plugins/TicketUploader.cpp
+++ b/lib/Plugins/TicketUploader.cpp
@@ -203,9 +203,8 @@ string CTicketUploader::Report(const map_crash_report_t& pCrashReport,
map_crash_report_t::const_iterator it;
for (it = pCrashReport.begin(); it != pCrashReport.end(); it++)
{
- if (it->second[CD_TYPE] == CD_TXT
- || it->second[CD_TYPE] == CD_ATT
- ) {
+ if (it->second[CD_TYPE] == CD_TXT)
+ {
string ofile_name = concat_path_file(tmptar_name.c_str(), it->first.c_str());
ofstream ofile(ofile_name.c_str(), fstream::trunc|fstream::binary);
if (!ofile)
diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp
index 90bd76a9..2a0d4a99 100644
--- a/lib/Utils/make_descr.cpp
+++ b/lib/Utils/make_descr.cpp
@@ -50,9 +50,6 @@ static void add_content(bool &was_multiline, string& description, const char *he
}
}
-/* Text attachments smaller than this will be also included in descrition */
-#define INLINE_TEXT_ATT_SIZE (2*1024)
-
string make_description_bz(const map_crash_report_t& pCrashReport)
{
string description;
@@ -79,22 +76,21 @@ string make_description_bz(const map_crash_report_t& pCrashReport)
const string &filename = it->first;
const string &type = it->second[CD_TYPE];
const string &content = it->second[CD_CONTENT];
- if (type == CD_TXT
- || (type == CD_ATT && content.size() < INLINE_TEXT_ATT_SIZE)
- ) {
- if (filename != CD_UUID
- && filename != FILENAME_ARCHITECTURE
- && filename != FILENAME_RELEASE
- && filename != CD_REPRODUCE
- && filename != CD_COMMENT
- ) {
- add_content(was_multiline, description, filename.c_str(), content.c_str());
- }
- continue;
- }
- if (type == CD_ATT)
+ if (type == CD_TXT)
{
- add_content(was_multiline, description, "Attached file", filename.c_str());
+ if (content.size() <= CD_TEXT_ATT_SIZE)
+ {
+ if (filename != CD_UUID
+ && filename != FILENAME_ARCHITECTURE
+ && filename != FILENAME_RELEASE
+ && filename != CD_REPRODUCE
+ && filename != CD_COMMENT
+ ) {
+ add_content(was_multiline, description, filename.c_str(), content.c_str());
+ }
+ } else {
+ add_content(was_multiline, description, "Attached file", filename.c_str());
+ }
}
}
@@ -113,7 +109,6 @@ string make_description_logger(const map_crash_report_t& pCrashReport)
const string &type = it->second[CD_TYPE];
const string &content = it->second[CD_CONTENT];
if (type == CD_TXT
- || type == CD_ATT
|| type == CD_BIN
) {
if (content == "1.\n2.\n3.\n")
@@ -181,26 +176,27 @@ string make_description_catcut(const map_crash_report_t& pCrashReport)
const string &content = it->second[CD_CONTENT];
if (type == CD_TXT)
{
- if (filename != CD_UUID
- && filename != FILENAME_ARCHITECTURE
- && filename != FILENAME_RELEASE
- && filename != CD_REPRODUCE
- && filename != CD_COMMENT
- ) {
- pDescription += '\n';
+ if (content.length() <= CD_TEXT_ATT_SIZE)
+ {
+ if (filename != CD_UUID
+ && filename != FILENAME_ARCHITECTURE
+ && filename != FILENAME_RELEASE
+ && filename != CD_REPRODUCE
+ && filename != CD_COMMENT
+ ) {
+ pDescription += '\n';
+ pDescription += filename;
+ pDescription += "\n-----\n";
+ pDescription += content;
+ pDescription += "\n\n";
+ }
+ } else {
+ pDescription += "\n\nAttached files\n"
+ "----\n";
pDescription += filename;
- pDescription += "\n-----\n";
- pDescription += content;
- pDescription += "\n\n";
+ pDescription += '\n';
}
}
- else if (type == CD_ATT)
- {
- pDescription += "\n\nAttached files\n"
- "----\n";
- pDescription += filename;
- pDescription += '\n';
- }
else if (type == CD_BIN)
{
error_msg(_("Binary file %s will not be reported"), filename.c_str());