summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-08-25 16:50:07 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-08-25 16:50:07 +0200
commit7aaf0fb85fd60c04a612fe483f696a4f00f1f85e (patch)
tree33f67da71c7eac6b5113e0bbf81b93888dd32bb4 /lib
parent39f00225b96499fbc765f9eaa353a93ebe8912e2 (diff)
parentf495fd571cc063c2e0980e14b0cac604a5c71b32 (diff)
downloadabrt-7aaf0fb85fd60c04a612fe483f696a4f00f1f85e.tar.gz
abrt-7aaf0fb85fd60c04a612fe483f696a4f00f1f85e.tar.xz
abrt-7aaf0fb85fd60c04a612fe483f696a4f00f1f85e.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib')
-rw-r--r--lib/CommLayer/DBusClientProxy.cpp2
-rw-r--r--lib/CommLayer/DBusClientProxy.h2
-rw-r--r--lib/CommLayer/Observer.h7
-rw-r--r--lib/Plugins/FileTransfer.cpp22
-rw-r--r--lib/Plugins/Mailx.cpp5
-rw-r--r--lib/Plugins/abrt-FileTransfer.75
6 files changed, 29 insertions, 14 deletions
diff --git a/lib/CommLayer/DBusClientProxy.cpp b/lib/CommLayer/DBusClientProxy.cpp
index 59f9f5d..2cc00a5 100644
--- a/lib/CommLayer/DBusClientProxy.cpp
+++ b/lib/CommLayer/DBusClientProxy.cpp
@@ -180,7 +180,7 @@ map_crash_report_t CDBusClient_proxy::CreateReport(const std::string& pUUID)
return GetJobResult(m_iPendingJobID);
};
-void CDBusClient_proxy::Report(map_crash_report_t pReport)
+void CDBusClient_proxy::Report(const map_crash_report_t& pReport)
{
DBus::CallMessage call;
diff --git a/lib/CommLayer/DBusClientProxy.h b/lib/CommLayer/DBusClientProxy.h
index 5b5c1fd..22dfcf1 100644
--- a/lib/CommLayer/DBusClientProxy.h
+++ b/lib/CommLayer/DBusClientProxy.h
@@ -90,7 +90,7 @@ public:
vector_crash_infos_t GetCrashInfos();
bool DeleteDebugDump(const std::string& pUUID);
map_crash_report_t CreateReport(const std::string& pUUID);
- void Report(map_crash_report_t pReport);
+ void Report(const map_crash_report_t& pReport);
map_crash_report_t GetJobResult(uint64_t pJobID);
public:
diff --git a/lib/CommLayer/Observer.h b/lib/CommLayer/Observer.h
index 02b51ce..1fb820a 100644
--- a/lib/CommLayer/Observer.h
+++ b/lib/CommLayer/Observer.h
@@ -12,17 +12,16 @@ class CObserver {
//CObserver();
virtual ~CObserver() {}
virtual void Status(const std::string& pMessage, const std::string& pDest="0") = 0;
- virtual void Debug(const std::string& pMessage, const std::string& pDest="0") = 0;
- virtual void Warning(const std::string& pMessage, const std::string& pDest="0") = 0;
+ virtual void Debug(const std::string& pMessage) = 0;
+ virtual void Warning(const std::string& pMessage) = 0;
/* this should be implemented in daemon */
virtual vector_crash_infos_t GetCrashInfos(const std::string &pSender) = 0;
- virtual map_crash_report_t CreateReport(const std::string &pUUID,const std::string &pSender) = 0;
virtual uint64_t CreateReport_t(const std::string &pUUID,const std::string &pUID, const std::string &pSender)
{
std::cout << "DEFAULT OBSERVER";
return 0;
}
- virtual report_status_t Report(map_crash_report_t pReport, const std::string &pSender) = 0;
+ virtual report_status_t Report(const map_crash_report_t& pReport, const std::string &pSender) = 0;
virtual bool DeleteDebugDump(const std::string& pUUID, const std::string& pSender) = 0;
virtual map_crash_report_t GetJobResult(uint64_t pJobID, const std::string &pSender) = 0;
virtual vector_map_string_string_t GetPluginsInfo() = 0;
diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp
index 981e574..d3d0996 100644
--- a/lib/Plugins/FileTransfer.cpp
+++ b/lib/Plugins/FileTransfer.cpp
@@ -172,6 +172,8 @@ std::string CFileTransfer::DirBase(const std::string& pStr)
void CFileTransfer::Run(const std::string& pActiveDir, const std::string& pArgs)
{
fstream dirlist;
+ std::string dirname, archivename;
+ char hostname[HBLEN];
comm_layer_inner_status("File Transfer: Creating a report...");
@@ -181,12 +183,26 @@ void CFileTransfer::Run(const std::string& pActiveDir, const std::string& pArgs)
dirlist.open(FILETRANSFER_DIRLIST, fstream::out | fstream::app );
dirlist << pActiveDir << endl;
dirlist.close();
+ } else if(pArgs == "one")
+ {
+ /* just send one archive */
+ gethostname(hostname,HBLEN);
+ archivename = std::string(hostname) + "-"
+ + DirBase(pActiveDir) + m_sArchiveType;
+ try
+ {
+ CreateArchive(archivename,pActiveDir);
+ SendFile(m_sURL, archivename);
+ }
+ catch (CABRTException& e)
+ {
+ comm_layer_inner_warning("CFileTransfer::Run(): Cannot create and send an archive: " + e.what());
+ comm_layer_inner_status("CFileTransfer::Run(): Cannot create and send an archive: " + e.what());
+ }
+ unlink(archivename.c_str());
}
else
{
- std::string dirname, archivename;
-
- char hostname[HBLEN];
gethostname(hostname,HBLEN);
diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp
index 9ba6a63..977499e 100644
--- a/lib/Plugins/Mailx.cpp
+++ b/lib/Plugins/Mailx.cpp
@@ -64,11 +64,9 @@ void CMailx::AddMailxArg(const std::string& pArg)
}
}
-
void CMailx::ExecMailx(uid_t uid, const std::string& pText)
{
int pipein[2];
- char buff[1024];
pid_t child;
struct passwd* pw = getpwuid(uid);
@@ -107,7 +105,6 @@ void CMailx::ExecMailx(uid_t uid, const std::string& pText)
wait(NULL); /* why? */
}
-
void CMailx::SendEmail(const std::string& pSubject, const std::string& pText, const std::string& pUID)
{
comm_layer_inner_status("Sending an email...");
@@ -120,10 +117,8 @@ void CMailx::SendEmail(const std::string& pSubject, const std::string& pText, co
AddMailxArg("");
ExecMailx(atoi(pUID.c_str()), pText);
-
}
-
std::string CMailx::Report(const map_crash_report_t& pCrashReport, const std::string& pArgs)
{
comm_layer_inner_status("Creating a report...");
diff --git a/lib/Plugins/abrt-FileTransfer.7 b/lib/Plugins/abrt-FileTransfer.7
index a04dd42..d1d3b25 100644
--- a/lib/Plugins/abrt-FileTransfer.7
+++ b/lib/Plugins/abrt-FileTransfer.7
@@ -22,6 +22,11 @@ There are two modes of invocation:
\fI"store"\fP, the plugin stores a record of the occurrence of
the crash in its internal list.
.P
+* If you use the parameter
+\fI"one"\fP, the plugin will transfer this specific crash,
+on which it was invoked, without storing it in the internal
+list.
+.P
* If you use some other parameter, or no parameter at all, the
plugin will iterate through the internal list and will send
every recorded crash to the server specified in the \fIFileTransfer.conf\fP