summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/FileTransfer.cpp
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/Plugins/FileTransfer.cpp
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/Plugins/FileTransfer.cpp')
-rw-r--r--lib/Plugins/FileTransfer.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp
index 981e574d..d3d09969 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);