diff options
author | Daniel Novotny <dnovotny@dhcp-0-118.brq.redhat.com> | 2009-08-25 15:34:32 +0200 |
---|---|---|
committer | Daniel Novotny <dnovotny@dhcp-0-118.brq.redhat.com> | 2009-08-25 15:34:32 +0200 |
commit | e4185013d1309b80633d17b84837913ac8705438 (patch) | |
tree | d1a0df3b1dca67df12c0cb06f8f5ff5b8812931d /lib/Plugins | |
parent | 3008b32dd0f78b0b2c09e05a7b47080c7cb75d38 (diff) | |
download | abrt-e4185013d1309b80633d17b84837913ac8705438.tar.gz abrt-e4185013d1309b80633d17b84837913ac8705438.tar.xz abrt-e4185013d1309b80633d17b84837913ac8705438.zip |
add new parameter to FileTransfer plugin
Diffstat (limited to 'lib/Plugins')
-rw-r--r-- | lib/Plugins/FileTransfer.cpp | 22 | ||||
-rw-r--r-- | lib/Plugins/abrt-FileTransfer.7 | 5 |
2 files changed, 24 insertions, 3 deletions
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/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 |