From 0a2cd9537bb2333c815bc6ab674cdf389638909d Mon Sep 17 00:00:00 2001 From: tosh Date: Wed, 27 Mar 2013 06:39:27 +0100 Subject: [PATCH] fixes broken error handling --- shared/src/UrlReader.cpp | 2 +- shared/src/UrlReader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/src/UrlReader.cpp b/shared/src/UrlReader.cpp index 5bd82fe4d1..4b16081fb0 100644 --- a/shared/src/UrlReader.cpp +++ b/shared/src/UrlReader.cpp @@ -54,7 +54,7 @@ bool UrlReader::perform(char const* url, transfer_callback* cb) while (val_ra_size > 0 && str_error == success) cb(0l, 0, 0, this); } - else if (str_error != success) + else if (str_error == success) str_error = curl_easy_strerror(rc); return rc == CURLE_OK; diff --git a/shared/src/UrlReader.h b/shared/src/UrlReader.h index dcd5ff3278..273302bb7e 100644 --- a/shared/src/UrlReader.h +++ b/shared/src/UrlReader.h @@ -164,7 +164,7 @@ inline char const* UrlReader::getError() const { return this->str_error; } inline void UrlReader::setError(char const* static_c_string) { - if (this->str_error != success) + if (this->str_error == success) this->str_error = static_c_string; }