summaryrefslogtreecommitdiffstats
path: root/lib/Plugins/TicketUploader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Plugins/TicketUploader.cpp')
-rw-r--r--lib/Plugins/TicketUploader.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Plugins/TicketUploader.cpp b/lib/Plugins/TicketUploader.cpp
index aa6d412..06b6cde 100644
--- a/lib/Plugins/TicketUploader.cpp
+++ b/lib/Plugins/TicketUploader.cpp
@@ -112,7 +112,7 @@ void CTicketUploader::SendFile(const char *pURL, const char *pFilename)
string wholeURL = concat_path_file(pURL, base);
int count = m_nRetryCount;
int result;
- do
+ while (1)
{
FILE* f = fopen(pFilename, "r");
if (!f)
@@ -144,9 +144,11 @@ void CTicketUploader::SendFile(const char *pURL, const char *pFilename)
{
update_client(_("Sending failed, trying again. %s"), curl_easy_strerror((CURLcode)result));
}
+ 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));
if (count <= 0 && result != 0)
{