summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/FileTransfer.cpp
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-12-14 17:20:03 +0100
committerKarel Klic <kklic@redhat.com>2009-12-14 17:20:03 +0100
commitb6fbdbdee4e4a78528d765bbf4ddb1087adce5f4 (patch)
tree6af427ef59b46a9c452c4f263908f27be9b20ce5 /lib/Plugins/FileTransfer.cpp
parenta24d2906c51e3740e6e0acf8f0093827b4e35bc3 (diff)
parentfdce1d751b45bbd0210b45989f4f4c0e092683dc (diff)
downloadabrt-b6fbdbdee4e4a78528d765bbf4ddb1087adce5f4.tar.gz
abrt-b6fbdbdee4e4a78528d765bbf4ddb1087adce5f4.tar.xz
abrt-b6fbdbdee4e4a78528d765bbf4ddb1087adce5f4.zip
Merge branch 'master' of git://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Plugins/FileTransfer.cpp')
-rw-r--r--lib/Plugins/FileTransfer.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp
index 03ee464..c98645c 100644
--- a/lib/Plugins/FileTransfer.cpp
+++ b/lib/Plugins/FileTransfer.cpp
@@ -68,9 +68,8 @@ void CFileTransfer::SendFile(const char *pURL, const char *pFilename)
string wholeURL = concat_path_file(pURL, pFilename);
- int result;
int count = m_nRetryCount;
- do
+ while (1)
{
FILE *f;
struct stat buf;
@@ -99,12 +98,14 @@ void CFileTransfer::SendFile(const char *pURL, const char *pFilename)
curl_easy_setopt(curl, CURLOPT_READDATA, f);
curl_easy_setopt(curl, CURLOPT_INFILESIZE, buf.st_size);
/* everything is done here; result 0 means success */
- result = curl_easy_perform(curl);
+ int result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
fclose(f);
+ if (result == 0 || --count <= 0)
+ break;
+ /* retry the upload if not succesful, wait a bit before next try */
+ sleep(m_nRetryDelay);
}
- /*retry the upload if not succesful, wait a bit before next try*/
- while (result != 0 && --count >= 0 && (sleep(m_nRetryDelay), 1));
}
/*