diff options
| author | Karel Klic <kklic@redhat.com> | 2009-12-14 17:20:03 +0100 |
|---|---|---|
| committer | Karel Klic <kklic@redhat.com> | 2009-12-14 17:20:03 +0100 |
| commit | b6fbdbdee4e4a78528d765bbf4ddb1087adce5f4 (patch) | |
| tree | 6af427ef59b46a9c452c4f263908f27be9b20ce5 /lib/Plugins/Catcut.cpp | |
| parent | a24d2906c51e3740e6e0acf8f0093827b4e35bc3 (diff) | |
| parent | fdce1d751b45bbd0210b45989f4f4c0e092683dc (diff) | |
| download | abrt-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/Catcut.cpp')
| -rw-r--r-- | lib/Plugins/Catcut.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp index 9974faa..ebddfdd 100644 --- a/lib/Plugins/Catcut.cpp +++ b/lib/Plugins/Catcut.cpp @@ -50,7 +50,7 @@ send_string(const char *pURL, return; } - do + while (1) { int content_length = strlen(pContent); FILE* f = fmemopen((void*)pContent, content_length, "r"); @@ -63,9 +63,11 @@ send_string(const char *pURL, if (!result) return; update_client(_("Sending failed, try it again: %s"), curl_easy_strerror((CURLcode)result)); + if (--retryCount <= 0) + break; + /* retry the upload if not succesful, wait a bit before next try */ + sleep(retryDelaySeconds); } - /*retry the upload if not succesful, wait a bit before next try*/ - while (--retryCount != 0 && (sleep(retryDelaySeconds), 1)); throw CABRTException(EXCEP_PLUGIN, "send_string: can't send string"); } @@ -84,7 +86,7 @@ send_file(const char *pURL, update_client(_("Sending file %s to %s"), pFilename, pURL); - do + while (1) { FILE* f = fopen(pFilename, "r"); if (!f) @@ -99,9 +101,11 @@ send_file(const char *pURL, if (!result) return; update_client(_("Sending failed, try it again: %s"), curl_easy_strerror((CURLcode)result)); + if (--retryCount <= 0) + break; + /* retry the upload if not succesful, wait a bit before next try */ + sleep(retryDelaySeconds); } - /*retry the upload if not succesful, wait a bit before next try*/ - while (--retryCount != 0 && (sleep(retryDelaySeconds), 1)); throw CABRTException(EXCEP_PLUGIN, "send_file: can't send file"); } |
