diff options
author | Zdenek Prikryl <zprikryl@redhat.com> | 2009-06-03 10:17:48 +0200 |
---|---|---|
committer | Zdenek Prikryl <zprikryl@redhat.com> | 2009-06-03 10:17:48 +0200 |
commit | 9cc201bc8e84286d0626d18c15c1b6866f65d2ce (patch) | |
tree | 0ca5fd65dd2755b9297b240fa1de8adf1a588927 /lib/Plugins | |
parent | 3307dcbc68be041a3f0061442d4119cbc8eca4b7 (diff) | |
download | abrt-9cc201bc8e84286d0626d18c15c1b6866f65d2ce.tar.gz abrt-9cc201bc8e84286d0626d18c15c1b6866f65d2ce.tar.xz abrt-9cc201bc8e84286d0626d18c15c1b6866f65d2ce.zip |
added new option (dnovotny)
Diffstat (limited to 'lib/Plugins')
-rw-r--r-- | lib/Plugins/FileTransfer.conf | 3 | ||||
-rw-r--r-- | lib/Plugins/FileTransfer.cpp | 7 | ||||
-rw-r--r-- | lib/Plugins/FileTransfer.h | 4 |
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/Plugins/FileTransfer.conf b/lib/Plugins/FileTransfer.conf index c8da603a..cf675e45 100644 --- a/lib/Plugins/FileTransfer.conf +++ b/lib/Plugins/FileTransfer.conf @@ -14,3 +14,6 @@ ArchiveType = .tar.gz #how many times we try to upload the file RetryCount = 3 + +#how long we wait between we retry the upload (in seconds) +RetryDelay = 20 diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp index 2600caa5..db289718 100644 --- a/lib/Plugins/FileTransfer.cpp +++ b/lib/Plugins/FileTransfer.cpp @@ -111,7 +111,7 @@ void CFileTransfer::SendFile(const std::string& pURL, fclose(f); } /*retry the upload if not succesful, wait a bit before next try*/ - while( result!=0 && count-- != 0 && (sleep(20),1) ); + while( result!=0 && count-- != 0 && (sleep(m_nRetryDelay),1) ); } @@ -241,6 +241,11 @@ void CFileTransfer::LoadSettings(const std::string& pPath) { m_nRetryCount = atoi(settings["RetryCount"].c_str()); } + + if (settings.find("RetryDelay")!= settings.end()) + { + m_nRetryDelay = atoi(settings["RetryDelay"].c_str()); + } if (settings.find("ArchiveType")!= settings.end()) { diff --git a/lib/Plugins/FileTransfer.h b/lib/Plugins/FileTransfer.h index 0c3a47a0..03e788d3 100644 --- a/lib/Plugins/FileTransfer.h +++ b/lib/Plugins/FileTransfer.h @@ -33,6 +33,7 @@ class CFileTransfer : public CAction std::string m_sURL; std::string m_sArchiveType; int m_nRetryCount; + int m_nRetryDelay; void CreateArchive(const std::string& pArchiveName, const std::string& pDir); @@ -44,6 +45,7 @@ class CFileTransfer : public CAction public: CFileTransfer() : m_nRetryCount(3), + m_nRetryDelay(20), m_sArchiveType(".tar.gz") {} virtual ~CFileTransfer() {} @@ -57,7 +59,7 @@ class CFileTransfer : public CAction PLUGIN_INFO(ACTION, CFileTransfer, "FileTransfer", - "0.0.5", + "0.0.6", "Sends a report via FTP or SCTP", "dnovotny@redhat.com", "https://fedorahosted.org/crash-catcher/wiki"); |