diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-09-29 17:27:38 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-09-29 18:20:23 -0700 |
commit | 686c967c8ece2e3f09a06c2466096317e8fd649c (patch) | |
tree | 59954ae782f2bac3b87aa3d6ec86d2988ea3e49b /platform | |
parent | 7112d436093d651ac0bdba4f9eaaf63e682b22a3 (diff) | |
download | qtlocation-mapboxgl-686c967c8ece2e3f09a06c2466096317e8fd649c.tar.gz |
[ios] [android] Use Response::NotFound in other HTTP implementations too
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/http_request_android.cpp | 3 | ||||
-rw-r--r-- | platform/darwin/http_request_nsurl.mm | 3 | ||||
-rw-r--r-- | platform/default/http_request_curl.cpp | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/platform/android/http_request_android.cpp b/platform/android/http_request_android.cpp index 5c5805906c..6e44db4b13 100644 --- a/platform/android/http_request_android.cpp +++ b/platform/android/http_request_android.cpp @@ -292,6 +292,9 @@ void HTTPAndroidRequest::onResponse(int code, std::string message, std::string e } else if (code == 200) { response->status = Response::Successful; status = ResponseStatus::Successful; + } else if (responseCode == 404) { + response->status = Response::NotFound; + status = ResponseStatus::Successful; } else if (code >= 500 && code < 600) { response->status = Response::Error; response->message = "HTTP status code " + util::toString(code); diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm index 33f5f043e2..f1f6e3fbb9 100644 --- a/platform/darwin/http_request_nsurl.mm +++ b/platform/darwin/http_request_nsurl.mm @@ -294,6 +294,9 @@ void HTTPNSURLRequest::handleResult(NSData *data, NSURLResponse *res, NSError *e } else if (responseCode == 200) { response->status = Response::Successful; status = ResponseStatus::Successful; + } else if (responseCode == 404) { + response->status = Response::NotFound; + status = ResponseStatus::Successful; } else if (responseCode >= 500 && responseCode < 600) { // Server errors may be temporary, so back off exponentially. response->status = Response::Error; diff --git a/platform/default/http_request_curl.cpp b/platform/default/http_request_curl.cpp index 0f7f8c0ac5..7ea9208556 100644 --- a/platform/default/http_request_curl.cpp +++ b/platform/default/http_request_curl.cpp @@ -703,6 +703,9 @@ void HTTPCURLRequest::handleResult(CURLcode code) { } else if (responseCode == 200) { response->status = Response::Successful; return finish(ResponseStatus::Successful); + } else if (responseCode == 404) { + response->status = Response::NotFound; + return finish(ResponseStatus::Successful); } else if (responseCode >= 500 && responseCode < 600) { // Server errors may be temporary, so back off exponentially. response->status = Response::Error; |