Skip to content
Snippets Groups Projects
Commit e7a1e619 authored by Rider Linden's avatar Rider Linden
Browse files

Slightly cleaner than this-> ing everythnig.

parent 530bf560
No related branches found
No related tags found
No related merge requests found
...@@ -131,18 +131,18 @@ std::string HttpStatus::toString() const ...@@ -131,18 +131,18 @@ std::string HttpStatus::toString() const
{ {
return std::string(""); return std::string("");
} }
switch (this->mDetails->mType) switch (getType())
{ {
case EXT_CURL_EASY: case EXT_CURL_EASY:
return std::string(curl_easy_strerror(CURLcode(this->mDetails->mStatus))); return std::string(curl_easy_strerror(CURLcode(getStatus())));
case EXT_CURL_MULTI: case EXT_CURL_MULTI:
return std::string(curl_multi_strerror(CURLMcode(this->mDetails->mStatus))); return std::string(curl_multi_strerror(CURLMcode(getStatus())));
case LLCORE: case LLCORE:
if (this->mDetails->mStatus >= 0 && this->mDetails->mStatus < llcore_errors_count) if (getStatus() >= 0 && getStatus() < llcore_errors_count)
{ {
return std::string(llcore_errors[this->mDetails->mStatus]); return std::string(llcore_errors[getStatus()]);
} }
break; break;
...@@ -154,7 +154,7 @@ std::string HttpStatus::toString() const ...@@ -154,7 +154,7 @@ std::string HttpStatus::toString() const
while (true) while (true)
{ {
int at((bottom + top) / 2); int at((bottom + top) / 2);
if (this->mDetails->mType == http_errors[at].mCode) if (getType() == http_errors[at].mCode)
{ {
return std::string(http_errors[at].mText); return std::string(http_errors[at].mText);
} }
...@@ -162,7 +162,7 @@ std::string HttpStatus::toString() const ...@@ -162,7 +162,7 @@ std::string HttpStatus::toString() const
{ {
break; break;
} }
else if (this->mDetails->mType < http_errors[at].mCode) else if (getType() < http_errors[at].mCode)
{ {
top = at; top = at;
} }
...@@ -182,9 +182,9 @@ std::string HttpStatus::toTerseString() const ...@@ -182,9 +182,9 @@ std::string HttpStatus::toTerseString() const
{ {
std::ostringstream result; std::ostringstream result;
unsigned int error_value((unsigned short)(this->mDetails->mStatus)); unsigned int error_value((unsigned short)getStatus());
switch (this->mDetails->mType) switch (getType())
{ {
case EXT_CURL_EASY: case EXT_CURL_EASY:
result << "Easy_"; result << "Easy_";
...@@ -202,7 +202,7 @@ std::string HttpStatus::toTerseString() const ...@@ -202,7 +202,7 @@ std::string HttpStatus::toTerseString() const
if (isHttpStatus()) if (isHttpStatus())
{ {
result << "Http_"; result << "Http_";
error_value = this->mDetails->mType; error_value = getType();
} }
else else
{ {
...@@ -244,7 +244,7 @@ bool HttpStatus::isRetryable() const ...@@ -244,7 +244,7 @@ bool HttpStatus::isRetryable() const
// Disable the '*this == inv_status' test and look for 'Core_9' // Disable the '*this == inv_status' test and look for 'Core_9'
// failures in log files. // failures in log files.
return ((isHttpStatus() && this->mDetails->mType >= 499 && this->mDetails->mType <= 599) || // Include special 499 in retryables return ((isHttpStatus() && getType() >= 499 && getType() <= 599) || // Include special 499 in retryables
*this == cant_connect || // Connection reset/endpoint problems *this == cant_connect || // Connection reset/endpoint problems
*this == cant_res_proxy || // DNS problems *this == cant_res_proxy || // DNS problems
*this == cant_res_host || // DNS problems *this == cant_res_host || // DNS problems
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment