From c88b237473a75310722bac8d65a028a33a573215 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 20 Jun 2014 04:19:45 +0100 Subject: Updated LLExperienceCache::LLExperienceResponder to work with updated LLCurl::Responder interface, to fix ACME-1532 and ACME-1525 --- indra/llmessage/llexperiencecache.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'indra/llmessage/llexperiencecache.cpp') diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index c8deaac1ef..1fb77c4391 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -257,7 +257,7 @@ namespace LLExperienceCache LLSDSerialize::toPrettyXML(data, ostr); } - class LLExperienceResponder : public LLHTTPClient::Responder + class LLExperienceResponder : public LLCurl::Responder { public: LLExperienceResponder(const ask_queue_t& keys) @@ -266,14 +266,9 @@ namespace LLExperienceCache } - virtual void completedHeader(U32 status, const std::string& reason, const LLSD& content) + /*virtual*/ void httpSuccess() { - mHeaders = content; - } - - virtual void result(const LLSD& content) - { - LLSD experiences = content["experience_keys"]; + LLSD experiences = getContent()["experience_keys"]; LLSD::array_const_iterator it = experiences.beginArray(); for( /**/ ; it != experiences.endArray(); ++it) { @@ -287,7 +282,7 @@ namespace LLExperienceCache processExperience(public_key, row); } - LLSD error_ids = content["error_ids"]; + LLSD error_ids = getContent()["error_ids"]; LLSD::array_const_iterator errIt = error_ids.beginArray(); for( /**/ ; errIt != error_ids.endArray() ; ++errIt ) { @@ -306,13 +301,13 @@ namespace LLExperienceCache LL_DEBUGS("ExperienceCache") << sCache.size() << " cached experiences" << LL_ENDL; } - virtual void error(U32 status, const std::string& reason) + /*virtual*/ void httpFailure() { - LL_WARNS("ExperienceCache") << "Request failed "<first; exp["key_type"] = it->second; exp["uuid"] = it->first; - exp["error"] = (LLSD::Integer)status; + exp["error"] = (LLSD::Integer)getStatus(); exp[QUOTA] = DEFAULT_QUOTA; LLExperienceCache::processExperience(it->first, exp); @@ -344,7 +339,7 @@ namespace LLExperienceCache { // Retry-After takes priority - LLSD retry_after = mHeaders["retry-after"]; + LLSD retry_after = getResponseHeaders()["retry-after"]; if (retry_after.isDefined()) { // We only support the delta-seconds type @@ -358,7 +353,7 @@ namespace LLExperienceCache // If no Retry-After, look for Cache-Control max-age F64 expires = 0.0; - if (LLExperienceCache::expirationFromCacheControl(mHeaders, &expires)) + if (LLExperienceCache::expirationFromCacheControl(getResponseHeaders(), &expires)) { return expires; } @@ -387,7 +382,6 @@ namespace LLExperienceCache private: ask_queue_t mKeys; - LLSD mHeaders; }; void requestExperiences() -- cgit v1.2.3