From 99e56eedabfe34dbfbfd8105759403173de72d44 Mon Sep 17 00:00:00 2001
From: Rider Linden
Date: Fri, 28 Aug 2015 16:55:33 -0700
Subject: MAINT-5575: Begin conversion to Singleton<> for Experience Cache.
Commited on branch so that I don't trigger a build of it until I'm ready.
--HG--
branch : MAINT-5575
---
indra/llmessage/llexperiencecache.cpp | 925 +++++++++++++++++-----------------
1 file changed, 465 insertions(+), 460 deletions(-)
(limited to 'indra/llmessage/llexperiencecache.cpp')
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index 52b60a176e..d196d7da93 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -34,608 +34,613 @@
#include "boost/tokenizer.hpp"
-namespace LLExperienceCache
-{
+typedef std::map KeyMap;
+KeyMap privateToPublicKeyMap;
- typedef std::map KeyMap;
- KeyMap privateToPublicKeyMap;
+void mapKeys(const LLSD& legacyKeys);
- void mapKeys(const LLSD& legacyKeys);
+std::string sLookupURL;
- std::string sLookupURL;
+typedef std::map ask_queue_t;
+ask_queue_t sAskQueue;
- typedef std::map ask_queue_t;
- ask_queue_t sAskQueue;
+typedef std::map pending_queue_t;
+pending_queue_t sPendingQueue;
- typedef std::map pending_queue_t;
- pending_queue_t sPendingQueue;
+LLExperienceCache::cache_t sCache;
+int sMaximumLookups = 10;
- cache_t sCache;
- int sMaximumLookups = 10;
+LLFrameTimer sRequestTimer;
- LLFrameTimer sRequestTimer;
+// Periodically clean out expired entries from the cache
+LLFrameTimer sEraseExpiredTimer;
- // Periodically clean out expired entries from the cache
- LLFrameTimer sEraseExpiredTimer;
+// May have multiple callbacks for a single ID, which are
+// represented as multiple slots bound to the signal.
+// Avoid copying signals via pointers.
+typedef std::map signal_map_t;
+signal_map_t sSignalMap;
- // May have multiple callbacks for a single ID, which are
- // represented as multiple slots bound to the signal.
- // Avoid copying signals via pointers.
- typedef std::map signal_map_t;
- signal_map_t sSignalMap;
+bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age);
+void eraseExpired();
- bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age);
- void eraseExpired();
+//=========================================================================
+LLExperienceCache::LLExperienceCache()
+{
+}
- void processExperience( const LLUUID& public_key, const LLSD& experience )
- {
- sCache[public_key]=experience;
- LLSD & row = sCache[public_key];
+LLExperienceCache::~LLExperienceCache()
+{
+}
- if(row.has(EXPIRES))
- {
- row[EXPIRES] = row[EXPIRES].asReal() + LLFrameTimer::getTotalSeconds();
- }
+//-------------------------------------------------------------------------
+void LLExperienceCache::importFile(std::istream& istr)
+{
+ LLSD data;
+ S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr);
+ if (parse_count < 1) return;
- if(row.has(EXPERIENCE_ID))
- {
- sPendingQueue.erase(row[EXPERIENCE_ID].asUUID());
- }
+ LLSD experiences = data["experiences"];
- //signal
- signal_map_t::iterator sig_it = sSignalMap.find(public_key);
- if (sig_it != sSignalMap.end())
- {
- callback_signal_t* signal = sig_it->second;
- (*signal)(experience);
+ LLUUID public_key;
+ LLSD::map_const_iterator it = experiences.beginMap();
+ for (; it != experiences.endMap(); ++it)
+ {
+ public_key.set(it->first);
+ sCache[public_key] = it->second;
+ }
- sSignalMap.erase(public_key);
+ LL_DEBUGS("ExperienceCache") << "importFile() loaded " << sCache.size() << LL_ENDL;
+}
- delete signal;
- }
- }
+void LLExperienceCache::exportFile(std::ostream& ostr) const
+{
+ LLSD experiences;
- void initClass( )
- {
- }
+ cache_t::const_iterator it = sCache.begin();
+ for (; it != sCache.end(); ++it)
+ {
+ if (!it->second.has(EXPERIENCE_ID) || it->second[EXPERIENCE_ID].asUUID().isNull() ||
+ it->second.has("DoesNotExist") || (it->second.has(PROPERTIES) && it->second[PROPERTIES].asInteger() & PROPERTY_INVALID))
+ continue;
- const cache_t& getCached()
+ experiences[it->first.asString()] = it->second;
+ }
+
+ LLSD data;
+ data["experiences"] = experiences;
+
+ LLSDSerialize::toPrettyXML(data, ostr);
+}
+
+// *TODO$: Rider: These three functions not seem to be used... it may be useful in testing.
+void LLExperienceCache::bootstrap(const LLSD& legacyKeys, int initialExpiration)
+{
+ mapKeys(legacyKeys);
+ LLSD::array_const_iterator it = legacyKeys.beginArray();
+ for (/**/; it != legacyKeys.endArray(); ++it)
+ {
+ LLSD experience = *it;
+ if (experience.has(EXPERIENCE_ID))
+ {
+ if (!experience.has(EXPIRES))
+ {
+ experience[EXPIRES] = initialExpiration;
+ }
+ processExperience(experience[EXPERIENCE_ID].asUUID(), experience);
+ }
+ else
+ {
+ LL_WARNS("ExperienceCache")
+ << "Skipping bootstrap entry which is missing " << EXPERIENCE_ID
+ << LL_ENDL;
+ }
+ }
+}
+
+void LLExperienceCache::mapKeys(const LLSD& legacyKeys)
+{
+ LLSD::array_const_iterator exp = legacyKeys.beginArray();
+ for (/**/; exp != legacyKeys.endArray(); ++exp)
+ {
+ if (exp->has(LLExperienceCache::EXPERIENCE_ID) && exp->has(LLExperienceCache::PRIVATE_KEY))
+ {
+ privateToPublicKeyMap[(*exp)[LLExperienceCache::PRIVATE_KEY].asUUID()] = (*exp)[LLExperienceCache::EXPERIENCE_ID].asUUID();
+ }
+ }
+}
+
+LLUUID LLExperienceCache::getExperienceId(const LLUUID& private_key, bool null_if_not_found)
+{
+ if (private_key.isNull())
+ return LLUUID::null;
+
+ KeyMap::const_iterator it = privateToPublicKeyMap.find(private_key);
+ if (it == privateToPublicKeyMap.end())
+ {
+ if (null_if_not_found)
+ {
+ return LLUUID::null;
+ }
+ return private_key;
+ }
+ LL_WARNS("LLExperience") << "converted private key " << private_key << " to experience_id " << it->second << LL_ENDL;
+ return it->second;
+}
+
+//=========================================================================
+void LLExperienceCache::processExperience(const LLUUID& public_key, const LLSD& experience)
+{
+ sCache[public_key]=experience;
+ LLSD & row = sCache[public_key];
+
+ if(row.has(EXPIRES))
{
- return sCache;
+ row[EXPIRES] = row[EXPIRES].asReal() + LLFrameTimer::getTotalSeconds();
}
- void setMaximumLookups( int maximumLookups)
+ if(row.has(EXPERIENCE_ID))
{
- sMaximumLookups = maximumLookups;
+ sPendingQueue.erase(row[EXPERIENCE_ID].asUUID());
}
- void bootstrap(const LLSD& legacyKeys, int initialExpiration)
+ //signal
+ signal_map_t::iterator sig_it = sSignalMap.find(public_key);
+ if (sig_it != sSignalMap.end())
{
- mapKeys(legacyKeys);
- LLSD::array_const_iterator it = legacyKeys.beginArray();
- for(/**/; it != legacyKeys.endArray(); ++it)
- {
- LLSD experience = *it;
- if(experience.has(EXPERIENCE_ID))
- {
- if(!experience.has(EXPIRES))
- {
- experience[EXPIRES] = initialExpiration;
- }
- processExperience(experience[EXPERIENCE_ID].asUUID(), experience);
- }
- else
- {
- LL_WARNS("ExperienceCache")
- << "Skipping bootstrap entry which is missing " << EXPERIENCE_ID
- << LL_ENDL;
- }
- }
+ callback_signal_t* signal = sig_it->second;
+ (*signal)(experience);
+
+ sSignalMap.erase(public_key);
+
+ delete signal;
}
+}
+const LLExperienceCache::cache_t& LLExperienceCache::getCached()
+{
+ return sCache;
+}
+
+void LLExperienceCache::setMaximumLookups(int maximumLookups)
+{
+ sMaximumLookups = maximumLookups;
+}
- bool expirationFromCacheControl(LLSD headers, F64 *expires)
+bool LLExperienceCache::expirationFromCacheControl(LLSD headers, F64 *expires)
+{
+ // Allow the header to override the default
+ LLSD cache_control_header = headers["cache-control"];
+ if (cache_control_header.isDefined())
{
- // Allow the header to override the default
- LLSD cache_control_header = headers["cache-control"];
- if (cache_control_header.isDefined())
+ S32 max_age = 0;
+ std::string cache_control = cache_control_header.asString();
+ if (max_age_from_cache_control(cache_control, &max_age))
{
- S32 max_age = 0;
- std::string cache_control = cache_control_header.asString();
- if (max_age_from_cache_control(cache_control, &max_age))
- {
- LL_WARNS("ExperienceCache")
- << "got EXPIRES from headers, max_age " << max_age
- << LL_ENDL;
- F64 now = LLFrameTimer::getTotalSeconds();
- *expires = now + (F64)max_age;
- return true;
- }
+ LL_WARNS("ExperienceCache")
+ << "got EXPIRES from headers, max_age " << max_age
+ << LL_ENDL;
+ F64 now = LLFrameTimer::getTotalSeconds();
+ *expires = now + (F64)max_age;
+ return true;
}
- return false;
}
+ return false;
+}
- static const std::string MAX_AGE("max-age");
- static const boost::char_separator EQUALS_SEPARATOR("=");
- static const boost::char_separator COMMA_SEPARATOR(",");
+static const std::string MAX_AGE("max-age");
+static const boost::char_separator EQUALS_SEPARATOR("=");
+static const boost::char_separator COMMA_SEPARATOR(",");
+
+bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age)
+{
+ // Split the string on "," to get a list of directives
+ typedef boost::tokenizer > tokenizer;
+ tokenizer directives(cache_control, COMMA_SEPARATOR);
- bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age)
+ tokenizer::iterator token_it = directives.begin();
+ for ( ; token_it != directives.end(); ++token_it)
{
- // Split the string on "," to get a list of directives
- typedef boost::tokenizer > tokenizer;
- tokenizer directives(cache_control, COMMA_SEPARATOR);
+ // Tokens may have leading or trailing whitespace
+ std::string token = *token_it;
+ LLStringUtil::trim(token);
- tokenizer::iterator token_it = directives.begin();
- for ( ; token_it != directives.end(); ++token_it)
+ if (token.compare(0, MAX_AGE.size(), MAX_AGE) == 0)
{
- // Tokens may have leading or trailing whitespace
- std::string token = *token_it;
- LLStringUtil::trim(token);
-
- if (token.compare(0, MAX_AGE.size(), MAX_AGE) == 0)
+ // ...this token starts with max-age, so let's chop it up by "="
+ tokenizer subtokens(token, EQUALS_SEPARATOR);
+ tokenizer::iterator subtoken_it = subtokens.begin();
+
+ // Must have a token
+ if (subtoken_it == subtokens.end()) return false;
+ std::string subtoken = *subtoken_it;
+
+ // Must exactly equal "max-age"
+ LLStringUtil::trim(subtoken);
+ if (subtoken != MAX_AGE) return false;
+
+ // Must have another token
+ ++subtoken_it;
+ if (subtoken_it == subtokens.end()) return false;
+ subtoken = *subtoken_it;
+
+ // Must be a valid integer
+ // *NOTE: atoi() returns 0 for invalid values, so we have to
+ // check the string first.
+ // *TODO: Do servers ever send "0000" for zero? We don't handle it
+ LLStringUtil::trim(subtoken);
+ if (subtoken == "0")
{
- // ...this token starts with max-age, so let's chop it up by "="
- tokenizer subtokens(token, EQUALS_SEPARATOR);
- tokenizer::iterator subtoken_it = subtokens.begin();
-
- // Must have a token
- if (subtoken_it == subtokens.end()) return false;
- std::string subtoken = *subtoken_it;
-
- // Must exactly equal "max-age"
- LLStringUtil::trim(subtoken);
- if (subtoken != MAX_AGE) return false;
-
- // Must have another token
- ++subtoken_it;
- if (subtoken_it == subtokens.end()) return false;
- subtoken = *subtoken_it;
-
- // Must be a valid integer
- // *NOTE: atoi() returns 0 for invalid values, so we have to
- // check the string first.
- // *TODO: Do servers ever send "0000" for zero? We don't handle it
- LLStringUtil::trim(subtoken);
- if (subtoken == "0")
- {
- *max_age = 0;
- return true;
- }
- S32 val = atoi( subtoken.c_str() );
- if (val > 0 && val < S32_MAX)
- {
- *max_age = val;
- return true;
- }
- return false;
+ *max_age = 0;
+ return true;
}
+ S32 val = atoi( subtoken.c_str() );
+ if (val > 0 && val < S32_MAX)
+ {
+ *max_age = val;
+ return true;
+ }
+ return false;
}
- return false;
}
+ return false;
+}
- void importFile(std::istream& istr)
+class LLExperienceResponder : public LLHTTPClient::Responder
+{
+public:
+ LLExperienceResponder(const ask_queue_t& keys)
+ :mKeys(keys)
{
- LLSD data;
- S32 parse_count = LLSDSerialize::fromXMLDocument(data, istr);
- if(parse_count < 1) return;
-
- LLSD experiences = data["experiences"];
- LLUUID public_key;
- LLSD::map_const_iterator it = experiences.beginMap();
- for(; it != experiences.endMap() ; ++it)
- {
- public_key.set(it->first);
- sCache[public_key]=it->second;
- }
-
- LL_DEBUGS("ExperienceCache") << "importFile() loaded " << sCache.size() << LL_ENDL;
}
- void exportFile(std::ostream& ostr)
+ /*virtual*/ void httpCompleted()
{
- LLSD experiences;
-
- cache_t::const_iterator it =sCache.begin();
- for( ; it != sCache.end() ; ++it)
+ LLSD experiences = getContent()["experience_keys"];
+ LLSD::array_const_iterator it = experiences.beginArray();
+ for( /**/ ; it != experiences.endArray(); ++it)
{
- if(!it->second.has(EXPERIENCE_ID) || it->second[EXPERIENCE_ID].asUUID().isNull() ||
- it->second.has("DoesNotExist") || (it->second.has(PROPERTIES) && it->second[PROPERTIES].asInteger() & PROPERTY_INVALID))
- continue;
+ const LLSD& row = *it;
+ LLUUID public_key = row[EXPERIENCE_ID].asUUID();
- experiences[it->first.asString()] = it->second;
- }
- LLSD data;
- data["experiences"] = experiences;
+ LL_DEBUGS("ExperienceCache") << "Received result for " << public_key
+ << " display '" << row[LLExperienceCache::NAME].asString() << "'" << LL_ENDL ;
- LLSDSerialize::toPrettyXML(data, ostr);
- }
+ processExperience(public_key, row);
+ }
- class LLExperienceResponder : public LLHTTPClient::Responder
- {
- public:
- LLExperienceResponder(const ask_queue_t& keys)
- :mKeys(keys)
+ LLSD error_ids = getContent()["error_ids"];
+ LLSD::array_const_iterator errIt = error_ids.beginArray();
+ for( /**/ ; errIt != error_ids.endArray() ; ++errIt )
{
-
+ LLUUID id = errIt->asUUID();
+ LLSD exp;
+ exp[EXPIRES]=DEFAULT_EXPIRATION;
+ exp[EXPERIENCE_ID] = id;
+ exp[PROPERTIES]=PROPERTY_INVALID;
+ exp[MISSING]=true;
+ exp[QUOTA] = DEFAULT_QUOTA;
+
+ processExperience(id, exp);
+ LL_WARNS("ExperienceCache") << "LLExperienceResponder::result() error result for " << id << LL_ENDL ;
}
- /*virtual*/ void httpCompleted()
+ LL_DEBUGS("ExperienceCache") << sCache.size() << " cached experiences" << LL_ENDL;
+ }
+
+ /*virtual*/ void httpFailure()
+ {
+ LL_WARNS("ExperienceCache") << "Request failed "<first);
+ //leave the properties alone if we already have a cache entry for this xp
+ if(exp.isUndefined())
+ {
+ exp[PROPERTIES]=PROPERTY_INVALID;
+ }
+ exp[EXPIRES]=retry_timestamp;
+ exp[EXPERIENCE_ID] = it->first;
+ exp["key_type"] = it->second;
+ exp["uuid"] = it->first;
+ exp["error"] = (LLSD::Integer)getStatus();
+ exp[QUOTA] = DEFAULT_QUOTA;
+
+ LLExperienceCache::processExperience(it->first, exp);
+ }
- LL_DEBUGS("ExperienceCache") << "Received result for " << public_key
- << " display '" << row[LLExperienceCache::NAME].asString() << "'" << LL_ENDL ;
+ }
- processExperience(public_key, row);
- }
+ // Return time to retry a request that generated an error, based on
+ // error type and headers. Return value is seconds-since-epoch.
+ F64 errorRetryTimestamp(S32 status)
+ {
- LLSD error_ids = getContent()["error_ids"];
- LLSD::array_const_iterator errIt = error_ids.beginArray();
- for( /**/ ; errIt != error_ids.endArray() ; ++errIt )
+ // Retry-After takes priority
+ LLSD retry_after = getResponseHeaders()["retry-after"];
+ if (retry_after.isDefined())
+ {
+ // We only support the delta-seconds type
+ S32 delta_seconds = retry_after.asInteger();
+ if (delta_seconds > 0)
{
- LLUUID id = errIt->asUUID();
- LLSD exp;
- exp[EXPIRES]=DEFAULT_EXPIRATION;
- exp[EXPERIENCE_ID] = id;
- exp[PROPERTIES]=PROPERTY_INVALID;
- exp[MISSING]=true;
- exp[QUOTA] = DEFAULT_QUOTA;
-
- processExperience(id, exp);
- LL_WARNS("ExperienceCache") << "LLExperienceResponder::result() error result for " << id << LL_ENDL ;
+ // ...valid delta-seconds
+ return F64(delta_seconds);
}
-
- LL_DEBUGS("ExperienceCache") << sCache.size() << " cached experiences" << LL_ENDL;
}
- /*virtual*/ void httpFailure()
+ // If no Retry-After, look for Cache-Control max-age
+ F64 expires = 0.0;
+ if (LLExperienceCache::expirationFromCacheControl(getResponseHeaders(), &expires))
{
- LL_WARNS("ExperienceCache") << "Request failed "<first);
- //leave the properties alone if we already have a cache entry for this xp
- if(exp.isUndefined())
- {
- exp[PROPERTIES]=PROPERTY_INVALID;
- }
- exp[EXPIRES]=retry_timestamp;
- exp[EXPERIENCE_ID] = it->first;
- exp["key_type"] = it->second;
- exp["uuid"] = it->first;
- exp["error"] = (LLSD::Integer)getStatus();
- exp[QUOTA] = DEFAULT_QUOTA;
-
- LLExperienceCache::processExperience(it->first, exp);
- }
-
+ return expires;
}
- // Return time to retry a request that generated an error, based on
- // error type and headers. Return value is seconds-since-epoch.
- F64 errorRetryTimestamp(S32 status)
+ // No information in header, make a guess
+ if (status == 503)
{
+ // ...service unavailable, retry soon
+ const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min
+ return SERVICE_UNAVAILABLE_DELAY;
+ }
+ else if (status == 499)
+ {
+ // ...we were probably too busy, retry quickly
+ const F64 BUSY_DELAY = 10.0; // 10 seconds
+ return BUSY_DELAY;
- // Retry-After takes priority
- LLSD retry_after = getResponseHeaders()["retry-after"];
- if (retry_after.isDefined())
- {
- // We only support the delta-seconds type
- S32 delta_seconds = retry_after.asInteger();
- if (delta_seconds > 0)
- {
- // ...valid delta-seconds
- return F64(delta_seconds);
- }
- }
-
- // If no Retry-After, look for Cache-Control max-age
- F64 expires = 0.0;
- if (LLExperienceCache::expirationFromCacheControl(getResponseHeaders(), &expires))
- {
- return expires;
- }
-
- // No information in header, make a guess
- if (status == 503)
- {
- // ...service unavailable, retry soon
- const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min
- return SERVICE_UNAVAILABLE_DELAY;
- }
- else if (status == 499)
- {
- // ...we were probably too busy, retry quickly
- const F64 BUSY_DELAY = 10.0; // 10 seconds
- return BUSY_DELAY;
-
- }
- else
- {
- // ...other unexpected error
- const F64 DEFAULT_DELAY = 3600.0; // 1 hour
- return DEFAULT_DELAY;
- }
}
+ else
+ {
+ // ...other unexpected error
+ const F64 DEFAULT_DELAY = 3600.0; // 1 hour
+ return DEFAULT_DELAY;
+ }
+ }
- private:
- ask_queue_t mKeys;
- };
+private:
+ ask_queue_t mKeys;
+};
- void requestExperiences()
- {
- if(sAskQueue.empty() || sLookupURL.empty())
- return;
- F64 now = LLFrameTimer::getTotalSeconds();
+void LLExperienceCache::requestExperiences()
+{
+ if(sAskQueue.empty() || sLookupURL.empty())
+ return;
- const U32 EXP_URL_SEND_THRESHOLD = 3000;
- const U32 PAGE_SIZE = EXP_URL_SEND_THRESHOLD/UUID_STR_LENGTH;
+ F64 now = LLFrameTimer::getTotalSeconds();
- std::ostringstream ostr;
+ const U32 EXP_URL_SEND_THRESHOLD = 3000;
+ const U32 PAGE_SIZE = EXP_URL_SEND_THRESHOLD/UUID_STR_LENGTH;
- ask_queue_t keys;
+ std::ostringstream ostr;
- ostr << sLookupURL << "?page_size=" << PAGE_SIZE;
+ ask_queue_t keys;
+ ostr << sLookupURL << "?page_size=" << PAGE_SIZE;
- int request_count = 0;
- while(!sAskQueue.empty() && request_count < sMaximumLookups)
- {
- ask_queue_t::iterator it = sAskQueue.begin();
- const LLUUID& key = it->first;
- const std::string& key_type = it->second;
- ostr << '&' << key_type << '=' << key.asString() ;
+ int request_count = 0;
+ while(!sAskQueue.empty() && request_count < sMaximumLookups)
+ {
+ ask_queue_t::iterator it = sAskQueue.begin();
+ const LLUUID& key = it->first;
+ const std::string& key_type = it->second;
+
+ ostr << '&' << key_type << '=' << key.asString() ;
- keys[key]=key_type;
- request_count++;
+ keys[key]=key_type;
+ request_count++;
- sPendingQueue[key] = now;
+ sPendingQueue[key] = now;
- if(ostr.tellp() > EXP_URL_SEND_THRESHOLD)
- {
- LL_DEBUGS("ExperienceCache") << "requestExperiences() query: " << ostr.str() << LL_ENDL;
- LLHTTPClient::get(ostr.str(), new LLExperienceResponder(keys));
- ostr.clear();
- ostr.str(sLookupURL);
- ostr << "?page_size=" << PAGE_SIZE;
- keys.clear();
- }
- sAskQueue.erase(it);
- }
-
- if(ostr.tellp() > sLookupURL.size())
+ if(ostr.tellp() > EXP_URL_SEND_THRESHOLD)
{
- LL_DEBUGS("ExperienceCache") << "requestExperiences() query 2: " << ostr.str() << LL_ENDL;
+ LL_DEBUGS("ExperienceCache") << "requestExperiences() query: " << ostr.str() << LL_ENDL;
LLHTTPClient::get(ostr.str(), new LLExperienceResponder(keys));
+ ostr.clear();
+ ostr.str(sLookupURL);
+ ostr << "?page_size=" << PAGE_SIZE;
+ keys.clear();
}
+ sAskQueue.erase(it);
}
- bool isRequestPending(const LLUUID& public_key)
+ if(ostr.tellp() > sLookupURL.size())
{
- bool isPending = false;
- const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0;
+ LL_DEBUGS("ExperienceCache") << "requestExperiences() query 2: " << ostr.str() << LL_ENDL;
+ LLHTTPClient::get(ostr.str(), new LLExperienceResponder(keys));
+ }
+}
- pending_queue_t::const_iterator it = sPendingQueue.find(public_key);
- if(it != sPendingQueue.end())
- {
- F64 expire_time = LLFrameTimer::getTotalSeconds() - PENDING_TIMEOUT_SECS;
- isPending = (it->second > expire_time);
- }
+bool LLExperienceCache::isRequestPending(const LLUUID& public_key)
+{
+ bool isPending = false;
+ const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0;
+
+ pending_queue_t::const_iterator it = sPendingQueue.find(public_key);
- return isPending;
+ if(it != sPendingQueue.end())
+ {
+ F64 expire_time = LLFrameTimer::getTotalSeconds() - PENDING_TIMEOUT_SECS;
+ isPending = (it->second > expire_time);
}
+ return isPending;
+}
+
- void setLookupURL( const std::string& lookup_url )
+void LLExperienceCache::setLookupURL(const std::string& lookup_url)
+{
+ sLookupURL = lookup_url;
+ if(!sLookupURL.empty())
{
- sLookupURL = lookup_url;
- if(!sLookupURL.empty())
- {
- sLookupURL += "id/";
- }
+ sLookupURL += "id/";
}
+}
+
+bool LLExperienceCache::hasLookupURL()
+{
+ return !sLookupURL.empty();
+}
- bool hasLookupURL()
+void LLExperienceCache::idle()
+{
+
+ const F32 SECS_BETWEEN_REQUESTS = 0.1f;
+ if (!sRequestTimer.checkExpirationAndReset(SECS_BETWEEN_REQUESTS))
{
- return !sLookupURL.empty();
+ return;
}
- void idle()
+ // Must be large relative to above
+ const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds
+ if (sEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
{
-
- const F32 SECS_BETWEEN_REQUESTS = 0.1f;
- if (!sRequestTimer.checkExpirationAndReset(SECS_BETWEEN_REQUESTS))
- {
- return;
- }
-
- // Must be large relative to above
- const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds
- if (sEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
- {
- eraseExpired();
- }
+ eraseExpired();
+ }
- if(!sAskQueue.empty())
- {
- requestExperiences();
- }
+ if(!sAskQueue.empty())
+ {
+ requestExperiences();
}
+}
- void erase( const LLUUID& key )
- {
- cache_t::iterator it = sCache.find(key);
+void LLExperienceCache::erase(const LLUUID& key)
+{
+ cache_t::iterator it = sCache.find(key);
- if(it != sCache.end())
- {
- sCache.erase(it);
- }
+ if(it != sCache.end())
+ {
+ sCache.erase(it);
}
+}
- void eraseExpired()
+void LLExperienceCache::eraseExpired()
+{
+ F64 now = LLFrameTimer::getTotalSeconds();
+ cache_t::iterator it = sCache.begin();
+ while (it != sCache.end())
{
- F64 now = LLFrameTimer::getTotalSeconds();
- cache_t::iterator it = sCache.begin();
- while (it != sCache.end())
- {
- cache_t::iterator cur = it;
- LLSD& exp = cur->second;
- ++it;
+ cache_t::iterator cur = it;
+ LLSD& exp = cur->second;
+ ++it;
- if(exp.has(EXPIRES) && exp[EXPIRES].asReal() < now)
+ if(exp.has(EXPIRES) && exp[EXPIRES].asReal() < now)
+ {
+ if(!exp.has(EXPERIENCE_ID))
{
- if(!exp.has(EXPERIENCE_ID))
+ LL_WARNS("ExperienceCache") << "Removing experience with no id " << LL_ENDL ;
+ sCache.erase(cur);
+ }
+ else
+ {
+ LLUUID id = exp[EXPERIENCE_ID].asUUID();
+ LLUUID private_key = exp.has(LLExperienceCache::PRIVATE_KEY) ? exp[LLExperienceCache::PRIVATE_KEY].asUUID():LLUUID::null;
+ if(private_key.notNull() || !exp.has("DoesNotExist"))
{
- LL_WARNS("ExperienceCache") << "Removing experience with no id " << LL_ENDL ;
- sCache.erase(cur);
- }
- else
- {
- LLUUID id = exp[EXPERIENCE_ID].asUUID();
- LLUUID private_key = exp.has(LLExperienceCache::PRIVATE_KEY) ? exp[LLExperienceCache::PRIVATE_KEY].asUUID():LLUUID::null;
- if(private_key.notNull() || !exp.has("DoesNotExist"))
- {
- fetch(id, true);
- }
- else
- {
- LL_WARNS("ExperienceCache") << "Removing invalid experience " << id << LL_ENDL ;
- sCache.erase(cur);
- }
+ fetch(id, true);
+ }
+ else
+ {
+ LL_WARNS("ExperienceCache") << "Removing invalid experience " << id << LL_ENDL ;
+ sCache.erase(cur);
}
}
}
}
+}
- bool fetch( const LLUUID& key, bool refresh/* = true*/ )
+bool LLExperienceCache::fetch(const LLUUID& key, bool refresh/* = true*/)
+{
+ if(!key.isNull() && !isRequestPending(key) && (refresh || sCache.find(key)==sCache.end()))
{
- if(!key.isNull() && !isRequestPending(key) && (refresh || sCache.find(key)==sCache.end()))
- {
- LL_DEBUGS("ExperienceCache") << " queue request for " << EXPERIENCE_ID << " " << key << LL_ENDL ;
- sAskQueue[key]=EXPERIENCE_ID;
+ LL_DEBUGS("ExperienceCache") << " queue request for " << EXPERIENCE_ID << " " << key << LL_ENDL ;
+ sAskQueue[key]=EXPERIENCE_ID;
- return true;
- }
- return false;
+ return true;
}
+ return false;
+}
- void insert(const LLSD& experience_data )
+void LLExperienceCache::insert(const LLSD& experience_data)
+{
+ if(experience_data.has(EXPERIENCE_ID))
{
- if(experience_data.has(EXPERIENCE_ID))
- {
- processExperience(experience_data[EXPERIENCE_ID].asUUID(), experience_data);
- }
- else
- {
- LL_WARNS("ExperienceCache") << ": Ignoring cache insert of experience which is missing " << EXPERIENCE_ID << LL_ENDL;
- }
+ processExperience(experience_data[EXPERIENCE_ID].asUUID(), experience_data);
}
- static LLSD empty;
- const LLSD& get(const LLUUID& key)
+ else
{
- if(key.isNull()) return empty;
- cache_t::const_iterator it = sCache.find(key);
-
- if (it != sCache.end())
- {
- return it->second;
- }
-
- fetch(key);
-
- return empty;
+ LL_WARNS("ExperienceCache") << ": Ignoring cache insert of experience which is missing " << EXPERIENCE_ID << LL_ENDL;
}
- void get( const LLUUID& key, callback_slot_t slot )
- {
- if(key.isNull()) return;
-
- cache_t::const_iterator it = sCache.find(key);
- if (it != sCache.end())
- {
- // ...name already exists in cache, fire callback now
- callback_signal_t signal;
- signal.connect(slot);
-
- signal(it->second);
- return;
- }
+}
- fetch(key);
+static LLSD empty;
+const LLSD& LLExperienceCache::get(const LLUUID& key)
+{
+ if(key.isNull()) return empty;
+ cache_t::const_iterator it = sCache.find(key);
- // always store additional callback, even if request is pending
- signal_map_t::iterator sig_it = sSignalMap.find(key);
- if (sig_it == sSignalMap.end())
- {
- // ...new callback for this id
- callback_signal_t* signal = new callback_signal_t();
- signal->connect(slot);
- sSignalMap[key] = signal;
- }
- else
- {
- // ...existing callback, bind additional slot
- callback_signal_t* signal = sig_it->second;
- signal->connect(slot);
- }
+ if (it != sCache.end())
+ {
+ return it->second;
}
-}
-
+ fetch(key);
-void LLExperienceCache::mapKeys( const LLSD& legacyKeys )
+ return empty;
+}
+void LLExperienceCache::get(const LLUUID& key, callback_slot_t slot)
{
- LLSD::array_const_iterator exp = legacyKeys.beginArray();
- for(/**/ ; exp != legacyKeys.endArray() ; ++exp)
+ if(key.isNull()) return;
+
+ cache_t::const_iterator it = sCache.find(key);
+ if (it != sCache.end())
{
- if(exp->has(LLExperienceCache::EXPERIENCE_ID) && exp->has(LLExperienceCache::PRIVATE_KEY))
- {
- privateToPublicKeyMap[(*exp)[LLExperienceCache::PRIVATE_KEY].asUUID()]=(*exp)[LLExperienceCache::EXPERIENCE_ID].asUUID();
- }
+ // ...name already exists in cache, fire callback now
+ callback_signal_t signal;
+ signal.connect(slot);
+
+ signal(it->second);
+ return;
}
-}
+ fetch(key);
-LLUUID LLExperienceCache::getExperienceId(const LLUUID& private_key, bool null_if_not_found)
-{
- if (private_key.isNull())
- return LLUUID::null;
-
- KeyMap::const_iterator it=privateToPublicKeyMap.find(private_key);
- if(it == privateToPublicKeyMap.end())
+ // always store additional callback, even if request is pending
+ signal_map_t::iterator sig_it = sSignalMap.find(key);
+ if (sig_it == sSignalMap.end())
{
- if(null_if_not_found)
- {
- return LLUUID::null;
- }
- return private_key;
+ // ...new callback for this id
+ callback_signal_t* signal = new callback_signal_t();
+ signal->connect(slot);
+ sSignalMap[key] = signal;
+ }
+ else
+ {
+ // ...existing callback, bind additional slot
+ callback_signal_t* signal = sig_it->second;
+ signal->connect(slot);
}
- LL_WARNS("LLExperience") << "converted private key " << private_key << " to experience_id " << it->second << LL_ENDL;
- return it->second;
}
+
+
--
cgit v1.3
From 4b3269c94d8b68c977598d2444ae04f7e1f9062c Mon Sep 17 00:00:00 2001
From: Rider Linden
Date: Mon, 31 Aug 2015 07:27:13 -0700
Subject: Some initial changes to convert the experience cache to a singleton
--HG--
branch : MAINT-5575
---
indra/llmessage/llexperiencecache.cpp | 214 +++++++++++++++++++---------------
indra/llmessage/llexperiencecache.h | 80 +++++++------
2 files changed, 168 insertions(+), 126 deletions(-)
(limited to 'indra/llmessage/llexperiencecache.cpp')
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index d196d7da93..34c4210359 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -32,22 +32,18 @@
#include
#include
",
- "", "", "some error");
- }
-
- template<> template<>
- void translate_test_object_t::test<17>()
- {
- test_translation(mBing, 400,
- "Message: some error",
- "", "", "some error");
- }
-
- template<> template<>
- void translate_test_object_t::test<18>()
- {
- test_translation(mBing, 400,
- "some error",
- "", "", "some error");
- }
-
- template<> template<>
- void translate_test_object_t::test<19>()
- {
- test_translation(mBing, 400,
- "some error",
- "", "", "some error");
- }
-
- template<> template<>
- void translate_test_object_t::test<20>()
- {
- std::string url;
- mBing.getTranslateURL(url, "en", "es", "hi");
- ensure_equals("bing URL", url,
- "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es&from=en");
- }
-
- template<> template<>
- void translate_test_object_t::test<21>()
- {
- std::string url;
- mBing.getTranslateURL(url, "", "es", "hi");
- ensure_equals("bing URL", url,
- "http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=dummy&text=hi&to=es");
- }
-
- template<> template<>
- void translate_test_object_t::test<22>()
- {
- std::string url;
- mGoogle.getTranslateURL(url, "en", "es", "hi");
- ensure_equals("google URL", url,
- "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es&source=en");
- }
-
- template<> template<>
- void translate_test_object_t::test<23>()
- {
- std::string url;
- mGoogle.getTranslateURL(url, "", "es", "hi");
- ensure_equals("google URL", url,
- "https://www.googleapis.com/language/translate/v2?key=dummy&q=hi&target=es");
- }
-}
-
-//== Misc stubs ===============================================================
-LLControlGroup gSavedSettings("test");
-
-std::string LLUI::getLanguage() { return "en"; }
-std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) { return "dummy"; }
-
-LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker(name) {}
-std::string LLControlGroup::getString(const std::string& name) { return "dummy"; }
-LLControlGroup::~LLControlGroup() {}
-
-LLCurl::Responder::Responder() {}
-void LLCurl::Responder::httpFailure() { }
-void LLCurl::Responder::httpSuccess() { }
-void LLCurl::Responder::httpCompleted() { }
-void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr const &) { }
-LLCurl::Responder::~Responder() {}
-
-void LLHTTPClient::get(const std::string&, const LLSD&, ResponderPtr, const LLSD&, const F32, bool) {}
-void LLHTTPClient::get(const std::string&, LLPointer, const LLSD&, const F32, bool) {}
-
-LLBufferStream::LLBufferStream(const LLChannelDescriptors& channels, LLBufferArray* buffer)
-: std::iostream(&mStreamBuf), mStreamBuf(channels, buffer) {}
-LLBufferStream::~LLBufferStream() {}
-
-LLBufferStreamBuf::LLBufferStreamBuf(const LLChannelDescriptors&, LLBufferArray*) {}
-#if( LL_WINDOWS || __GNUC__ > 2)
-LLBufferStreamBuf::pos_type LLBufferStreamBuf::seekoff(
- off_type off,
- std::ios::seekdir way,
- std::ios::openmode which)
-#else
-streampos LLBufferStreamBuf::seekoff(
- streamoff off,
- std::ios::seekdir way,
- std::ios::openmode which)
-#endif
-{ return 0; }
-int LLBufferStreamBuf::sync() {return 0;}
-int LLBufferStreamBuf::underflow() {return 0;}
-int LLBufferStreamBuf::overflow(int) {return 0;}
-LLBufferStreamBuf::~LLBufferStreamBuf() {}
-
-S32 LLVersionInfo::getBuild() { return 0; }
-const std::string& LLVersionInfo::getChannel() {static std::string dummy; return dummy;}
-S32 LLVersionInfo::getMajor() { return 0; }
-S32 LLVersionInfo::getMinor() { return 0; }
-S32 LLVersionInfo::getPatch() { return 0; }
--
cgit v1.3
From 75c6549fde060e974c90636685962ee373f94202 Mon Sep 17 00:00:00 2001
From: Rider Linden
Date: Fri, 18 Sep 2015 11:39:22 -0700
Subject: Set consistent terminology for yield/wait -> suspend for coroutines.
---
indra/llcommon/lleventcoro.cpp | 32 +++---
indra/llcommon/lleventcoro.h | 86 +++++++--------
indra/llcommon/llprocess.cpp | 8 +-
indra/llcommon/tests/lleventcoro_test.cpp | 50 ++++-----
indra/llmessage/llavatarnamecache.cpp | 2 +-
indra/llmessage/llcoproceduremanager.cpp | 8 +-
indra/llmessage/llcorehttputil.cpp | 108 +++++++++----------
indra/llmessage/llcorehttputil.h | 120 ++++++++++-----------
indra/llmessage/llexperiencecache.cpp | 24 ++---
indra/llmessage/message.cpp | 2 +-
indra/newview/llaccountingcostmanager.cpp | 2 +-
indra/newview/llaisapi.cpp | 18 ++--
indra/newview/llavatarrenderinfoaccountant.cpp | 4 +-
indra/newview/llestateinfomodel.cpp | 2 +-
indra/newview/lleventpoll.cpp | 6 +-
indra/newview/llfacebookconnect.cpp | 14 +--
indra/newview/llfeaturemanager.cpp | 2 +-
indra/newview/llflickrconnect.cpp | 12 +--
indra/newview/llfloateravatarpicker.cpp | 2 +-
indra/newview/llfloaterexperiences.cpp | 4 +-
indra/newview/llfloatermodeluploadbase.cpp | 2 +-
indra/newview/llfloaterperms.cpp | 2 +-
indra/newview/llfloaterscriptlimits.cpp | 8 +-
indra/newview/llfloatertos.cpp | 2 +-
indra/newview/llfloaterurlentry.cpp | 2 +-
indra/newview/llgroupmgr.cpp | 6 +-
indra/newview/llimview.cpp | 4 +-
indra/newview/llinventorymodel.cpp | 2 +-
indra/newview/llmarketplacefunctions.cpp | 18 ++--
indra/newview/llpathfindingmanager.cpp | 18 ++--
indra/newview/llproductinforequest.cpp | 2 +-
indra/newview/llremoteparcelrequest.cpp | 2 +-
indra/newview/llspeakers.cpp | 2 +-
indra/newview/llsyntaxid.cpp | 2 +-
indra/newview/lltranslate.cpp | 4 +-
indra/newview/lltwitterconnect.cpp | 12 +--
indra/newview/llviewerassetupload.cpp | 6 +-
indra/newview/llviewermedia.cpp | 8 +-
indra/newview/llviewerobjectlist.cpp | 4 +-
indra/newview/llviewerregion.cpp | 6 +-
indra/newview/llvoavatarself.cpp | 2 +-
indra/newview/llvoicechannel.cpp | 2 +-
indra/newview/llvoicevivox.cpp | 4 +-
indra/newview/llwebprofile.cpp | 6 +-
indra/newview/llwlhandlers.cpp | 4 +-
indra/viewer_components/login/lllogin.cpp | 8 +-
.../viewer_components/updater/llupdatechecker.cpp | 2 +-
47 files changed, 323 insertions(+), 323 deletions(-)
(limited to 'indra/llmessage/llexperiencecache.cpp')
diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp
index 66cc7cada0..031c2cffb0 100755
--- a/indra/llcommon/lleventcoro.cpp
+++ b/indra/llcommon/lleventcoro.cpp
@@ -45,14 +45,14 @@ namespace
{
/**
- * waitForEventOn() permits a coroutine to temporarily listen on an
+ * suspendUntilEventOn() permits a coroutine to temporarily listen on an
* LLEventPump any number of times. We don't really want to have to ask
* the caller to label each such call with a distinct string; the whole
- * point of waitForEventOn() is to present a nice sequential interface to
+ * point of suspendUntilEventOn() is to present a nice sequential interface to
* the underlying LLEventPump-with-named-listeners machinery. So we'll use
* LLEventPump::inventName() to generate a distinct name for each
* temporary listener. On the other hand, because a given coroutine might
- * call waitForEventOn() any number of times, we don't really want to
+ * call suspendUntilEventOn() any number of times, we don't really want to
* consume an arbitrary number of generated inventName()s: that namespace,
* though large, is nonetheless finite. So we memoize an invented name for
* each distinct coroutine instance.
@@ -73,7 +73,7 @@ std::string listenerNameForCoro()
}
/**
- * Implement behavior described for postAndWait()'s @a replyPumpNamePath
+ * Implement behavior described for postEventAndSuspend()'s @a replyPumpNamePath
* parameter:
*
* * If path.isUndefined(), do nothing.
@@ -145,15 +145,15 @@ void storeToLLSDPath(LLSD& dest, const LLSD& rawPath, const LLSD& value)
} // anonymous
-void llcoro::yield()
+void llcoro::suspend()
{
// By viewer convention, we post an event on the "mainloop" LLEventPump
// each iteration of the main event-handling loop. So waiting for a single
- // event on "mainloop" gives us a one-frame yield.
- waitForEventOn("mainloop");
+ // event on "mainloop" gives us a one-frame suspend.
+ suspendUntilEventOn("mainloop");
}
-LLSD llcoro::postAndWait(const LLSD& event, const LLEventPumpOrPumpName& requestPump,
+LLSD llcoro::postEventAndSuspend(const LLSD& event, const LLEventPumpOrPumpName& requestPump,
const LLEventPumpOrPumpName& replyPump, const LLSD& replyPumpNamePath)
{
// declare the future
@@ -171,7 +171,7 @@ LLSD llcoro::postAndWait(const LLSD& event, const LLEventPumpOrPumpName& request
// request event.
LLSD modevent(event);
storeToLLSDPath(modevent, replyPumpNamePath, replyPump.getPump().getName());
- LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << listenerName
+ LL_DEBUGS("lleventcoro") << "postEventAndSuspend(): coroutine " << listenerName
<< " posting to " << requestPump.getPump().getName()
<< LL_ENDL;
@@ -179,7 +179,7 @@ LLSD llcoro::postAndWait(const LLSD& event, const LLEventPumpOrPumpName& request
// << ": " << modevent << LL_ENDL;
requestPump.getPump().post(modevent);
}
- LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << listenerName
+ LL_DEBUGS("lleventcoro") << "postEventAndSuspend(): coroutine " << listenerName
<< " about to wait on LLEventPump " << replyPump.getPump().getName()
<< LL_ENDL;
// trying to dereference ("resolve") the future makes us wait for it
@@ -189,7 +189,7 @@ LLSD llcoro::postAndWait(const LLSD& event, const LLEventPumpOrPumpName& request
llcoro::Suspending suspended;
value = *future;
} // destroy Suspending as soon as we're back
- LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << listenerName
+ LL_DEBUGS("lleventcoro") << "postEventAndSuspend(): coroutine " << listenerName
<< " resuming with " << value << LL_ENDL;
// returning should disconnect the connection
return value;
@@ -199,7 +199,7 @@ namespace
{
/**
- * This helper is specifically for the two-pump version of waitForEventOn().
+ * This helper is specifically for the two-pump version of suspendUntilEventOn().
* We use a single future object, but we want to listen on two pumps with it.
* Since we must still adapt from (the callable constructed by)
* boost::dcoroutines::make_callback() (void return) to provide an event
@@ -242,7 +242,7 @@ WaitForEventOnHelper wfeoh(const LISTENER& listener, int discriminator
namespace llcoro
{
-LLEventWithID postAndWait2(const LLSD& event,
+LLEventWithID postEventAndSuspend2(const LLSD& event,
const LLEventPumpOrPumpName& requestPump,
const LLEventPumpOrPumpName& replyPump0,
const LLEventPumpOrPumpName& replyPump1,
@@ -270,12 +270,12 @@ LLEventWithID postAndWait2(const LLSD& event,
replyPump0.getPump().getName());
storeToLLSDPath(modevent, replyPump1NamePath,
replyPump1.getPump().getName());
- LL_DEBUGS("lleventcoro") << "postAndWait2(): coroutine " << name
+ LL_DEBUGS("lleventcoro") << "postEventAndSuspend2(): coroutine " << name
<< " posting to " << requestPump.getPump().getName()
<< ": " << modevent << LL_ENDL;
requestPump.getPump().post(modevent);
}
- LL_DEBUGS("lleventcoro") << "postAndWait2(): coroutine " << name
+ LL_DEBUGS("lleventcoro") << "postEventAndSuspend2(): coroutine " << name
<< " about to wait on LLEventPumps " << replyPump0.getPump().getName()
<< ", " << replyPump1.getPump().getName() << LL_ENDL;
// trying to dereference ("resolve") the future makes us wait for it
@@ -285,7 +285,7 @@ LLEventWithID postAndWait2(const LLSD& event,
llcoro::Suspending suspended;
value = *future;
} // destroy Suspending as soon as we're back
- LL_DEBUGS("lleventcoro") << "postAndWait(): coroutine " << name
+ LL_DEBUGS("lleventcoro") << "postEventAndSuspend(): coroutine " << name
<< " resuming with (" << value.first << ", " << value.second << ")"
<< LL_ENDL;
// returning should disconnect both connections
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h
index 8f3ee38fb4..a09759c9cf 100755
--- a/indra/llcommon/lleventcoro.h
+++ b/indra/llcommon/lleventcoro.h
@@ -106,33 +106,33 @@ VoidListener voidlistener(const LISTENER& listener)
* runs without suspending for nontrivial time, sprinkle in calls to this
* function to avoid stalling the rest of the viewer processing.
*/
-void yield();
+void suspend();
/**
- * Post specified LLSD event on the specified LLEventPump, then wait for a
+ * Post specified LLSD event on the specified LLEventPump, then suspend for a
* response on specified other LLEventPump. This is more than mere
* convenience: the difference between this function and the sequence
* @code
* requestPump.post(myEvent);
- * LLSD reply = waitForEventOn(replyPump);
+ * LLSD reply = suspendUntilEventOn(replyPump);
* @endcode
* is that the sequence above fails if the reply is posted immediately on
* @a replyPump, that is, before requestPump.post() returns. In the
* sequence above, the running coroutine isn't even listening on @a replyPump
- * until requestPump.post() returns and @c waitForEventOn() is
+ * until requestPump.post() returns and @c suspendUntilEventOn() is
* entered. Therefore, the coroutine completely misses an immediate reply
- * event, making it wait indefinitely.
+ * event, making it suspend indefinitely.
*
- * By contrast, postAndWait() listens on the @a replyPump @em before posting
+ * By contrast, postEventAndSuspend() listens on the @a replyPump @em before posting
* the specified LLSD event on the specified @a requestPump.
*
* @param event LLSD data to be posted on @a requestPump
* @param requestPump an LLEventPump on which to post @a event. Pass either
* the LLEventPump& or its string name. However, if you pass a
* default-constructed @c LLEventPumpOrPumpName, we skip the post() call.
- * @param replyPump an LLEventPump on which postAndWait() will listen for a
+ * @param replyPump an LLEventPump on which postEventAndSuspend() will listen for a
* reply. Pass either the LLEventPump& or its string name. The calling
- * coroutine will wait until that reply arrives. (If you're concerned about a
+ * coroutine will suspend until that reply arrives. (If you're concerned about a
* reply that might not arrive, please see also LLEventTimeout.)
* @param replyPumpNamePath specifies the location within @a event in which to
* store replyPump.getName(). This is a strictly optional convenience
@@ -155,21 +155,21 @@ void yield();
* @a replyPumpNamePath specifies the entry in the lowest-level structure in
* @a event into which to store replyPump.getName().
*/
-LLSD postAndWait(const LLSD& event, const LLEventPumpOrPumpName& requestPump,
+LLSD postEventAndSuspend(const LLSD& event, const LLEventPumpOrPumpName& requestPump,
const LLEventPumpOrPumpName& replyPump, const LLSD& replyPumpNamePath=LLSD());
/// Wait for the next event on the specified LLEventPump. Pass either the
/// LLEventPump& or its string name.
inline
-LLSD waitForEventOn(const LLEventPumpOrPumpName& pump)
+LLSD suspendUntilEventOn(const LLEventPumpOrPumpName& pump)
{
- // This is now a convenience wrapper for postAndWait().
- return postAndWait(LLSD(), LLEventPumpOrPumpName(), pump);
+ // This is now a convenience wrapper for postEventAndSuspend().
+ return postEventAndSuspend(LLSD(), LLEventPumpOrPumpName(), pump);
}
} // namespace llcoro
-/// return type for two-pump variant of waitForEventOn()
+/// return type for two-pump variant of suspendUntilEventOn()
typedef std::pair LLEventWithID;
namespace llcoro
@@ -177,7 +177,7 @@ namespace llcoro
/**
* This function waits for a reply on either of two specified LLEventPumps.
- * Otherwise, it closely resembles postAndWait(); please see the documentation
+ * Otherwise, it closely resembles postAndSuspend(); please see the documentation
* for that function for detailed parameter info.
*
* While we could have implemented the single-pump variant in terms of this
@@ -192,19 +192,19 @@ namespace llcoro
* the index of the pump on which it arrived (0 or 1).
*
* @note
- * I'd have preferred to overload the name postAndWait() for both signatures.
+ * I'd have preferred to overload the name postAndSuspend() for both signatures.
* But consider the following ambiguous call:
* @code
- * postAndWait(LLSD(), requestPump, replyPump, "someString");
+ * postAndSuspend(LLSD(), requestPump, replyPump, "someString");
* @endcode
* "someString" could be converted to either LLSD (@a replyPumpNamePath for
* the single-pump function) or LLEventOrPumpName (@a replyPump1 for two-pump
* function).
*
- * It seems less burdensome to write postAndWait2() than to write either
+ * It seems less burdensome to write postEventAndSuspend2() than to write either
* LLSD("someString") or LLEventOrPumpName("someString").
*/
-LLEventWithID postAndWait2(const LLSD& event,
+LLEventWithID postEventAndSuspend2(const LLSD& event,
const LLEventPumpOrPumpName& requestPump,
const LLEventPumpOrPumpName& replyPump0,
const LLEventPumpOrPumpName& replyPump1,
@@ -216,17 +216,17 @@ LLEventWithID postAndWait2(const LLSD& event,
*/
inline
LLEventWithID
-waitForEventOn(const LLEventPumpOrPumpName& pump0, const LLEventPumpOrPumpName& pump1)
+suspendUntilEventOn(const LLEventPumpOrPumpName& pump0, const LLEventPumpOrPumpName& pump1)
{
- // This is now a convenience wrapper for postAndWait2().
- return postAndWait2(LLSD(), LLEventPumpOrPumpName(), pump0, pump1);
+ // This is now a convenience wrapper for postEventAndSuspend2().
+ return postEventAndSuspend2(LLSD(), LLEventPumpOrPumpName(), pump0, pump1);
}
/**
- * Helper for the two-pump variant of waitForEventOn(), e.g.:
+ * Helper for the two-pump variant of suspendUntilEventOn(), e.g.:
*
* @code
- * LLSD reply = errorException(waitForEventOn(replyPump, errorPump),
+ * LLSD reply = errorException(suspendUntilEventOn(replyPump, errorPump),
* "error response from login.cgi");
* @endcode
*
@@ -286,7 +286,7 @@ LL_COMMON_API LLSD errorLog(const LLEventWithID& result, const std::string& desc
* 2. Provide its actual name to the event API in question as the name of the
* reply LLEventPump.
* 3. Initiate the request to the event API.
- * 4. Call your LLEventTempStream's wait() method to wait for the reply.
+ * 4. Call your LLEventTempStream's suspend() method to suspend for the reply.
* 5. Let the LLCoroEventPump go out of scope.
*/
class LL_COMMON_API LLCoroEventPump
@@ -304,15 +304,15 @@ public:
/**
* Wait for an event on this LLEventPump.
*/
- LLSD wait()
+ LLSD suspend()
{
- return llcoro::waitForEventOn(mPump);
+ return llcoro::suspendUntilEventOn(mPump);
}
- LLSD postAndWait(const LLSD& event, const LLEventPumpOrPumpName& requestPump,
+ LLSD postAndSuspend(const LLSD& event, const LLEventPumpOrPumpName& requestPump,
const LLSD& replyPumpNamePath=LLSD())
{
- return llcoro::postAndWait(event, requestPump, mPump, replyPumpNamePath);
+ return llcoro::postEventAndSuspend(event, requestPump, mPump, replyPumpNamePath);
}
private:
@@ -348,49 +348,49 @@ public:
/// request pump 1
LLEventPump& getPump1() { return mPump1; }
- /// waitForEventOn(either of our two LLEventPumps)
- LLEventWithID wait()
+ /// suspendUntilEventOn(either of our two LLEventPumps)
+ LLEventWithID suspend()
{
- return llcoro::waitForEventOn(mPump0, mPump1);
+ return llcoro::suspendUntilEventOn(mPump0, mPump1);
}
- /// errorException(wait())
- LLSD waitWithException()
+ /// errorException(suspend())
+ LLSD suspendWithException()
{
- return llcoro::errorException(wait(), std::string("Error event on ") + getName1());
+ return llcoro::errorException(suspend(), std::string("Error event on ") + getName1());
}
- /// errorLog(wait())
- LLSD waitWithLog()
+ /// errorLog(suspend())
+ LLSD suspendWithLog()
{
- return llcoro::errorLog(wait(), std::string("Error event on ") + getName1());
+ return llcoro::errorLog(suspend(), std::string("Error event on ") + getName1());
}
- LLEventWithID postAndWait(const LLSD& event,
+ LLEventWithID postAndSuspend(const LLSD& event,
const LLEventPumpOrPumpName& requestPump,
const LLSD& replyPump0NamePath=LLSD(),
const LLSD& replyPump1NamePath=LLSD())
{
- return llcoro::postAndWait2(event, requestPump, mPump0, mPump1,
+ return llcoro::postEventAndSuspend2(event, requestPump, mPump0, mPump1,
replyPump0NamePath, replyPump1NamePath);
}
- LLSD postAndWaitWithException(const LLSD& event,
+ LLSD postAndSuspendWithException(const LLSD& event,
const LLEventPumpOrPumpName& requestPump,
const LLSD& replyPump0NamePath=LLSD(),
const LLSD& replyPump1NamePath=LLSD())
{
- return llcoro::errorException(postAndWait(event, requestPump,
+ return llcoro::errorException(postAndSuspend(event, requestPump,
replyPump0NamePath, replyPump1NamePath),
std::string("Error event on ") + getName1());
}
- LLSD postAndWaitWithLog(const LLSD& event,
+ LLSD postAndSuspendWithLog(const LLSD& event,
const LLEventPumpOrPumpName& requestPump,
const LLSD& replyPump0NamePath=LLSD(),
const LLSD& replyPump1NamePath=LLSD())
{
- return llcoro::errorLog(postAndWait(event, requestPump,
+ return llcoro::errorLog(postAndSuspend(event, requestPump,
replyPump0NamePath, replyPump1NamePath),
std::string("Error event on ") + getName1());
}
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp
index 715df36f39..a8a772b7df 100755
--- a/indra/llcommon/llprocess.cpp
+++ b/indra/llcommon/llprocess.cpp
@@ -710,7 +710,7 @@ LLProcess::LLProcess(const LLSDOrParams& params):
// Tie the lifespan of this child process to the lifespan of our APR
// pool: on destruction of the pool, forcibly kill the process. Tell
- // APR to try SIGTERM and wait 3 seconds. If that didn't work, use
+ // APR to try SIGTERM and suspend 3 seconds. If that didn't work, use
// SIGKILL.
apr_pool_note_subprocess(gAPRPoolp, &mProcess, APR_KILL_AFTER_TIMEOUT);
|*==========================================================================*/
@@ -986,9 +986,9 @@ void LLProcess::handle_status(int reason, int status)
// wi->rv = apr_proc_wait(wi->child, &wi->rc, &wi->why, APR_NOWAIT);
// It's just wrong to call apr_proc_wait() here. The only way APR knows to
// call us with APR_OC_REASON_DEATH is that it's already reaped this child
- // process, so calling wait() will only produce "huh?" from the OS. We
+ // process, so calling suspend() will only produce "huh?" from the OS. We
// must rely on the status param passed in, which unfortunately comes
- // straight from the OS wait() call, which means we have to decode it by
+ // straight from the OS suspend() call, which means we have to decode it by
// hand.
mStatus = interpret_status(status);
LL_INFOS("LLProcess") << getStatusString() << LL_ENDL;
@@ -1231,7 +1231,7 @@ static std::string WindowsErrorString(const std::string& operation)
#include
#include
#include
-#include
+#include
void LLProcess::autokill()
{
diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp
index 00be5035f2..5cced69670 100755
--- a/indra/llcommon/tests/lleventcoro_test.cpp
+++ b/indra/llcommon/tests/lleventcoro_test.cpp
@@ -129,8 +129,8 @@ typedef coroutine match_coroutine_type;
*****************************************************************************/
/// Simulate an event API whose response is immediate: sent on receipt of the
/// initial request, rather than after some delay. This is the case that
-/// distinguishes postAndWait() from calling post(), then calling
-/// waitForEventOn().
+/// distinguishes postEventAndSuspend() from calling post(), then calling
+/// suspendUntilEventOn().
class ImmediateAPI
{
public:
@@ -241,13 +241,13 @@ namespace tut
// declare the future
boost::dcoroutines::future future(self);
- // tell the future what to wait for
+ // tell the future what to suspend for
LLTempBoundListener connection(
LLEventPumps::instance().obtain("source").listen("coro", voidlistener(boost::dcoroutines::make_callback(future))));
ensure("Not yet", ! future);
// attempting to dereference ("resolve") the future causes the calling
- // coroutine to wait for it
- debug("about to wait");
+ // coroutine to suspend for it
+ debug("about to suspend");
result = *future;
ensure("Got it", future);
}
@@ -269,9 +269,9 @@ namespace tut
coro(std::nothrow);
// When the coroutine waits for the event pump, it returns here.
debug("about to send");
- // Satisfy the wait.
+ // Satisfy the suspend.
LLEventPumps::instance().obtain("source").post("received");
- // Now wait for the coroutine to complete.
+ // Now suspend for the coroutine to complete.
ensure("coroutine complete", ! coro);
// ensure the coroutine ran and woke up again with the intended result
ensure_equals(result.asString(), "received");
@@ -281,7 +281,7 @@ namespace tut
{
BEGIN
{
- result = waitForEventOn("source");
+ result = suspendUntilEventOn("source");
}
END
}
@@ -303,7 +303,7 @@ namespace tut
{
BEGIN
{
- LLEventWithID pair = waitForEventOn("reply", "error");
+ LLEventWithID pair = suspendUntilEventOn("reply", "error");
result = pair.first;
which = pair.second;
debug(STRINGIZE("result = " << result << ", which = " << which));
@@ -347,7 +347,7 @@ namespace tut
{
LLCoroEventPump waiter;
replyName = waiter.getName();
- result = waiter.wait();
+ result = waiter.suspend();
}
END
}
@@ -372,7 +372,7 @@ namespace tut
LLCoroEventPumps waiter;
replyName = waiter.getName0();
errorName = waiter.getName1();
- LLEventWithID pair(waiter.wait());
+ LLEventWithID pair(waiter.suspend());
result = pair.first;
which = pair.second;
}
@@ -414,7 +414,7 @@ namespace tut
LLCoroEventPumps waiter;
replyName = waiter.getName0();
errorName = waiter.getName1();
- result = waiter.waitWithException();
+ result = waiter.suspendWithException();
}
END
}
@@ -441,7 +441,7 @@ namespace tut
errorName = waiter.getName1();
try
{
- result = waiter.waitWithException();
+ result = waiter.suspendWithException();
debug("no exception");
}
catch (const LLErrorEvent& e)
@@ -474,7 +474,7 @@ namespace tut
LLCoroEventPumps waiter;
replyName = waiter.getName0();
errorName = waiter.getName1();
- result = waiter.waitWithLog();
+ result = waiter.suspendWithLog();
}
END
}
@@ -502,7 +502,7 @@ namespace tut
WrapLLErrs capture;
try
{
- result = waiter.waitWithLog();
+ result = waiter.suspendWithLog();
debug("no exception");
}
catch (const WrapLLErrs::FatalException& e)
@@ -532,7 +532,7 @@ namespace tut
{
BEGIN
{
- result = postAndWait(LLSDMap("value", 17), // request event
+ result = postEventAndSuspend(LLSDMap("value", 17), // request event
immediateAPI.getPump(), // requestPump
"reply1", // replyPump
"reply"); // request["reply"] = name
@@ -554,7 +554,7 @@ namespace tut
{
BEGIN
{
- LLEventWithID pair = ::postAndWait2(LLSDMap("value", 18),
+ LLEventWithID pair = ::postEventAndSuspend2(LLSDMap("value", 18),
immediateAPI.getPump(),
"reply2",
"error2",
@@ -582,7 +582,7 @@ namespace tut
{
BEGIN
{
- LLEventWithID pair = ::postAndWait2(LLSDMap("value", 18)("fail", LLSD()),
+ LLEventWithID pair = ::postEventAndSuspend2(LLSDMap("value", 18)("fail", LLSD()),
immediateAPI.getPump(),
"reply2",
"error2",
@@ -611,7 +611,7 @@ namespace tut
BEGIN
{
LLCoroEventPump waiter;
- result = waiter.postAndWait(LLSDMap("value", 17),
+ result = waiter.postAndSuspend(LLSDMap("value", 17),
immediateAPI.getPump(), "reply");
}
END
@@ -632,7 +632,7 @@ namespace tut
BEGIN
{
LLCoroEventPumps waiter;
- LLEventWithID pair(waiter.postAndWait(LLSDMap("value", 23),
+ LLEventWithID pair(waiter.postAndSuspend(LLSDMap("value", 23),
immediateAPI.getPump(), "reply", "error"));
result = pair.first;
which = pair.second;
@@ -657,7 +657,7 @@ namespace tut
{
LLCoroEventPumps waiter;
LLEventWithID pair(
- waiter.postAndWait(LLSDMap("value", 23)("fail", LLSD()),
+ waiter.postAndSuspend(LLSDMap("value", 23)("fail", LLSD()),
immediateAPI.getPump(), "reply", "error"));
result = pair.first;
which = pair.second;
@@ -681,7 +681,7 @@ namespace tut
BEGIN
{
LLCoroEventPumps waiter;
- result = waiter.postAndWaitWithException(LLSDMap("value", 8),
+ result = waiter.postAndSuspendWithException(LLSDMap("value", 8),
immediateAPI.getPump(), "reply", "error");
}
END
@@ -704,7 +704,7 @@ namespace tut
LLCoroEventPumps waiter;
try
{
- result = waiter.postAndWaitWithException(
+ result = waiter.postAndSuspendWithException(
LLSDMap("value", 9)("fail", LLSD()),
immediateAPI.getPump(), "reply", "error");
debug("no exception");
@@ -734,7 +734,7 @@ namespace tut
BEGIN
{
LLCoroEventPumps waiter;
- result = waiter.postAndWaitWithLog(LLSDMap("value", 30),
+ result = waiter.postAndSuspendWithLog(LLSDMap("value", 30),
immediateAPI.getPump(), "reply", "error");
}
END
@@ -758,7 +758,7 @@ namespace tut
WrapLLErrs capture;
try
{
- result = waiter.postAndWaitWithLog(
+ result = waiter.postAndSuspendWithLog(
LLSDMap("value", 31)("fail", LLSD()),
immediateAPI.getPump(), "reply", "error");
debug("no exception");
diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp
index d262862c80..61f18ed63e 100755
--- a/indra/llmessage/llavatarnamecache.cpp
+++ b/indra/llmessage/llavatarnamecache.cpp
@@ -195,7 +195,7 @@ void LLAvatarNameCache::requestAvatarNameCache_(std::string url, std::vectorcancelYieldingOperation();
+ (*it).second->cancelSuspendedOperation();
}
}
@@ -345,7 +345,7 @@ bool LLCoprocedurePool::cancelCoprocedure(const LLUUID &id)
if (itActive != mActiveCoprocs.end())
{
LL_INFOS() << "Found and canceling active coprocedure with id=" << id.asString() << " in pool \"" << mPoolName << "\"" << LL_ENDL;
- (*itActive).second->cancelYieldingOperation();
+ (*itActive).second->cancelSuspendedOperation();
mActiveCoprocs.erase(itActive);
return true;
}
@@ -371,7 +371,7 @@ void LLCoprocedurePool::coprocedureInvokerCoro(LLCoreHttpUtil::HttpCoroutineAdap
while (!mShutdown)
{
- llcoro::waitForEventOn(mWakeupTrigger);
+ llcoro::suspendUntilEventOn(mWakeupTrigger);
if (mShutdown)
break;
diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp
index 106df15bf1..d964ff7100 100644
--- a/indra/llmessage/llcorehttputil.cpp
+++ b/indra/llmessage/llcorehttputil.cpp
@@ -567,20 +567,20 @@ HttpCoroutineAdapter::HttpCoroutineAdapter(const std::string &name,
HttpCoroutineAdapter::~HttpCoroutineAdapter()
{
- cancelYieldingOperation();
+ cancelSuspendedOperation();
}
-LLSD HttpCoroutineAdapter::postAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName, true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump));
- return postAndYield_(request, url, body, options, headers, httpHandler);
+ return postAndSuspend_(request, url, body, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -601,35 +601,35 @@ LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::postAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName, true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump));
- return postAndYield_(request, url, rawbody, options, headers, httpHandler);
+ return postAndSuspend_(request, url, rawbody, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::postRawAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postRawAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName, true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroRawHandler(replyPump));
- return postAndYield_(request, url, rawbody, options, headers, httpHandler);
+ return postAndSuspend_(request, url, rawbody, options, headers, httpHandler);
}
// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
-LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, std::string fileName,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -653,12 +653,12 @@ LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
}
}
- return postAndYield(request, url, fileData, options, headers);
+ return postAndSuspend(request, url, fileData, options, headers);
}
// *TODO: This functionality could be moved into the LLCore::Http library itself
// by having the CURL layer read the file directly.
-LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -678,10 +678,10 @@ LLSD HttpCoroutineAdapter::postFileAndYield(LLCore::HttpRequest::ptr_t request,
delete[] fileBuffer;
}
- return postAndYield(request, url, fileData, options, headers);
+ return postAndSuspend(request, url, fileData, options, headers);
}
-LLSD HttpCoroutineAdapter::postJsonAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::postJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -700,11 +700,11 @@ LLSD HttpCoroutineAdapter::postJsonAndYield(LLCore::HttpRequest::ptr_t request,
outs << writer.write(root);
}
- return postAndYield_(request, url, rawbody, options, headers, httpHandler);
+ return postAndSuspend_(request, url, rawbody, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -724,23 +724,23 @@ LLSD HttpCoroutineAdapter::postAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::putAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::putAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump));
- return putAndYield_(request, url, body, options, headers, httpHandler);
+ return putAndSuspend_(request, url, body, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::putJsonAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::putJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -758,10 +758,10 @@ LLSD HttpCoroutineAdapter::putJsonAndYield(LLCore::HttpRequest::ptr_t request,
outs << writer.write(root);
}
- return putAndYield_(request, url, rawbody, options, headers, httpHandler);
+ return putAndSuspend_(request, url, rawbody, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::putAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -782,13 +782,13 @@ LLSD HttpCoroutineAdapter::putAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::putAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLCore::BufferArray::ptr_t & rawbody,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -808,44 +808,44 @@ LLSD HttpCoroutineAdapter::putAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::getAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::getAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump));
- return getAndYield_(request, url, options, headers, httpHandler);
+ return getAndSuspend_(request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::getRawAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::getRawAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroRawHandler(replyPump));
- return getAndYield_(request, url, options, headers, httpHandler);
+ return getAndSuspend_(request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::getJsonAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::getJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump));
- return getAndYield_(request, url, options, headers, httpHandler);
+ return getAndSuspend_(request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::getAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::getAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -864,35 +864,35 @@ LLSD HttpCoroutineAdapter::getAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::deleteAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::deleteAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump));
- return deleteAndYield_(request, url, options, headers, httpHandler);
+ return deleteAndSuspend_(request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::deleteJsonAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump));
- return deleteAndYield_(request, url, options, headers, httpHandler);
+ return deleteAndSuspend_(request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::deleteAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::deleteAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler)
{
@@ -910,24 +910,24 @@ LLSD HttpCoroutineAdapter::deleteAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::patchAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::patchAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
LLEventStream replyPump(mAdapterName + "Reply", true);
HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump));
- return patchAndYield_(request, url, body, options, headers, httpHandler);
+ return patchAndSuspend_(request, url, body, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::patchAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::patchAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -948,13 +948,13 @@ LLSD HttpCoroutineAdapter::patchAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::copyAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::copyAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const std::string dest,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -965,11 +965,11 @@ LLSD HttpCoroutineAdapter::copyAndYield(LLCore::HttpRequest::ptr_t request,
headers.reset(new LLCore::HttpHeaders);
headers->append(HTTP_OUT_HEADER_DESTINATION, dest);
- return copyAndYield_(request, url, options, headers, httpHandler);
+ return copyAndSuspend_(request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::copyAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::copyAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -990,13 +990,13 @@ LLSD HttpCoroutineAdapter::copyAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
}
-LLSD HttpCoroutineAdapter::moveAndYield(LLCore::HttpRequest::ptr_t request,
+LLSD HttpCoroutineAdapter::moveAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const std::string dest,
LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers)
{
@@ -1007,11 +1007,11 @@ LLSD HttpCoroutineAdapter::moveAndYield(LLCore::HttpRequest::ptr_t request,
headers.reset(new LLCore::HttpHeaders);
headers->append(HTTP_OUT_HEADER_DESTINATION, dest);
- return moveAndYield_(request, url, options, headers, httpHandler);
+ return moveAndSuspend_(request, url, options, headers, httpHandler);
}
-LLSD HttpCoroutineAdapter::moveAndYield_(LLCore::HttpRequest::ptr_t &request,
+LLSD HttpCoroutineAdapter::moveAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler)
@@ -1032,7 +1032,7 @@ LLSD HttpCoroutineAdapter::moveAndYield_(LLCore::HttpRequest::ptr_t &request,
}
saveState(hhandle, request, handler);
- LLSD results = llcoro::waitForEventOn(handler->getReplyPump());
+ LLSD results = llcoro::suspendUntilEventOn(handler->getReplyPump());
cleanState();
return results;
@@ -1059,7 +1059,7 @@ void HttpCoroutineAdapter::checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &heade
}
-void HttpCoroutineAdapter::cancelYieldingOperation()
+void HttpCoroutineAdapter::cancelSuspendedOperation()
{
LLCore::HttpRequest::ptr_t request = mWeakRequest.lock();
HttpCoroHandler::ptr_t handler = mWeakHandler.lock();
@@ -1144,7 +1144,7 @@ void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::
LL_INFOS("HttpCoroutineAdapter", "genericGetCoro") << "Generic GET for " << url << LL_ENDL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url, httpOpts);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -1195,7 +1195,7 @@ void HttpCoroutineAdapter::trivialPostCoro(std::string url, LLCore::HttpRequest:
LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData, httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h
index 94800b1a5b..9328427c34 100644
--- a/indra/llmessage/llcorehttputil.h
+++ b/indra/llmessage/llcorehttputil.h
@@ -330,80 +330,80 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD postAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postAndYield(request, url, body,
+ return postAndSuspend(request, url, body,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postAndYield(request, url, rawbody,
+ return postAndSuspend(request, url, rawbody,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postRawAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::BufferArray::ptr_t rawbody,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postRawAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postRawAndYield(request, url, rawbody,
+ return postRawAndSuspend(request, url, rawbody,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, std::string fileName,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, std::string fileName,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postFileAndYield(request, url, fileName,
+ return postFileAndSuspend(request, url, fileName,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postFileAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLUUID assetId, LLAssetType::EType assetType,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postFileAndYield(request, url, assetId, assetType,
+ return postFileAndSuspend(request, url, assetId, assetType,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD postJsonAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD postJsonAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpHeaders::ptr_t &headers)
{
- return postJsonAndYield(request, url, body,
+ return postJsonAndSuspend(request, url, body,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
@@ -414,28 +414,28 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD putAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD putAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpHeaders::ptr_t headers)
{
- return putAndYield(request, url, body,
+ return putAndSuspend(request, url, body,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
- LLSD putJsonAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD putJsonAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpHeaders::ptr_t &headers)
{
- return putJsonAndYield(request, url, body,
+ return putJsonAndSuspend(request, url, body,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
@@ -445,42 +445,42 @@ public:
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
///
- LLSD getAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD getAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD getAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD getAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpHeaders::ptr_t &headers)
{
- return getAndYield(request, url,
+ return getAndSuspend(request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
- LLSD getRawAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD getRawAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpHeaders::ptr_t &headers)
{
- return getRawAndYield(request, url,
+ return getRawAndSuspend(request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
- /// These methods have the same behavior as @getAndYield() however they are
+ /// These methods have the same behavior as @getAndSuspend() however they are
/// expecting the server to return the results formatted in a JSON string.
/// On a successful GET call the JSON results will be converted into LLSD
/// before being returned to the caller.
- LLSD getJsonAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD getJsonAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpHeaders::ptr_t &headers)
{
- return getJsonAndYield(request, url,
+ return getJsonAndSuspend(request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
@@ -491,30 +491,30 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD deleteAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD deleteAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::HttpHeaders::ptr_t headers)
{
- return deleteAndYield(request, url,
+ return deleteAndSuspend(request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
- /// These methods have the same behavior as @deleteAndYield() however they are
+ /// These methods have the same behavior as @deleteAndSuspend() however they are
/// expecting the server to return any results formatted in a JSON string.
/// On a successful DELETE call the JSON results will be converted into LLSD
/// before being returned to the caller.
- LLSD deleteJsonAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD deleteJsonAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, LLCore::HttpHeaders::ptr_t headers)
{
- return deleteJsonAndYield(request, url,
+ return deleteJsonAndSuspend(request, url,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
headers);
}
@@ -525,15 +525,15 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD patchAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD patchAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpHeaders::ptr_t &headers)
{
- return patchAndYield(request, url, body,
+ return patchAndSuspend(request, url, body,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
@@ -545,15 +545,15 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD copyAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const std::string dest,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD copyAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const std::string & dest,
LLCore::HttpHeaders::ptr_t &headers)
{
- return copyAndYield(request, url, dest,
+ return copyAndSuspend(request, url, dest,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
@@ -565,20 +565,20 @@ public:
///
/// @Note: the request's smart pointer is passed by value so that it will
/// not be deallocated during the yield.
- LLSD moveAndYield(LLCore::HttpRequest::ptr_t request,
+ LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t request,
const std::string & url, const std::string dest,
LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()),
LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()));
- LLSD moveAndYield(LLCore::HttpRequest::ptr_t &request,
+ LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const std::string & dest,
LLCore::HttpHeaders::ptr_t &headers)
{
- return moveAndYield(request, url, dest,
+ return moveAndSuspend(request, url, dest,
LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers);
}
///
- void cancelYieldingOperation();
+ void cancelSuspendedOperation();
static LLCore::HttpStatus getStatusFromLLSD(const LLSD &httpResults);
@@ -616,45 +616,45 @@ private:
HttpCoroHandler::ptr_t &handler);
void cleanState();
- LLSD postAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD postAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD postAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::BufferArray::ptr_t &rawbody,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD putAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD putAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD putAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLCore::BufferArray::ptr_t & rawbody,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD getAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD getAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler);
- LLSD deleteAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD deleteAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, LLCore::HttpOptions::ptr_t &options,
LLCore::HttpHeaders::ptr_t &headers, HttpCoroHandler::ptr_t &handler);
- LLSD patchAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD patchAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url, const LLSD & body,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD copyAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD copyAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
- LLSD moveAndYield_(LLCore::HttpRequest::ptr_t &request,
+ LLSD moveAndSuspend_(LLCore::HttpRequest::ptr_t &request,
const std::string & url,
LLCore::HttpOptions::ptr_t &options, LLCore::HttpHeaders::ptr_t &headers,
HttpCoroHandler::ptr_t &handler);
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index ff5f7e793d..3265608582 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -248,7 +248,7 @@ void LLExperienceCache::requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdap
//LL_INFOS("requestExperiencesCoro") << "url: " << url << LL_ENDL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -401,7 +401,7 @@ void LLExperienceCache::idleCoro()
do
{
timeout.eventAfter(SECS_BETWEEN_REQUESTS, LLSD());
- llcoro::waitForEventOn(timeout);
+ llcoro::suspendUntilEventOn(timeout);
if (mEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
{
@@ -564,7 +564,7 @@ void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCorout
data["item-id"] = itemId;
data["fields"] = fields;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, data);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, data);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -612,7 +612,7 @@ void LLExperienceCache::findExperienceByNameCoro(LLCoreHttpUtil::HttpCoroutineAd
url << mCapability("FindExperienceByName") << "?page=" << page << "&page_size=" << SEARCH_PAGE_SIZE << "&query=" << LLURI::escape(text);
- LLSD result = httpAdapter->getAndYield(httpRequest, url.str());
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url.str());
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -661,7 +661,7 @@ void LLExperienceCache::getGroupExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAda
url += "?" + groupId.asString();
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -704,9 +704,9 @@ void LLExperienceCache::regionExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapt
LLSD result;
if (update)
- result = httpAdapter->postAndYield(httpRequest, url, experiences);
+ result = httpAdapter->postAndSuspend(httpRequest, url, experiences);
else
- result = httpAdapter->getAndYield(httpRequest, url);
+ result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -740,7 +740,7 @@ void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, Expe
// _1 -> httpAdapter
// _2 -> httpRequest
// _3 -> url
- (&LLCoreHttpUtil::HttpCoroutineAdapter::getAndYield), _1, _2, _3, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::getAndSuspend), _1, _2, _3, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Preferences Set",
@@ -770,7 +770,7 @@ void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, cons
// _1 -> httpAdapter
// _2 -> httpRequest
// _3 -> url
- (&LLCoreHttpUtil::HttpCoroutineAdapter::putAndYield), _1, _2, _3, data, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::putAndSuspend), _1, _2, _3, data, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Preferences Set",
@@ -795,7 +795,7 @@ void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, E
// _1 -> httpAdapter
// _2 -> httpRequest
// _3 -> url
- (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndYield), _1, _2, _3, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndSuspend), _1, _2, _3, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Preferences Set",
@@ -845,7 +845,7 @@ void LLExperienceCache::getExperienceAdminCoro(LLCoreHttpUtil::HttpCoroutineAdap
}
url += "?experience_id=" + experienceId.asString();
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
// LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
// LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -880,7 +880,7 @@ void LLExperienceCache::updateExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapte
updateData.erase(LLExperienceCache::EXPIRES);
updateData.erase(LLExperienceCache::AGENT_ID);
- LLSD result = httpAdapter->postAndYield(httpRequest, url, updateData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, updateData);
fn(result);
}
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 4f9aa5d2de..2f4b47286d 100755
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -4023,7 +4023,7 @@ void LLMessageSystem::sendUntrustedSimulatorMessageCoro(std::string url, std::st
postData["message"] = message;
postData["body"] = body;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData, httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp
index cd9146ea16..d5027d13fa 100755
--- a/indra/newview/llaccountingcostmanager.cpp
+++ b/indra/newview/llaccountingcostmanager.cpp
@@ -101,7 +101,7 @@ void LLAccountingCostManager::accountingCostCoro(std::string url,
LLCoreHttpUtil::HttpCoroutineAdapter httpAdapter("AccountingCost", mHttpPolicy);
- LLSD results = httpAdapter.postAndYield(mHttpRequest, url, dataToPost);
+ LLSD results = httpAdapter.postAndSuspend(mHttpRequest, url, dataToPost);
LLSD httpResults;
httpResults = results["http_result"];
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 2d877f6a47..5b7380a175 100755
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -99,7 +99,7 @@ void AISAPI::CreateInventory(const LLUUID& parentId, const LLSD& newInventory, c
LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
// I may be suffering from golden hammer here, but the first part of this bind
- // is actually a static cast for &HttpCoroutineAdapter::postAndYield so that
+ // is actually a static cast for &HttpCoroutineAdapter::postAndSuspend so that
// the compiler can identify the correct signature to select.
//
// Reads as follows:
@@ -117,7 +117,7 @@ void AISAPI::CreateInventory(const LLUUID& parentId, const LLSD& newInventory, c
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::postAndYield), _1, _2, _3, _4, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::postAndSuspend), _1, _2, _3, _4, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, postFn, url, parentId, newInventory, callback, COPYINVENTORY));
@@ -150,7 +150,7 @@ void AISAPI::SlamFolder(const LLUUID& folderId, const LLSD& newInventory, comple
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::putAndYield), _1, _2, _3, _4, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::putAndSuspend), _1, _2, _3, _4, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, putFn, url, folderId, newInventory, callback, SLAMFOLDER));
@@ -182,7 +182,7 @@ void AISAPI::RemoveCategory(const LLUUID &categoryId, completion_t callback)
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndYield), _1, _2, _3, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndSuspend), _1, _2, _3, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, delFn, url, categoryId, LLSD(), callback, REMOVECATEGORY));
@@ -215,7 +215,7 @@ void AISAPI::RemoveItem(const LLUUID &itemId, completion_t callback)
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndYield), _1, _2, _3, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndSuspend), _1, _2, _3, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, delFn, url, itemId, LLSD(), callback, REMOVEITEM));
@@ -258,7 +258,7 @@ void AISAPI::CopyLibraryCategory(const LLUUID& sourceId, const LLUUID& destId, b
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::copyAndYield), _1, _2, _3, destination, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::copyAndSuspend), _1, _2, _3, destination, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, copyFn, url, destId, LLSD(), callback, COPYLIBRARYCATEGORY));
@@ -291,7 +291,7 @@ void AISAPI::PurgeDescendents(const LLUUID &categoryId, completion_t callback)
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndYield), _1, _2, _3, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndSuspend), _1, _2, _3, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, delFn, url, categoryId, LLSD(), callback, PURGEDESCENDENTS));
@@ -323,7 +323,7 @@ void AISAPI::UpdateCategory(const LLUUID &categoryId, const LLSD &updates, compl
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::patchAndYield), _1, _2, _3, _4, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::patchAndSuspend), _1, _2, _3, _4, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, patchFn, url, categoryId, updates, callback, UPDATECATEGORY));
@@ -355,7 +355,7 @@ void AISAPI::UpdateItem(const LLUUID &itemId, const LLSD &updates, completion_t
// _4 -> body
// _5 -> httpOptions
// _6 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::patchAndYield), _1, _2, _3, _4, _5, _6);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::patchAndSuspend), _1, _2, _3, _4, _5, _6);
LLCoprocedureManager::CoProcedure_t proc(boost::bind(&AISAPI::InvokeAISCommandCoro,
_1, patchFn, url, itemId, updates, callback, UPDATEITEM));
diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp
index e260142254..470f516db2 100644
--- a/indra/newview/llavatarrenderinfoaccountant.cpp
+++ b/indra/newview/llavatarrenderinfoaccountant.cpp
@@ -67,7 +67,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AvatarRenderInfoAccountant", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp)
@@ -190,7 +190,7 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U
report[KEY_AGENTS] = agents;
regionp = NULL;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, report);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, report);
regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp)
diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp
index 884d1579e6..8f2eb41307 100755
--- a/indra/newview/llestateinfomodel.cpp
+++ b/indra/newview/llestateinfomodel.cpp
@@ -153,7 +153,7 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url)
<< ", sun_hour = " << getSunHour() << LL_ENDL;
LL_DEBUGS() << body << LL_ENDL;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, body);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, body);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp
index 0aad1d5ba9..021d17251d 100755
--- a/indra/newview/lleventpoll.cpp
+++ b/indra/newview/lleventpoll.cpp
@@ -127,7 +127,7 @@ namespace Details
if (adapter)
{
// cancel the yielding operation if any.
- adapter->cancelYieldingOperation();
+ adapter->cancelSuspendedOperation();
}
}
@@ -154,7 +154,7 @@ namespace Details
// << LLSDXMLStreamer(request) << LL_ENDL;
LL_DEBUGS("LLEventPollImpl") << " <" << counter << "> posting and yielding." << LL_ENDL;
- LLSD result = httpAdapter->postAndYield(mHttpRequest, url, request);
+ LLSD result = httpAdapter->postAndSuspend(mHttpRequest, url, request);
// LL_DEBUGS("LLEventPollImpl::eventPollCoro") << "<" << counter << "> result = "
// << LLSDXMLStreamer(result) << LL_ENDL;
@@ -197,7 +197,7 @@ namespace Details
" seconds, error count is now " << errorCount << LL_ENDL;
timeout.eventAfter(waitToRetry, LLSD());
- llcoro::waitForEventOn(timeout);
+ llcoro::suspendUntilEventOn(timeout);
if (mDone)
break;
diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp
index 7975902f73..1de4102dba 100755
--- a/indra/newview/llfacebookconnect.cpp
+++ b/indra/newview/llfacebookconnect.cpp
@@ -165,7 +165,7 @@ void LLFacebookConnect::facebookConnectCoro(std::string authCode, std::string au
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->putAndYield(httpRequest, getFacebookConnectURL("/connection"), putData, httpOpts, get_headers());
+ LLSD result = httpAdapter->putAndSuspend(httpRequest, getFacebookConnectURL("/connection"), putData, httpOpts, get_headers());
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -240,7 +240,7 @@ void LLFacebookConnect::facebookShareCoro(std::string route, LLSD share)
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->postAndYield(httpRequest, getFacebookConnectURL(route, true), share, httpOpts, get_headers());
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, getFacebookConnectURL(route, true), share, httpOpts, get_headers());
if (testShareStatus(result))
{
@@ -307,7 +307,7 @@ void LLFacebookConnect::facebookShareImageCoro(std::string route, LLPointerpostAndYield(httpRequest, getFacebookConnectURL(route, true), raw, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, getFacebookConnectURL(route, true), raw, httpOpts, httpHeaders);
if (testShareStatus(result))
{
@@ -329,7 +329,7 @@ void LLFacebookConnect::facebookDisconnectCoro()
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->deleteAndYield(httpRequest, getFacebookConnectURL("/connection"), httpOpts, get_headers());
+ LLSD result = httpAdapter->deleteAndSuspend(httpRequest, getFacebookConnectURL("/connection"), httpOpts, get_headers());
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -365,7 +365,7 @@ void LLFacebookConnect::facebookConnectedCheckCoro(bool autoConnect)
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->getAndYield(httpRequest, getFacebookConnectURL("/connection", true), httpOpts, get_headers());
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/connection", true), httpOpts, get_headers());
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -413,7 +413,7 @@ void LLFacebookConnect::facebookConnectInfoCoro()
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->getAndYield(httpRequest, getFacebookConnectURL("/info", true), httpOpts, get_headers());
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/info", true), httpOpts, get_headers());
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -456,7 +456,7 @@ void LLFacebookConnect::facebookConnectFriendsCoro()
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->getAndYield(httpRequest, getFacebookConnectURL("/friends", true), httpOpts, get_headers());
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, getFacebookConnectURL("/friends", true), httpOpts, get_headers());
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index d2f8c68558..f08064d9b5 100755
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -526,7 +526,7 @@ void LLFeatureManager::fetchFeatureTableCoro(std::string tableName)
LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL;
- LLSD result = httpAdapter->getRawAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp
index b18149a06c..c0ca5b8cf8 100644
--- a/indra/newview/llflickrconnect.cpp
+++ b/indra/newview/llflickrconnect.cpp
@@ -86,7 +86,7 @@ void LLFlickrConnect::flickrConnectCoro(std::string requestToken, std::string oa
setConnectionState(LLFlickrConnect::FLICKR_CONNECTION_IN_PROGRESS);
- LLSD result = httpAdapter->putAndYield(httpRequest, getFlickrConnectURL("/connection"), body, httpOpts);
+ LLSD result = httpAdapter->putAndSuspend(httpRequest, getFlickrConnectURL("/connection"), body, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -168,7 +168,7 @@ void LLFlickrConnect::flickrShareCoro(LLSD share)
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->postAndYield(httpRequest, getFlickrConnectURL("/share/photo", true), share, httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, getFlickrConnectURL("/share/photo", true), share, httpOpts);
if (testShareStatus(result))
{
@@ -246,7 +246,7 @@ void LLFlickrConnect::flickrShareImageCoro(LLPointer image, st
body << "\r\n--" << boundary << "--\r\n";
- LLSD result = httpAdapter->postAndYield(httpRequest, getFlickrConnectURL("/share/photo", true), raw, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, getFlickrConnectURL("/share/photo", true), raw, httpOpts, httpHeaders);
if (testShareStatus(result))
{
@@ -269,7 +269,7 @@ void LLFlickrConnect::flickrDisconnectCoro()
setConnectionState(LLFlickrConnect::FLICKR_DISCONNECTING);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->deleteAndYield(httpRequest, getFlickrConnectURL("/connection"), httpOpts);
+ LLSD result = httpAdapter->deleteAndSuspend(httpRequest, getFlickrConnectURL("/connection"), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -304,7 +304,7 @@ void LLFlickrConnect::flickrConnectedCoro(bool autoConnect)
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->getAndYield(httpRequest, getFlickrConnectURL("/connection", true), httpOpts);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, getFlickrConnectURL("/connection", true), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -353,7 +353,7 @@ void LLFlickrConnect::flickrInfoCoro()
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->getAndYield(httpRequest, getFlickrConnectURL("/info", true), httpOpts);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, getFlickrConnectURL("/info", true), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 2824038f77..72892b47a4 100755
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -466,7 +466,7 @@ void LLFloaterAvatarPicker::findCoro(std::string url, LLUUID queryID, std::strin
LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp
index bdab9ed868..fbe00beddd 100644
--- a/indra/newview/llfloaterexperiences.cpp
+++ b/indra/newview/llfloaterexperiences.cpp
@@ -293,7 +293,7 @@ void LLFloaterExperiences::retrieveExperienceList(const std::string &url,
// _3 -> url
// _4 -> httpOptions
// _5 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::getAndYield), _1, _2, _3, _4, _5);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::getAndSuspend), _1, _2, _3, _4, _5);
LLCoros::instance().launch("LLFloaterExperiences::retrieveExperienceList",
boost::bind(&LLFloaterExperiences::retrieveExperienceListCoro,
@@ -314,7 +314,7 @@ void LLFloaterExperiences::requestNewExperience(const std::string &url,
// _3 -> url
// _4 -> httpOptions
// _5 -> httpHeaders
- (&LLCoreHttpUtil::HttpCoroutineAdapter::postAndYield), _1, _2, _3, LLSD(), _4, _5);
+ (&LLCoreHttpUtil::HttpCoroutineAdapter::postAndSuspend), _1, _2, _3, LLSD(), _4, _5);
LLCoros::instance().launch("LLFloaterExperiences::requestNewExperience",
boost::bind(&LLFloaterExperiences::retrieveExperienceListCoro,
diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp
index e2f84fd990..0fe97fd610 100755
--- a/indra/newview/llfloatermodeluploadbase.cpp
+++ b/indra/newview/llfloatermodeluploadbase.cpp
@@ -70,7 +70,7 @@ void LLFloaterModelUploadBase::requestAgentUploadPermissionsCoro(std::string url
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp
index 16bb449fdb..31c2a6f9aa 100755
--- a/indra/newview/llfloaterperms.cpp
+++ b/indra/newview/llfloaterperms.cpp
@@ -215,7 +215,7 @@ void LLFloaterPermsDefault::updateCapCoro(std::string url)
LL_CONT << sent_perms_log.str() << LL_ENDL;
}
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
index 14719a77f9..7b8fc5b35b 100755
--- a/indra/newview/llfloaterscriptlimits.cpp
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -220,7 +220,7 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptResourcesCoro(std::string url
postData["parcel_id"] = mParcelId;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -260,7 +260,7 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptSummaryCoro(std::string url)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptSummaryCoro", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -312,7 +312,7 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptDetailsCoro(std::string url)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptDetailsCoro", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -963,7 +963,7 @@ void LLPanelScriptLimitsAttachment::getAttachmentLimitsCoro(std::string url)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getAttachmentLimitsCoro", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index 6dc08417d7..f6cfaf5522 100755
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -214,7 +214,7 @@ void LLFloaterTOS::testSiteIsAliveCoro(std::string url)
LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp
index 6683a6e6e6..f2efef0c33 100755
--- a/indra/newview/llfloaterurlentry.cpp
+++ b/indra/newview/llfloaterurlentry.cpp
@@ -220,7 +220,7 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle pa
LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url, httpOpts);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp
index b218f4f756..4559132aeb 100755
--- a/indra/newview/llgroupmgr.cpp
+++ b/indra/newview/llgroupmgr.cpp
@@ -1870,7 +1870,7 @@ void LLGroupMgr::getGroupBanRequestCoro(std::string url, LLUUID groupId)
std::string finalUrl = url + "?group_id=" + groupId.asString();
- LLSD result = httpAdapter->getAndYield(httpRequest, finalUrl);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, finalUrl);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -1921,7 +1921,7 @@ void LLGroupMgr::postGroupBanRequestCoro(std::string url, LLUUID groupId,
LL_WARNS() << "post: " << ll_pretty_print_sd(postData) << LL_ENDL;
- LLSD result = httpAdapter->postAndYield(httpRequest, finalUrl, postData, httpOptions, httpHeaders);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, finalUrl, postData, httpOptions, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -2041,7 +2041,7 @@ void LLGroupMgr::groupMembersRequestCoro(std::string url, LLUUID groupId)
LLSD postData = LLSD::emptyMap();
postData["group_id"] = groupId;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData, httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 74f1cd0673..53b97a58c5 100755
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -402,7 +402,7 @@ void startConfrenceCoro(std::string url,
postData["session-id"] = tempSessionId;
postData["params"] = agents;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -441,7 +441,7 @@ void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvit
postData["method"] = "accept invitation";
postData["session-id"] = sessionId;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 175ea22aa0..53a58aff4c 100755
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -614,7 +614,7 @@ void LLInventoryModel::createNewCategoryCoro(std::string url, LLSD postData, inv
LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData, httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index b0cd1dd23e..e8e56ef0cd 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -191,7 +191,7 @@ namespace LLMarketplaceImport
httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_XML);
httpHeaders->append(HTTP_OUT_HEADER_USER_AGENT, LLViewerMedia::getCurrentUserAgent());
- LLSD result = httpAdapter->postAndYield(httpRequest, url, LLSD(), httpOpts, httpHeaders);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, LLSD(), httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -260,7 +260,7 @@ namespace LLMarketplaceImport
httpHeaders = LLViewerMedia::getHttpHeaders();
}
- LLSD result = httpAdapter->getAndYield(httpRequest, url, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -755,7 +755,7 @@ void LLMarketplaceData::getMerchantStatusCoro()
LL_INFOS("Marketplace") << "No marketplace capability on Sim" << LL_ENDL;
}
- LLSD result = httpAdapter->getAndYield(httpRequest, url, httpOpts);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -820,7 +820,7 @@ void LLMarketplaceData::getSLMListingsCoro(LLUUID folderId)
std::string url = getSLMConnectURL("/listings");
- LLSD result = httpAdapter->getJsonAndYield(httpRequest, url, httpHeaders);
+ LLSD result = httpAdapter->getJsonAndSuspend(httpRequest, url, httpHeaders);
setUpdating(folderId, false);
@@ -885,7 +885,7 @@ void LLMarketplaceData::getSingleListingCoro(S32 listingId, LLUUID folderId)
std::string url = getSLMConnectURL("/listing/") + llformat("%d", listingId);
- LLSD result = httpAdapter->getJsonAndYield(httpRequest, url, httpHeaders);
+ LLSD result = httpAdapter->getJsonAndSuspend(httpRequest, url, httpHeaders);
setUpdating(folderId, false);
@@ -967,7 +967,7 @@ void LLMarketplaceData::createSLMListingCoro(LLUUID folderId, LLUUID versionId,
std::string url = getSLMConnectURL("/listings");
- LLSD result = httpAdapter->postJsonAndYield(httpRequest, url, postData, httpHeaders);
+ LLSD result = httpAdapter->postJsonAndSuspend(httpRequest, url, postData, httpHeaders);
setUpdating(folderId, false);
@@ -1034,7 +1034,7 @@ void LLMarketplaceData::updateSLMListingCoro(LLUUID folderId, S32 listingId, LLU
postData["listing"] = listing;
std::string url = getSLMConnectURL("/listing/") + llformat("%d", listingId);
- LLSD result = httpAdapter->putJsonAndYield(httpRequest, url, postData, httpHeaders);
+ LLSD result = httpAdapter->putJsonAndSuspend(httpRequest, url, postData, httpHeaders);
setUpdating(folderId, false);
@@ -1116,7 +1116,7 @@ void LLMarketplaceData::associateSLMListingCoro(LLUUID folderId, S32 listingId,
// Send request
std::string url = getSLMConnectURL("/associate_inventory/") + llformat("%d", listingId);
- LLSD result = httpAdapter->putJsonAndYield(httpRequest, url, postData, httpHeaders);
+ LLSD result = httpAdapter->putJsonAndSuspend(httpRequest, url, postData, httpHeaders);
setUpdating(folderId, false);
setUpdating(sourceFolderId, false);
@@ -1190,7 +1190,7 @@ void LLMarketplaceData::deleteSLMListingCoro(S32 listingId)
setUpdating(folderId, true);
- LLSD result = httpAdapter->deleteJsonAndYield(httpRequest, url, httpHeaders);
+ LLSD result = httpAdapter->deleteJsonAndSuspend(httpRequest, url, httpHeaders);
setUpdating(folderId, false);
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
index 2e6937a79f..711a869e82 100755
--- a/indra/newview/llpathfindingmanager.cpp
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -464,7 +464,7 @@ void LLPathfindingManager::navMeshStatusRequestCoro(std::string url, U64 regionH
LLUUID regionUUID = region->getRegionID();
region = NULL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
region = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
@@ -519,7 +519,7 @@ void LLPathfindingManager::navMeshStatusRequestCoro(std::string url, U64 regionH
navMeshPtr->handleNavMeshStart(navMeshStatus);
LLSD postData;
- result = httpAdapter->postAndYield(httpRequest, navMeshURL, postData);
+ result = httpAdapter->postAndSuspend(httpRequest, navMeshURL, postData);
U32 navMeshVersion = navMeshStatus.getVersion();
@@ -545,7 +545,7 @@ void LLPathfindingManager::navAgentStateRequestCoro(std::string url)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("NavAgentStateRequest", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -577,7 +577,7 @@ void LLPathfindingManager::navMeshRebakeCoro(std::string url, rebake_navmesh_cal
LLSD postData = LLSD::emptyMap();
postData["command"] = "rebuild";
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -606,11 +606,11 @@ void LLPathfindingManager::linksetObjectsCoro(std::string url, LinksetsResponder
if (putData.isUndefined())
{
- result = httpAdapter->getAndYield(httpRequest, url);
+ result = httpAdapter->getAndSuspend(httpRequest, url);
}
else
{
- result = httpAdapter->putAndYield(httpRequest, url, putData);
+ result = httpAdapter->putAndSuspend(httpRequest, url, putData);
}
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
@@ -642,11 +642,11 @@ void LLPathfindingManager::linksetTerrainCoro(std::string url, LinksetsResponder
if (putData.isUndefined())
{
- result = httpAdapter->getAndYield(httpRequest, url);
+ result = httpAdapter->getAndSuspend(httpRequest, url);
}
else
{
- result = httpAdapter->putAndYield(httpRequest, url, putData);
+ result = httpAdapter->putAndSuspend(httpRequest, url, putData);
}
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
@@ -673,7 +673,7 @@ void LLPathfindingManager::charactersCoro(std::string url, request_id_t requestI
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("LinksetTerrain", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llproductinforequest.cpp b/indra/newview/llproductinforequest.cpp
index 467e9df482..b663df4aae 100755
--- a/indra/newview/llproductinforequest.cpp
+++ b/indra/newview/llproductinforequest.cpp
@@ -73,7 +73,7 @@ void LLProductInfoRequestManager::getLandDescriptionsCoro(std::string url)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp
index 06bf90c7cb..055ccd5818 100755
--- a/indra/newview/llremoteparcelrequest.cpp
+++ b/indra/newview/llremoteparcelrequest.cpp
@@ -200,7 +200,7 @@ void LLRemoteParcelInfoProcessor::regionParcelInfoCoro(std::string url,
bodyData["region_handle"] = ll_sd_from_U64(regionHandle);
}
- LLSD result = httpAdapter->postAndYield(httpRequest, url, bodyData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, bodyData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 3b060d8343..974029254f 100755
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -881,7 +881,7 @@ void LLIMSpeakerMgr::moderationActionCoro(std::string url, LLSD action)
LLUUID sessionId = action["session-id"];
- LLSD result = httpAdapter->postAndYield(httpRequest, url, action, httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, action, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp
index 7f286044d6..9e54c521b5 100644
--- a/indra/newview/llsyntaxid.cpp
+++ b/indra/newview/llsyntaxid.cpp
@@ -129,7 +129,7 @@ void LLSyntaxIdLSL::fetchKeywordsFileCoro(std::string url, std::string fileSpec)
return;
}
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index 5390573f7b..76fba82ef6 100755
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -146,7 +146,7 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, std::
return;
}
- LLSD result = httpAdapter->getAndYield(httpRequest, url, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url, httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -187,7 +187,7 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s
return;
}
- LLSD result = httpAdapter->getRawAndYield(httpRequest, url, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp
index 86a49cc189..9b7c13b57d 100644
--- a/indra/newview/lltwitterconnect.cpp
+++ b/indra/newview/lltwitterconnect.cpp
@@ -84,7 +84,7 @@ void LLTwitterConnect::twitterConnectCoro(std::string requestToken, std::string
if (!oauthVerifier.empty())
body["oauth_verifier"] = oauthVerifier;
- LLSD result = httpAdapter->putAndYield(httpRequest, getTwitterConnectURL("/connection"), body, httpOpts);
+ LLSD result = httpAdapter->putAndSuspend(httpRequest, getTwitterConnectURL("/connection"), body, httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -166,7 +166,7 @@ void LLTwitterConnect::twitterShareCoro(std::string route, LLSD share)
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->postAndYield(httpRequest, getTwitterConnectURL(route, true), share, httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, getTwitterConnectURL(route, true), share, httpOpts);
if (testShareStatus(result))
{
@@ -231,7 +231,7 @@ void LLTwitterConnect::twitterShareImageCoro(LLPointer image,
body << "\r\n--" << boundary << "--\r\n";
- LLSD result = httpAdapter->postAndYield(httpRequest, getTwitterConnectURL("/share/photo", true), raw, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, getTwitterConnectURL("/share/photo", true), raw, httpOpts, httpHeaders);
if (testShareStatus(result))
{
@@ -253,7 +253,7 @@ void LLTwitterConnect::twitterDisconnectCoro()
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->deleteAndYield(httpRequest, getTwitterConnectURL("/connection"), httpOpts);
+ LLSD result = httpAdapter->deleteAndSuspend(httpRequest, getTwitterConnectURL("/connection"), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -287,7 +287,7 @@ void LLTwitterConnect::twitterConnectedCoro(bool autoConnect)
httpOpts->setFollowRedirects(false);
setConnectionState(LLTwitterConnect::TWITTER_CONNECTION_IN_PROGRESS);
- LLSD result = httpAdapter->getAndYield(httpRequest, getTwitterConnectURL("/connection", true), httpOpts);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, getTwitterConnectURL("/connection", true), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -336,7 +336,7 @@ void LLTwitterConnect::twitterInfoCoro()
httpOpts->setWantHeaders(true);
httpOpts->setFollowRedirects(false);
- LLSD result = httpAdapter->getAndYield(httpRequest, getTwitterConnectURL("/info", true), httpOpts);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, getTwitterConnectURL("/info", true), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index 6c6d3a4f33..e8f9809ee7 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -689,7 +689,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti
return;
}
- llcoro::yield();
+ llcoro::suspend();
if (uploadInfo->showUploadDialog())
{
@@ -700,7 +700,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti
LLSD body = uploadInfo->generatePostBody();
- result = httpAdapter->postAndYield(httpRequest, url, body);
+ result = httpAdapter->postAndSuspend(httpRequest, url, body);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -718,7 +718,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti
bool success = false;
if (!uploader.empty() && uploadInfo->getAssetId().notNull())
{
- result = httpAdapter->postFileAndYield(httpRequest, uploader, uploadInfo->getAssetId(), uploadInfo->getAssetType());
+ result = httpAdapter->postFileAndSuspend(httpRequest, uploader, uploadInfo->getAssetId(), uploadInfo->getAssetType());
httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index f332a4e98e..75a201d92f 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1280,7 +1280,7 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url)
LL_DEBUGS("MediaAuth") << "Requesting " << url << LL_ENDL;
LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << LL_ENDL;
- LLSD result = httpAdapter->getRawAndYield(httpRequest, url, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -1347,7 +1347,7 @@ void LLViewerMedia::openIDSetupCoro(std::string openidUrl, std::string openidTok
bas << std::noskipws << openidToken;
- LLSD result = httpAdapter->postRawAndYield(httpRequest, openidUrl, rawbody, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->postRawAndSuspend(httpRequest, openidUrl, rawbody, httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -2600,7 +2600,7 @@ void LLViewerMediaImpl::mimeDiscoveryCoro(std::string url)
httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*");
httpHeaders->append(HTTP_OUT_HEADER_COOKIE, "");
- LLSD result = httpAdapter->getRawAndYield(httpRequest, url, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders);
mMimeProbe.reset();
@@ -3634,7 +3634,7 @@ void LLViewerMediaImpl::cancelMimeTypeProbe()
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t probeAdapter = mMimeProbe.lock();
if (probeAdapter)
- probeAdapter->cancelYieldingOperation();
+ probeAdapter->cancelSuspendedOperation();
}
void LLViewerMediaImpl::addObject(LLVOVolume* obj)
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 9b0035d547..e193e8431e 100755
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -1052,7 +1052,7 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url)
postData["object_ids"] = idList;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -1181,7 +1181,7 @@ void LLViewerObjectList::fetchPhisicsFlagsCoro(std::string url)
postData["object_ids"] = idList;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 4ed90d26b7..8c4a6935a6 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -273,7 +273,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
<< " (attempt #" << mSeedCapAttempts << ")" << LL_ENDL;
regionp = NULL;
- result = httpAdapter->postAndYield(httpRequest, url, capabilityNames);
+ result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames);
regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
@@ -363,7 +363,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
LL_INFOS("AppInit", "Capabilities") << "Requesting second Seed from " << url << LL_ENDL;
regionp = NULL;
- result = httpAdapter->postAndYield(httpRequest, url, capabilityNames);
+ result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames);
LLSD httpResults = result["http_result"];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -462,7 +462,7 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region
}
regionp = NULL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result["http_result"];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index fb2171ccc2..e7dee14387 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -2203,7 +2203,7 @@ void LLVOAvatarSelf::appearanceChangeMetricsCoro(std::string url)
gPendingMetricsUploads++;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, msg);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, msg);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 192d50ae9b..3abb716593 100755
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -617,7 +617,7 @@ void LLVoiceChannelGroup::voiceCallCapCoro(std::string url)
LL_INFOS("Voice", "voiceCallCapCoro") << "Generic POST for " << url << LL_ENDL;
- LLSD result = httpAdapter->postAndYield(httpRequest, url, postData);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, postData);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index f50ffdeae7..d14fac5fb8 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -462,7 +462,7 @@ void LLVivoxVoiceClient::voiceAccountProvisionCoro(std::string url, S32 retries)
httpOpts->setRetries(retries);
- LLSD result = httpAdapter->postAndYield(httpRequest, url, LLSD(), httpOpts);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, LLSD(), httpOpts);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -3941,7 +3941,7 @@ void LLVivoxVoiceClient::parcelVoiceInfoRequestCoro(std::string url)
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
state requestingState = getState();
- LLSD result = httpAdapter->postAndYield(httpRequest, url, LLSD());
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, LLSD());
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp
index 2033a5f36a..06ce497510 100755
--- a/indra/newview/llwebprofile.cpp
+++ b/indra/newview/llwebprofile.cpp
@@ -124,7 +124,7 @@ void LLWebProfile::uploadImageCoro(LLPointer image, std::strin
httpHeaders = buildDefaultHeaders();
httpHeaders->append(HTTP_OUT_HEADER_COOKIE, getAuthCookie());
- LLSD result = httpAdapter->getJsonAndYield(httpRequest, configUrl, httpOpts, httpHeaders);
+ LLSD result = httpAdapter->getJsonAndSuspend(httpRequest, configUrl, httpOpts, httpHeaders);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -150,7 +150,7 @@ void LLWebProfile::uploadImageCoro(LLPointer image, std::strin
LLCore::BufferArray::ptr_t body = LLWebProfile::buildPostData(data, image, boundary);
- result = httpAdapter->postAndYield(httpRequest, uploadUrl, body, httpOpts, httpHeaders);
+ result = httpAdapter->postAndSuspend(httpRequest, uploadUrl, body, httpOpts, httpHeaders);
body.reset();
httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
@@ -178,7 +178,7 @@ void LLWebProfile::uploadImageCoro(LLPointer image, std::strin
LL_DEBUGS("Snapshots") << "Got redirection URL: " << redirUrl << LL_ENDL;
- result = httpAdapter->getRawAndYield(httpRequest, redirUrl, httpOpts, httpHeaders);
+ result = httpAdapter->getRawAndSuspend(httpRequest, redirUrl, httpOpts, httpHeaders);
httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp
index ff15afa598..8ecfeef2dc 100755
--- a/indra/newview/llwlhandlers.cpp
+++ b/indra/newview/llwlhandlers.cpp
@@ -101,7 +101,7 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EnvironmentRequest", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
if (requestId != LLEnvironmentRequest::sLastRequest)
{
@@ -185,7 +185,7 @@ void LLEnvironmentApply::environmentApplyCoro(std::string url, LLSD content)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EnvironmentApply", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLSD result = httpAdapter->postAndYield(httpRequest, url, content);
+ LLSD result = httpAdapter->postAndSuspend(httpRequest, url, content);
LLSD notify; // for error reporting. If there is something to report to user this will be defined.
/*
diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp
index 88415ff11a..1feb41faf6 100755
--- a/indra/viewer_components/login/lllogin.cpp
+++ b/indra/viewer_components/login/lllogin.cpp
@@ -175,7 +175,7 @@ void LLLogin::Impl::login_(std::string uri, LLSD login_params)
request["op"] = "rewriteURI";
request["uri"] = uri;
request["reply"] = replyPump.getName();
- rewrittenURIs = llcoro::postAndWait(request, srv_pump_name, filter);
+ rewrittenURIs = llcoro::postEventAndSuspend(request, srv_pump_name, filter);
// EXP-772: If rewrittenURIs fail, try original URI as a fallback.
rewrittenURIs.append(uri);
} // we no longer need the filter
@@ -215,16 +215,16 @@ void LLLogin::Impl::login_(std::string uri, LLSD login_params)
sendProgressEvent("offline", "authenticating", progress_data);
// We expect zero or more "Downloading" status events, followed by
- // exactly one event with some other status. Use postAndWait() the
+ // exactly one event with some other status. Use postEventAndSuspend() the
// first time, because -- at least in unit-test land -- it's
// possible for the reply to arrive before the post() call
// returns. Subsequent responses, of course, must be awaited
// without posting again.
for (mAuthResponse = validateResponse(loginReplyPump.getName(),
- llcoro::postAndWait(request, xmlrpcPump, loginReplyPump, "reply"));
+ llcoro::postEventAndSuspend(request, xmlrpcPump, loginReplyPump, "reply"));
mAuthResponse["status"].asString() == "Downloading";
mAuthResponse = validateResponse(loginReplyPump.getName(),
- llcoro::waitForEventOn(loginReplyPump)))
+ llcoro::suspendUntilEventOn(loginReplyPump)))
{
// Still Downloading -- send progress update.
sendProgressEvent("offline", "downloading");
diff --git a/indra/viewer_components/updater/llupdatechecker.cpp b/indra/viewer_components/updater/llupdatechecker.cpp
index e889f83aa9..1bb5e95740 100755
--- a/indra/viewer_components/updater/llupdatechecker.cpp
+++ b/indra/viewer_components/updater/llupdatechecker.cpp
@@ -135,7 +135,7 @@ void LLUpdateChecker::Implementation::checkVersionCoro(std::string url)
LL_INFOS("checkVersionCoro") << "Getting update information from " << url << LL_ENDL;
- LLSD result = httpAdapter->getAndYield(httpRequest, url);
+ LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
--
cgit v1.3
From cf835a80cd2bb5d02cc03034009919e0d9eb73b6 Mon Sep 17 00:00:00 2001
From: Rider Linden
Date: Fri, 18 Sep 2015 16:36:49 -0700
Subject: Pref instance() over getInstance()
---
indra/llmessage/llexperiencecache.cpp | 22 +++++++++++-----------
indra/newview/llaisapi.cpp | 2 +-
indra/newview/llviewerassetupload.cpp | 4 ++--
3 files changed, 14 insertions(+), 14 deletions(-)
(limited to 'indra/llmessage/llexperiencecache.cpp')
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index 3265608582..92fcd38d3b 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -356,7 +356,7 @@ void LLExperienceCache::requestExperiences()
if (mRequestQueue.empty() || (ostr.tellp() > EXP_URL_SEND_THRESHOLD))
{ // request is placed in the coprocedure pool for the ExpCache cache. Throttling is done by the pool itself.
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "RequestExperiences",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "RequestExperiences",
boost::bind(&LLExperienceCache::requestExperiencesCoro, this, _1, ostr.str(), requests) );
ostr.str(std::string());
@@ -542,7 +542,7 @@ void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const
return;
}
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Fetch Associated",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Fetch Associated",
boost::bind(&LLExperienceCache::fetchAssociatedExperienceCoro, this, _1, objectId, itemId, fn));
}
@@ -600,7 +600,7 @@ void LLExperienceCache::findExperienceByName(const std::string text, int page, E
return;
}
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Search Name",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Search Name",
boost::bind(&LLExperienceCache::findExperienceByNameCoro, this, _1, text, page, fn));
}
@@ -643,7 +643,7 @@ void LLExperienceCache::getGroupExperiences(const LLUUID &groupId, ExperienceGet
return;
}
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Group Experiences",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Group Experiences",
boost::bind(&LLExperienceCache::getGroupExperiencesCoro, this, _1, groupId, fn));
}
@@ -679,13 +679,13 @@ void LLExperienceCache::getGroupExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAda
//-------------------------------------------------------------------------
void LLExperienceCache::getRegionExperiences(CapabilityQuery_t regioncaps, ExperienceGetFn_t fn)
{
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Region Experiences",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Region Experiences",
boost::bind(&LLExperienceCache::regionExperiencesCoro, this, _1, regioncaps, false, LLSD(), fn));
}
void LLExperienceCache::setRegionExperiences(CapabilityQuery_t regioncaps, const LLSD &experiences, ExperienceGetFn_t fn)
{
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Region Experiences",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Region Experiences",
boost::bind(&LLExperienceCache::regionExperiencesCoro, this, _1, regioncaps, true, experiences, fn));
}
@@ -743,7 +743,7 @@ void LLExperienceCache::getExperiencePermission(const LLUUID &experienceId, Expe
(&LLCoreHttpUtil::HttpCoroutineAdapter::getAndSuspend), _1, _2, _3, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Preferences Set",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Preferences Set",
boost::bind(&LLExperienceCache::experiencePermissionCoro, this, _1, invoker, url, fn));
}
@@ -773,7 +773,7 @@ void LLExperienceCache::setExperiencePermission(const LLUUID &experienceId, cons
(&LLCoreHttpUtil::HttpCoroutineAdapter::putAndSuspend), _1, _2, _3, data, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Preferences Set",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Preferences Set",
boost::bind(&LLExperienceCache::experiencePermissionCoro, this, _1, invoker, url, fn));
}
@@ -798,7 +798,7 @@ void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, E
(&LLCoreHttpUtil::HttpCoroutineAdapter::deleteAndSuspend), _1, _2, _3, LLCore::HttpOptions::ptr_t(), LLCore::HttpHeaders::ptr_t()));
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "Preferences Set",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "Preferences Set",
boost::bind(&LLExperienceCache::experiencePermissionCoro, this, _1, invoker, url, fn));
}
@@ -829,7 +829,7 @@ void LLExperienceCache::getExperienceAdmin(const LLUUID &experienceId, Experienc
return;
}
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "IsAdmin",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "IsAdmin",
boost::bind(&LLExperienceCache::getExperienceAdminCoro, this, _1, experienceId, fn));
}
@@ -861,7 +861,7 @@ void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn)
return;
}
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("ExpCache", "IsAdmin",
+ LLCoprocedureManager::instance().enqueueCoprocedure("ExpCache", "IsAdmin",
boost::bind(&LLExperienceCache::updateExperienceCoro, this, _1, updateData, fn));
}
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 5b7380a175..afc6e208e6 100755
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -367,7 +367,7 @@ void AISAPI::UpdateItem(const LLUUID &itemId, const LLSD &updates, completion_t
void AISAPI::EnqueueAISCommand(const std::string &procName, LLCoprocedureManager::CoProcedure_t proc)
{
std::string procFullName = "AIS(" + procName + ")";
- LLCoprocedureManager::getInstance()->enqueueCoprocedure("AIS", procFullName, proc);
+ LLCoprocedureManager::instance().enqueueCoprocedure("AIS", procFullName, proc);
}
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index e8f9809ee7..ea3d81c2f6 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -174,7 +174,7 @@ S32 LLResourceUploadInfo::getEconomyUploadCost()
getAssetType() == LLAssetType::AT_ANIMATION ||
getAssetType() == LLAssetType::AT_MESH)
{
- return LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
+ return LLGlobalEconomy::Singleton::instance().getPriceUpload();
}
return 0;
@@ -666,7 +666,7 @@ LLUUID LLViewerAssetUpload::EnqueueInventoryUpload(const std::string &url, const
{
std::string procName("LLViewerAssetUpload::AssetInventoryUploadCoproc(");
- LLUUID queueId = LLCoprocedureManager::getInstance()->enqueueCoprocedure("Upload",
+ LLUUID queueId = LLCoprocedureManager::instance().enqueueCoprocedure("Upload",
procName + LLAssetType::lookup(uploadInfo->getAssetType()) + ")",
boost::bind(&LLViewerAssetUpload::AssetInventoryUploadCoproc, _1, _2, url, uploadInfo));
--
cgit v1.3
From 2763bbd97519d35a43aedf279751e7b1045581dc Mon Sep 17 00:00:00 2001
From: Rider Linden
Date: Fri, 4 Dec 2015 14:27:22 -0800
Subject: Initial changes for Vivox/Azumarill merge. Lots of temporary code
and conditional compile switches. Begin switch from statemachine to
coroutine.
---
indra/llcommon/lleventcoro.cpp | 10 +
indra/llcommon/lleventcoro.h | 5 +
indra/llcommon/llevents.cpp | 11 +
indra/llcommon/llevents.h | 12 +
indra/llmessage/llexperiencecache.cpp | 5 +-
indra/newview/lleventpoll.cpp | 4 +-
indra/newview/llfloaterperms.cpp | 5 +-
indra/newview/llviewerregion.cpp | 2 +-
indra/newview/llvoicevivox.cpp | 740 ++++++++++++++++++++++++++++++++--
indra/newview/llvoicevivox.h | 17 +-
10 files changed, 762 insertions(+), 49 deletions(-)
(limited to 'indra/llmessage/llexperiencecache.cpp')
diff --git a/indra/llcommon/lleventcoro.cpp b/indra/llcommon/lleventcoro.cpp
index c9bfcacedc..1c3fb4325d 100755
--- a/indra/llcommon/lleventcoro.cpp
+++ b/indra/llcommon/lleventcoro.cpp
@@ -41,6 +41,8 @@
#include "llerror.h"
#include "llcoros.h"
+#include "lleventfilter.h"
+
namespace
{
@@ -153,6 +155,14 @@ void llcoro::suspend()
suspendUntilEventOn("mainloop");
}
+void llcoro::suspendUntilTimeout(float seconds)
+{
+ LLEventTimeout timeout;
+
+ timeout.eventAfter(seconds, LLSD());
+ llcoro::suspendUntilEventOn(timeout);
+}
+
LLSD llcoro::postAndSuspend(const LLSD& event, const LLEventPumpOrPumpName& requestPump,
const LLEventPumpOrPumpName& replyPump, const LLSD& replyPumpNamePath)
{
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h
index 6fda3d2572..bcc8cdda1d 100755
--- a/indra/llcommon/lleventcoro.h
+++ b/indra/llcommon/lleventcoro.h
@@ -108,6 +108,11 @@ VoidListener voidlistener(const LISTENER& listener)
*/
void suspend();
+/**
+ * Yield control from a coroutine for at least the specified number of seconds
+ */
+void suspendUntilTimeout(float seconds);
+
/**
* Post specified LLSD event on the specified LLEventPump, then suspend for a
* response on specified other LLEventPump. This is more than mere
diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp
index 1c928b3db8..bb3a137815 100755
--- a/indra/llcommon/llevents.cpp
+++ b/indra/llcommon/llevents.cpp
@@ -132,6 +132,17 @@ LLEventPump& LLEventPumps::obtain(const std::string& name)
return *newInstance;
}
+bool LLEventPumps::post(const std::string&name, const LLSD&message)
+{
+ PumpMap::iterator found = mPumpMap.find(name);
+
+ if (found == mPumpMap.end())
+ return false;
+
+ return (*found).second->post(message);
+}
+
+
void LLEventPumps::flush()
{
// Flush every known LLEventPump instance. Leave it up to each instance to
diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h
index 0cbd1da32d..8d4fa68350 100755
--- a/indra/llcommon/llevents.h
+++ b/indra/llcommon/llevents.h
@@ -217,6 +217,18 @@ public:
* an instance without conferring @em ownership.
*/
LLEventPump& obtain(const std::string& name);
+
+ /**
+ * Find the named LLEventPump instance. If it exists post the message to it.
+ * If the pump does not exist, do nothing.
+ *
+ * returns the result of the LLEventPump::post. If no pump exists returns false.
+ *
+ * This is syntactically similar to LLEventPumps::instance().post(name, message),
+ * however if the pump does not already exist it will not be created.
+ */
+ bool post(const std::string&, const LLSD&);
+
/**
* Flush all known LLEventPump instances
*/
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index 92fcd38d3b..779d1d9d99 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -396,12 +396,9 @@ void LLExperienceCache::idleCoro()
const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds
LL_INFOS("ExperienceCache") << "Launching Experience cache idle coro." << LL_ENDL;
- LLEventTimeout timeout;
-
do
{
- timeout.eventAfter(SECS_BETWEEN_REQUESTS, LLSD());
- llcoro::suspendUntilEventOn(timeout);
+ llcoro::suspendUntilTimeout(SECS_BETWEEN_REQUESTS);
if (mEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT))
{
diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp
index 72e159bcec..7178042b32 100755
--- a/indra/newview/lleventpoll.cpp
+++ b/indra/newview/lleventpoll.cpp
@@ -197,7 +197,6 @@ namespace Details
// request. Calculate a timeout and wait for it to expire(sleep)
// before trying again. The sleep time is increased by 5 seconds
// for each consecutive error.
- LLEventTimeout timeout;
++errorCount;
F32 waitToRetry = EVENT_POLL_ERROR_RETRY_SECONDS
@@ -206,8 +205,7 @@ namespace Details
LL_WARNS("LLEventPollImpl") << "<" << counter << "> Retrying in " << waitToRetry <<
" seconds, error count is now " << errorCount << LL_ENDL;
- timeout.eventAfter(waitToRetry, LLSD());
- llcoro::suspendUntilEventOn(timeout);
+ llcoro::suspendUntilTimeout(waitToRetry);
if (mDone)
break;
diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp
index cb67787af3..b0b2770c6e 100755
--- a/indra/newview/llfloaterperms.cpp
+++ b/indra/newview/llfloaterperms.cpp
@@ -232,8 +232,6 @@ void LLFloaterPermsDefault::updateCapCoro(std::string url)
if (!status)
{
- LLEventTimeout timeout;
-
const std::string& reason = status.toString();
// Do not display the same error more than once in a row
if (reason != previousReason)
@@ -244,8 +242,7 @@ void LLFloaterPermsDefault::updateCapCoro(std::string url)
LLNotificationsUtil::add("DefaultObjectPermissions", args);
}
- timeout.eventAfter(RETRY_TIMEOUT, LLSD());
- llcoro::suspendUntilEventOn(timeout);
+ llcoro::suspendUntilTimeout(RETRY_TIMEOUT);
if (retryCount < MAX_HTTP_RETRIES)
continue;
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index b0280ef3e0..a4109d5885 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -310,7 +310,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
<< "Capability '" << iter->first << "' is '" << iter->second << "'" << LL_ENDL;
}
-#if 0
+#if 1
log_capabilities(mCapabilities);
#endif
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index c6c7d588eb..66d23f7919 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -66,6 +66,7 @@
#include "llnotificationsutil.h"
#include "llcorehttputil.h"
+#include "lleventfilter.h"
#include "stringize.h"
@@ -377,7 +378,9 @@ void LLVivoxVoiceClient::connectorCreate()
std::string loglevel = "0";
// Transition to stateConnectorStarted when the connector handle comes back.
+#if 0
setState(stateConnectorStarting);
+#endif
std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel");
@@ -435,6 +438,7 @@ void LLVivoxVoiceClient::userAuthorized(const std::string& user_id, const LLUUID
mAccountName = nameFromID(agentID);
}
+#if 0
void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries)
{
LLViewerRegion *region = gAgent.getRegion();
@@ -453,7 +457,7 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries)
{
LLCoros::instance().launch("LLVivoxVoiceClient::voiceAccountProvisionCoro",
boost::bind(&LLVivoxVoiceClient::voiceAccountProvisionCoro, this, url, retries));
- setState(stateConnectorStart);
+// setState(stateConnectorStart);
}
}
}
@@ -465,20 +469,39 @@ void LLVivoxVoiceClient::voiceAccountProvisionCoro(std::string url, S32 retries)
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("voiceAccountProvision", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
+ int retryCount(0);
- httpOpts->setRetries(retries);
- LLSD result = httpAdapter->postAndSuspend(httpRequest, url, LLSD(), httpOpts);
+ LLSD result;
+
+ do
+ {
+ result = httpAdapter->postAndSuspend(httpRequest, url, LLSD(), httpOpts);
- LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
- LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
+ LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
+ LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
- if (!status)
- {
- LL_WARNS("Voice") << "Unable to provision voice account." << LL_ENDL;
- giveUp();
- return;
- }
+ if (status == LLCore::HttpStatus(404))
+ {
+ if (++retryCount > retries)
+ {
+ LL_WARNS("Voice") << "Could not access voice provision cap after " << retries << " attempts." << LL_ENDL;
+ giveUp();
+ return;
+ }
+ LL_WARNS("Voice") << "Provision CAP 404. Retrying in 1.0" << LL_ENDL;
+ llcoro::suspendUntilTimeout(1.0);
+
+ continue;
+ }
+ else if (!status)
+ {
+ LL_WARNS("Voice") << "Unable to provision voice account." << LL_ENDL;
+ giveUp();
+ return;
+ }
+ break;
+ } while (true);
std::string voice_sip_uri_hostname;
std::string voice_account_server_uri;
@@ -492,11 +515,12 @@ void LLVivoxVoiceClient::voiceAccountProvisionCoro(std::string url, S32 retries)
if (result.has("voice_account_server_name"))
voice_account_server_uri = result["voice_account_server_name"].asString();
- login(result["username"].asString(), result["password"].asString(),
+ setLoginInfo(result["username"].asString(), result["password"].asString(),
voice_sip_uri_hostname, voice_account_server_uri);
}
+#endif
-void LLVivoxVoiceClient::login(
+void LLVivoxVoiceClient::setLoginInfo(
const std::string& account_name,
const std::string& password,
const std::string& voice_sip_uri_hostname,
@@ -701,10 +725,24 @@ void LLVivoxVoiceClient::stateMachine()
case stateDisabled:
if(mTuningMode || ((mVoiceEnabled || !mIsInitialized) && !mAccountName.empty()))
{
+#if 1
+ LLCoros::instance().launch("LLVivoxVoiceClient::startAndConnectSession",
+ boost::bind(&LLVivoxVoiceClient::startAndConnectSession, this));
+#else
setState(stateStart);
+#endif
}
break;
-
+
+//--------------------------------------------------------------------------
+#if 1
+ case stateStart:
+ case stateDaemonLaunched:
+ case stateConnecting:
+ case stateConnected:
+ // moved to coroutine LLVivoxVoiceClient::startAndLaunchDaemon
+ break;
+#else
//MARK: stateStart
case stateStart:
if(gSavedSettings.getBOOL("CmdLineDisableVoice"))
@@ -861,30 +899,47 @@ void LLVivoxVoiceClient::stateMachine()
setState(stateIdle);
break;
+#endif
+//--------------------------------------------------------------------------
//MARK: stateIdle
case stateIdle:
// This is the idle state where we're connected to the daemon but haven't set up a connector yet.
if(mTuningMode)
{
- mTuningExitState = stateIdle;
- setState(stateMicTuningStart);
- }
+#if 1
+ LLCoros::instance().launch("LLVivoxVoiceClient::performMicTuning",
+ boost::bind(&LLVivoxVoiceClient::performMicTuning, this, stateIdle));
+#else
+ mTuningExitState = stateIdle;
+ setState(stateMicTuningStart);
+#endif
+ }
else if(!mVoiceEnabled && mIsInitialized)
{
// We never started up the connector. This will shut down the daemon.
setState(stateConnectorStopped);
}
+#if 0
else if(!mAccountName.empty())
{
if ( mAccountPassword.empty() )
{
- requestVoiceAccountProvision();
+ requestVoiceAccountProvision(5);
}
}
+#endif
break;
- //MARK: stateMicTuningStart
+//--------------------------------------------------------------------------
+#if 1
+ case stateMicTuningStart:
+ case stateMicTuningRunning:
+ case stateMicTuningStop:
+ // moved to coroutine LLVivoxVoiceClient::performMicTuning
+ break;
+#else
+ //MARK: stateMicTuningStart
case stateMicTuningStart:
if(mUpdateTimer.hasExpired())
{
@@ -985,6 +1040,8 @@ void LLVivoxVoiceClient::stateMachine()
}
break;
+#endif
+//--------------------------------------------------------------------------
//MARK: stateCaptureBufferPaused
case stateCaptureBufferPaused:
@@ -1075,7 +1132,16 @@ void LLVivoxVoiceClient::stateMachine()
}
break;
- //MARK: stateConnectorStart
+//-------------------------------------------------------------------------
+#if 1
+ case stateConnectorStart:
+ case stateConnectorStarting:
+ case stateConnectorStarted:
+ // moved to establishVoiceConnection
+ break;
+
+#else
+ //MARK: stateConnectorStart
case stateConnectorStart:
if(!mVoiceEnabled && mIsInitialized)
{
@@ -1106,7 +1172,18 @@ void LLVivoxVoiceClient::stateMachine()
setState(stateNeedsLogin);
}
break;
-
+#endif
+//-------------------------------------------------------------------------
+
+#if 1
+ case stateLoginRetry:
+ case stateLoginRetryWait:
+ case stateNeedsLogin:
+ case stateLoggingIn:
+ case stateLoggedIn:
+ // moved to loginToVivox
+ break;
+#else
//MARK: stateLoginRetry
case stateLoginRetry:
if(mLoginRetryCount == 0)
@@ -1194,7 +1271,14 @@ void LLVivoxVoiceClient::stateMachine()
sendLocalAudioUpdates();
break;
+#endif
+#if 1
+ case stateVoiceFontsWait: // Await voice font list
+ case stateVoiceFontsReceived: // Voice font list received
+ // moved to retrieveVoiceFonts
+ break;
+#else
//MARK: stateVoiceFontsWait
case stateVoiceFontsWait: // Await voice font list
// accountGetSessionFontsResponse() will transition from here to
@@ -1207,15 +1291,17 @@ void LLVivoxVoiceClient::stateMachine()
// Set up the timer to check for expiring voice fonts
mVoiceFontExpiryTimer.start();
mVoiceFontExpiryTimer.setTimerExpirySec(VOICE_FONT_EXPIRY_INTERVAL);
-
#if USE_SESSION_GROUPS
- // create the main session group
- setState(stateCreatingSessionGroup);
- sessionGroupCreateSendMessage();
+ // create the main session group
+ setState(stateCreatingSessionGroup);
+ sessionGroupCreateSendMessage();
#else
- setState(stateNoChannel);
+ setState(stateNoChannel);
#endif
- break;
+ break;
+
+#endif
+
//MARK: stateCreatingSessionGroup
case stateCreatingSessionGroup:
@@ -1260,8 +1346,13 @@ void LLVivoxVoiceClient::stateMachine()
}
else if(mTuningMode)
{
- mTuningExitState = stateNoChannel;
- setState(stateMicTuningStart);
+#if 1
+ LLCoros::instance().launch("LLVivoxVoiceClient::performMicTuning",
+ boost::bind(&LLVivoxVoiceClient::performMicTuning, this, stateNoChannel));
+#else
+ mTuningExitState = stateNoChannel;
+ setState(stateMicTuningStart);
+#endif
}
else if(mCaptureBufferMode)
{
@@ -1528,7 +1619,8 @@ void LLVivoxVoiceClient::stateMachine()
}
break;
- //MARK: stateConnectorStopping
+//-------------------------------------------------------------------------
+ //MARK: stateConnectorStopping
case stateConnectorStopping: // waiting for connector stop
// The handler for the Connector.InitiateShutdown response will transition from here to stateConnectorStopped.
mShutdownComplete = true;
@@ -1539,7 +1631,8 @@ void LLVivoxVoiceClient::stateMachine()
setState(stateDisableCleanup);
break;
- //MARK: stateConnectorFailed
+//-------------------------------------------------------------------------
+ //MARK: stateConnectorFailed
case stateConnectorFailed:
setState(stateConnectorFailedWaiting);
break;
@@ -1550,6 +1643,7 @@ void LLVivoxVoiceClient::stateMachine()
setState(stateDisableCleanup);
}
break;
+//-------------------------------------------------------------------------
//MARK: stateLoginFailed
case stateLoginFailed:
@@ -1609,6 +1703,537 @@ void LLVivoxVoiceClient::stateMachine()
}
}
+//=========================================================================
+// the following are methods to support the coroutine implementation of the
+// voice connection and processing. They should only be called in the context
+// of a coroutine.
+//
+// calls to setState() in these are historical and used because some of the other
+// query routines will ask what state the state machine is in.
+//
+
+bool LLVivoxVoiceClient::startAndConnectSession()
+{
+ if (!startAndLaunchDaemon())
+ {
+ setState(stateJail);
+ return false;
+ }
+
+ if (!provisionVoiceAccount())
+ {
+ giveUp();
+ return false;
+ }
+
+ if (!establishVoiceConnection())
+ {
+ if (getState() != stateConnectorFailed)
+ {
+ setState(stateLoggedOut);
+ }
+ giveUp();
+ return false;
+ }
+
+
+ if (!loginToVivox())
+ {
+ setState(stateLoginFailed);
+ return false;
+ }
+
+ if (LLVoiceClient::instance().getVoiceEffectEnabled())
+ {
+ retrieveVoiceFonts();
+
+ // Request the set of available voice fonts.
+ refreshVoiceEffectLists(true);
+ }
+ else
+ {
+ // If voice effects are disabled, pretend we've received them and carry on.
+ setState(stateNoChannel);
+ }
+
+#if USE_SESSION_GROUPS
+ // create the main session group
+ setState(stateCreatingSessionGroup);
+ sessionGroupCreateSendMessage();
+#else
+ setState(stateNoChannel);
+#endif
+
+ return true;
+}
+
+bool LLVivoxVoiceClient::startAndLaunchDaemon()
+{
+ //---------------------------------------------------------------------
+ setState(stateStart);
+
+ if (gSavedSettings.getBOOL("CmdLineDisableVoice"))
+ {
+ // Voice is locked out, we must not launch the vivox daemon.
+ setState(stateJail);
+ return false;
+ }
+
+ if (!isGatewayRunning() && gSavedSettings.getBOOL("EnableVoiceChat"))
+ {
+#ifndef VIVOXDAEMON_REMOTEHOST
+ // Launch the voice daemon
+
+ // *FIX:Mani - Using the executable dir instead
+ // of mAppRODataDir, the working directory from which the app
+ // is launched.
+ //std::string exe_path = gDirUtilp->getAppRODataDir();
+ std::string exe_path = gDirUtilp->getExecutableDir();
+ exe_path += gDirUtilp->getDirDelimiter();
+#if LL_WINDOWS
+ exe_path += "SLVoice.exe";
+#elif LL_DARWIN
+ exe_path += "../Resources/SLVoice";
+#else
+ exe_path += "SLVoice";
+#endif
+ // See if the vivox executable exists
+ llstat s;
+ if (!LLFile::stat(exe_path, &s))
+ {
+ // vivox executable exists. Build the command line and launch the daemon.
+ LLProcess::Params params;
+ params.executable = exe_path;
+
+ std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
+ std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout");
+ if (loglevel.empty())
+ {
+ loglevel = "-1"; // turn logging off completely, was 0 for error level logging.
+ }
+
+ params.args.add("-ll");
+ params.args.add(loglevel);
+
+ std::string log_folder = gSavedSettings.getString("VivoxLogDirectory");
+
+ if (log_folder.empty())
+ {
+ log_folder = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "");
+ }
+
+ params.args.add("-lf");
+ params.args.add(log_folder);
+
+ if (!shutdown_timeout.empty())
+ {
+ params.args.add("-st");
+ params.args.add(shutdown_timeout);
+ }
+ params.cwd = gDirUtilp->getAppRODataDir();
+ sGatewayPtr = LLProcess::create(params);
+
+ mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost").c_str(), gSavedSettings.getU32("VivoxVoicePort"));
+ }
+ else
+ {
+ LL_INFOS("Voice") << exe_path << " not found." << LL_ENDL;
+ return false;
+ }
+#else
+ // SLIM SDK: port changed from 44124 to 44125.
+ // We can connect to a client gateway running on another host. This is useful for testing.
+ // To do this, launch the gateway on a nearby host like this:
+ // vivox-gw.exe -p tcp -i 0.0.0.0:44125
+ // and put that host's IP address here.
+ mDaemonHost = LLHost(gSavedSettings.getString("VivoxVoiceHost"), gSavedSettings.getU32("VivoxVoicePort"));
+#endif
+
+ mUpdateTimer.start();
+ mUpdateTimer.setTimerExpirySec(CONNECT_THROTTLE_SECONDS);
+
+ // Dirty the states we'll need to sync with the daemon when it comes up.
+ mMuteMicDirty = true;
+ mMicVolumeDirty = true;
+ mSpeakerVolumeDirty = true;
+ mSpeakerMuteDirty = true;
+ // These only need to be set if they're not default (i.e. empty string).
+ mCaptureDeviceDirty = !mCaptureDevice.empty();
+ mRenderDeviceDirty = !mRenderDevice.empty();
+
+ mMainSessionGroupHandle.clear();
+ }
+
+ //---------------------------------------------------------------------
+ llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
+ setState(stateDaemonLaunched);
+
+ LL_DEBUGS("Voice") << "Connecting to vivox daemon:" << mDaemonHost << LL_ENDL;
+
+ int connectAttempt = 0;
+
+ while (!mConnected)
+ {
+ ++connectAttempt;
+ LL_DEBUGS("Voice") << "Connecting to vivox daemon:" << mDaemonHost << " (#" << connectAttempt << ")" << LL_ENDL;
+ closeSocket();
+ if (!mSocket)
+ {
+ mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP);
+ }
+
+ mConnected = mSocket->blockingConnect(mDaemonHost);
+ }
+
+ //---------------------------------------------------------------------
+ llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
+ setState(stateConnecting);
+
+
+ while (!mPump)
+ { // Can't do this until we have the pump available.
+ llcoro::suspend();
+ }
+
+
+ // MBW -- Note to self: pumps and pipes examples in
+ // indra/test/io.cpp
+ // indra/test/llpipeutil.{cpp|h}
+
+ // Attach the pumps and pipes
+
+ LLPumpIO::chain_t readChain;
+
+ readChain.push_back(LLIOPipe::ptr_t(new LLIOSocketReader(mSocket)));
+ readChain.push_back(LLIOPipe::ptr_t(new LLVivoxProtocolParser()));
+
+ mPump->addChain(readChain, NEVER_CHAIN_EXPIRY_SECS);
+
+ //---------------------------------------------------------------------
+ llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
+ setState(stateConnected);
+
+ // Initial devices query
+ getCaptureDevicesSendMessage();
+ getRenderDevicesSendMessage();
+
+ mLoginRetryCount = 0;
+
+ setState(stateIdle);
+
+ return true;
+}
+
+bool LLVivoxVoiceClient::provisionVoiceAccount()
+{
+
+ while (!gAgent.getRegion())
+ {
+ // *TODO* Set up a call back on agent that sends a message to a pump we can use to wake up.
+ llcoro::suspend();
+ }
+
+ LLViewerRegion *region = gAgent.getRegion();
+
+ while (!region->capabilitiesReceived())
+ {
+ // *TODO* Pump a message for wake up.
+ llcoro::suspend();
+ }
+
+ std::string url = region->getCapability("ProvisionVoiceAccountRequest");
+
+ LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
+ LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
+ httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("voiceAccountProvision", httpPolicy));
+ LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
+ LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions);
+ int retryCount(0);
+
+ LLSD result;
+
+ do
+ {
+ result = httpAdapter->postAndSuspend(httpRequest, url, LLSD(), httpOpts);
+
+ LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
+ LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
+
+ if (status == LLCore::HttpStatus(404))
+ {
+ if (++retryCount > 5)
+ {
+ LL_WARNS("Voice") << "Could not access voice provision cap after 5 attempts." << LL_ENDL;
+ return false;
+ }
+ LL_WARNS("Voice") << "Provision CAP 404. Retrying in 1.0" << LL_ENDL;
+ llcoro::suspendUntilTimeout(1.0);
+
+ continue;
+ }
+ else if (!status)
+ {
+ LL_WARNS("Voice") << "Unable to provision voice account." << LL_ENDL;
+ return false;
+ }
+ break;
+ } while (true);
+
+ std::string voiceSipUriHostname;
+ std::string voiceAccountServerUri;
+ std::string voiceUserName = result["username"].asString();
+ std::string voicePassword = result["password"].asString();
+
+ //LL_DEBUGS("Voice") << "ProvisionVoiceAccountRequest response:" << dumpResponse() << LL_ENDL;
+
+ if (result.has("voice_sip_uri_hostname"))
+ voiceSipUriHostname = result["voice_sip_uri_hostname"].asString();
+
+ // this key is actually misnamed -- it will be an entire URI, not just a hostname.
+ if (result.has("voice_account_server_name"))
+ voiceAccountServerUri = result["voice_account_server_name"].asString();
+
+ setLoginInfo(voiceUserName, voicePassword, voiceSipUriHostname, voiceAccountServerUri);
+
+ return true;
+}
+
+
+bool LLVivoxVoiceClient::establishVoiceConnection()
+{
+ LLEventPump &voiceConnectPump = LLEventPumps::instance().obtain("vivoxClientPump");
+
+ if (!mVoiceEnabled && mIsInitialized)
+ return false;
+
+ setState(stateConnectorStart);
+
+ connectorCreate();
+
+ setState(stateConnectorStarting);
+
+ LLSD result;
+ do
+ {
+ result = llcoro::suspendUntilEventOn(voiceConnectPump);
+ }
+ while (!result.has("connector"));
+
+ if (!result["connector"])
+ {
+
+ setState(stateConnectorFailed);
+ return false;
+ }
+
+ setState(stateConnectorStarted);
+ if (!mVoiceEnabled && mIsInitialized)
+ return false;
+
+ return true;
+}
+
+bool LLVivoxVoiceClient::loginToVivox()
+{
+ int loginRetryCount(0);
+ LLEventPump &voicePump = LLEventPumps::instance().obtain("vivoxClientPump");
+
+ do
+ {
+ setState(stateLoggingIn);
+ loginSendMessage();
+
+ LLSD result;
+ do
+ {
+ result = llcoro::suspendUntilEventOn(voicePump);
+ } while (!result.has("login"));
+
+ if (result["login"])
+ break;
+
+ if (!loginRetryCount)
+ { // on first retry notify user
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGIN_RETRY);
+ }
+
+ if ((++loginRetryCount > MAX_LOGIN_RETRIES) || (!result["login_retry"]))
+ {
+ LL_WARNS("Voice") << "too many login retries, giving up." << LL_ENDL;
+ LLSD args;
+ std::stringstream errs;
+ errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000";
+ args["HOSTID"] = errs.str();
+ mTerminateDaemon = true;
+ if (LLGridManager::getInstance()->isSystemGrid())
+ {
+ LLNotificationsUtil::add("NoVoiceConnect", args);
+ }
+ else
+ {
+ LLNotificationsUtil::add("NoVoiceConnect-GIAB", args);
+ }
+
+ setState(stateLoginFailed);
+ return false;
+ }
+
+ LL_INFOS("Voice") << "will retry login in " << LOGIN_RETRY_SECONDS << " seconds." << LL_ENDL;
+ setState(stateLoginRetryWait);
+ llcoro::suspendUntilTimeout(LOGIN_RETRY_SECONDS);
+ } while (true);
+
+ setState(stateLoggedIn);
+ notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGGED_IN);
+
+
+ // Set up the mute list observer if it hasn't been set up already.
+ if ((!sMuteListListener_listening))
+ {
+ LLMuteList::getInstance()->addObserver(&mutelist_listener);
+ sMuteListListener_listening = true;
+ }
+
+ // Set the initial state of mic mute, local speaker volume, etc.
+ sendLocalAudioUpdates();
+
+ return true;
+}
+
+bool LLVivoxVoiceClient::retrieveVoiceFonts()
+{
+ LLEventPump &voicePump = LLEventPumps::instance().obtain("vivoxClientPump");
+
+ // Request the set of available voice fonts.
+ setState(stateVoiceFontsWait);
+ refreshVoiceEffectLists(true);
+
+ LLSD result;
+ do
+ {
+ result = llcoro::suspendUntilEventOn(voicePump);
+
+ if (result.has("voice_fonts"))
+ break;
+ } while (true);
+
+
+ mVoiceFontExpiryTimer.start();
+ mVoiceFontExpiryTimer.setTimerExpirySec(VOICE_FONT_EXPIRY_INTERVAL);
+
+ setState(stateNoChannel);
+
+ return result["voice_fonts"].asBoolean();
+}
+
+bool LLVivoxVoiceClient::performMicTuning(LLVivoxVoiceClient::state exitState)
+{
+ //---------------------------------------------------------------------
+ setState(stateMicTuningStart);
+
+ while (!mUpdateTimer.hasExpired())
+ { // do not start mic tuning before the update timer has expired.
+ llcoro::suspend();
+ }
+
+ while (mTuningMode)
+ {
+
+ if (mCaptureDeviceDirty || mRenderDeviceDirty)
+ {
+ // These can't be changed while in tuning mode. Set them before starting.
+ std::ostringstream stream;
+
+ buildSetCaptureDevice(stream);
+ buildSetRenderDevice(stream);
+
+ if (!stream.str().empty())
+ {
+ writeString(stream.str());
+ }
+
+ llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
+ }
+
+ // loop mic back to render device.
+ //setMuteMic(0); // make sure the mic is not muted
+ std::ostringstream stream;
+
+ stream << ""
+ << "" << mConnectorHandle << ""
+ << "false"
+ << "\n\n\n";
+
+ // Dirty the mute mic state so that it will get reset when we finishing previewing
+ mMuteMicDirty = true;
+ mTuningSpeakerVolumeDirty = true;
+
+ writeString(stream.str());
+ tuningCaptureStartSendMessage(1); // 1-loop, zero, don't loop
+
+ //---------------------------------------------------------------------
+ setState(stateMicTuningRunning);
+ llcoro::suspend();
+
+ while (mTuningMode && !mCaptureDeviceDirty && !mRenderDeviceDirty)
+ {
+ // process mic/speaker volume changes
+ if (mTuningMicVolumeDirty || mTuningSpeakerVolumeDirty)
+ {
+ std::ostringstream stream;
+
+ if (mTuningMicVolumeDirty)
+ {
+ LL_INFOS("Voice") << "setting tuning mic level to " << mTuningMicVolume << LL_ENDL;
+ stream
+ << ""
+ << "" << mTuningMicVolume << ""
+ << "\n\n\n";
+ }
+
+ if (mTuningSpeakerVolumeDirty)
+ {
+ stream
+ << ""
+ << "" << mTuningSpeakerVolume << ""
+ << "\n\n\n";
+ }
+
+ mTuningMicVolumeDirty = false;
+ mTuningSpeakerVolumeDirty = false;
+
+ if (!stream.str().empty())
+ {
+ writeString(stream.str());
+ }
+ }
+ llcoro::suspend();
+ }
+
+ //---------------------------------------------------------------------
+ setState(stateMicTuningStop);
+
+ // transition out of mic tuning
+ tuningCaptureStopSendMessage();
+ if (mCaptureDeviceDirty || mRenderDeviceDirty)
+ {
+ llcoro::suspendUntilTimeout(UPDATE_THROTTLE_SECONDS);
+ }
+ }
+
+ setState(mTuningExitState);
+
+ // if we exited just to change devices, this will keep us from re-entering too fast.
+ mUpdateTimer.start();
+ mUpdateTimer.setTimerExpirySec(UPDATE_THROTTLE_SECONDS);
+
+ //---------------------------------------------------------------------
+ setState(exitState);
+ return true;
+}
+
+//=========================================================================
+
void LLVivoxVoiceClient::closeSocket(void)
{
mSocket.reset();
@@ -2645,10 +3270,16 @@ void LLVivoxVoiceClient::sendLocalAudioUpdates()
void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &statusString, std::string &connectorHandle, std::string &versionID)
{
+#if 1
+ LLSD result = LLSD::emptyMap();
+#endif
+
if(statusCode != 0)
{
LL_WARNS("Voice") << "Connector.Create response failure: " << statusString << LL_ENDL;
+#if 0
setState(stateConnectorFailed);
+#endif
LLSD args;
std::stringstream errs;
errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000";
@@ -2662,6 +3293,10 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
{
LLNotificationsUtil::add("NoVoiceConnect-GIAB", args);
}
+
+#if 1
+ result["connector"] = LLSD::Boolean(false);
+#endif
}
else
{
@@ -2670,16 +3305,28 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st
mVoiceVersion.serverVersion = versionID;
mConnectorHandle = connectorHandle;
mTerminateDaemon = false;
+#if 1
+ result["connector"] = LLSD::Boolean(true);
+#else
if(getState() == stateConnectorStarting)
{
setState(stateConnectorStarted);
}
+#endif
}
+
+#if 1
+ LLEventPumps::instance().post("vivoxClientPump", result);
+#endif
}
void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString, std::string &accountHandle, int numberOfAliases)
{
- LL_DEBUGS("Voice") << "Account.Login response (" << statusCode << "): " << statusString << LL_ENDL;
+#if 1
+ LLSD result = LLSD::emptyMap();
+#endif
+
+ LL_DEBUGS("Voice") << "Account.Login response (" << statusCode << "): " << statusString << LL_ENDL;
// Status code of 20200 means "bad password". We may want to special-case that at some point.
@@ -2687,24 +3334,40 @@ void LLVivoxVoiceClient::loginResponse(int statusCode, std::string &statusString
{
// Login failure which is probably caused by the delay after a user's password being updated.
LL_INFOS("Voice") << "Account.Login response failure (" << statusCode << "): " << statusString << LL_ENDL;
+#if 1
+ result["login"] = LLSD::Boolean(false);
+ result["login_retry"] = LLSD::Boolean(true);
+#else
setState(stateLoginRetry);
+#endif
}
else if(statusCode != 0)
{
LL_WARNS("Voice") << "Account.Login response failure (" << statusCode << "): " << statusString << LL_ENDL;
- setState(stateLoginFailed);
+#if 1
+ result["login"] = LLSD::Boolean(false);
+ result["login_retry"] = LLSD::Boolean(false);
+#else
+ setState(stateLoginFailed);
+#endif
}
else
{
// Login succeeded, move forward.
mAccountHandle = accountHandle;
mNumberOfAliases = numberOfAliases;
+ result["login"] = LLSD::Boolean(true);
// This needs to wait until the AccountLoginStateChangeEvent is received.
// if(getState() == stateLoggingIn)
// {
// setState(stateLoggedIn);
// }
}
+
+#if 1
+ LLEventPumps::instance().post("vivoxClientPump", result);
+#endif
+
}
void LLVivoxVoiceClient::sessionCreateResponse(std::string &requestId, int statusCode, std::string &statusString, std::string &sessionHandle)
@@ -2910,7 +3573,7 @@ void LLVivoxVoiceClient::sessionGroupAddedEvent(std::string &sessionGroupHandle)
{
LL_DEBUGS("Voice") << "handle " << sessionGroupHandle << LL_ENDL;
-#if USE_SESSION_GROUPS
+#if USE_SESSION_GROUPS
if(mMainSessionGroupHandle.empty())
{
// This is the first (i.e. "main") session group. Save its handle.
@@ -5970,11 +6633,20 @@ void LLVivoxVoiceClient::sessionSetVoiceFontSendMessage(sessionState *session)
void LLVivoxVoiceClient::accountGetSessionFontsResponse(int statusCode, const std::string &statusString)
{
+#if 1
+ LLSD result = LLSD::emptyMap();
+
+ result["voice_fonts"] = LLSD::Boolean(true);
+
+ LLEventPumps::instance().post("vivoxClientPump", result);
+
+#else
// Voice font list entries were updated via addVoiceFont() during parsing.
if(getState() == stateVoiceFontsWait)
{
setState(stateVoiceFontsReceived);
}
+#endif
notifyVoiceFontObservers();
mVoiceFontsReceived = true;
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 2f671306b1..5c9a1b73a3 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -433,8 +433,8 @@ protected:
void connectorShutdown();
void closeSocket(void);
- void requestVoiceAccountProvision(S32 retries = 3);
- void login(
+// void requestVoiceAccountProvision(S32 retries = 3);
+ void setLoginInfo(
const std::string& account_name,
const std::string& password,
const std::string& voice_sip_uri_hostname,
@@ -639,11 +639,22 @@ protected:
private:
- void voiceAccountProvisionCoro(std::string url, S32 retries);
+// void voiceAccountProvisionCoro(std::string url, S32 retries);
void parcelVoiceInfoRequestCoro(std::string url);
LLVoiceVersionInfo mVoiceVersion;
+ // Coroutine support methods
+ bool startAndConnectSession();
+
+ bool startAndLaunchDaemon();
+ bool provisionVoiceAccount();
+ bool establishVoiceConnection();
+ bool loginToVivox();
+ bool retrieveVoiceFonts();
+
+ bool performMicTuning(state exitState);
+
/// Clean up objects created during a voice session.
void cleanUp();
--
cgit v1.3