summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloateravatarpicker.cpp57
-rwxr-xr-xindra/newview/llfloateravatarpicker.h3
-rwxr-xr-xindra/newview/llvoavatarself.cpp2
-rwxr-xr-xindra/newview/llvoavatarself.h2
-rwxr-xr-xindra/newview/llvoicechannel.cpp2
-rwxr-xr-xindra/newview/llvoicechannel.h2
-rwxr-xr-xindra/newview/llvoicevivox.cpp4
-rwxr-xr-xindra/newview/llvoicevivox.h4
8 files changed, 38 insertions, 38 deletions
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 566a3c9cd3..84e3584331 100755
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -52,6 +52,7 @@
#include "llfocusmgr.h"
#include "lldraghandle.h"
#include "message.h"
+#include "llcorehttputil.h"
//#include "llsdserialize.h"
@@ -456,39 +457,33 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const
return FALSE;
}
-class LLAvatarPickerResponder : public LLHTTPClient::Responder
+/*static*/
+void LLFloaterAvatarPicker::findCoro(LLCoros::self& self, std::string url, LLUUID queryID, std::string name)
{
- LOG_CLASS(LLAvatarPickerResponder);
-public:
- LLUUID mQueryID;
- std::string mName;
+ LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
+ LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
+ httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy));
+ LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLAvatarPickerResponder(const LLUUID& id, const std::string& name) : mQueryID(id), mName(name) { }
+ LL_INFOS("HttpCoroutineAdapter", "genericPostCoro") << "Generic POST for " << url << LL_ENDL;
-protected:
- /*virtual*/ void httpCompleted()
- {
- //std::ostringstream ss;
- //LLSDSerialize::toPrettyXML(content, ss);
- //LL_INFOS() << ss.str() << LL_ENDL;
+ LLSD result = httpAdapter->getAndYield(self, httpRequest, url);
+
+ LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
+ LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
+
+ if (status || (status == LLCore::HttpStatus(HTTP_BAD_REQUEST)))
+ {
+ LLFloaterAvatarPicker* floater =
+ LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker", name);
+ if (floater)
+ {
+ result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS);
+ floater->processResponse(queryID, result);
+ }
+ }
+}
- // in case of invalid characters, the avatar picker returns a 400
- // just set it to process so it displays 'not found'
- if (isGoodStatus() || getStatus() == HTTP_BAD_REQUEST)
- {
- LLFloaterAvatarPicker* floater =
- LLFloaterReg::findTypedInstance<LLFloaterAvatarPicker>("avatar_picker", mName);
- if (floater)
- {
- floater->processResponse(mQueryID, getContent());
- }
- }
- else
- {
- LL_WARNS() << "avatar picker failed " << dumpResponse() << LL_ENDL;
- }
- }
-};
void LLFloaterAvatarPicker::find()
{
@@ -517,7 +512,9 @@ void LLFloaterAvatarPicker::find()
std::replace(text.begin(), text.end(), '.', ' ');
url += LLURI::escape(text);
LL_INFOS() << "avatar picker " << url << LL_ENDL;
- LLHTTPClient::get(url, new LLAvatarPickerResponder(mQueryID, getKey().asString()));
+
+ LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro",
+ boost::bind(&LLFloaterAvatarPicker::findCoro, _1, url, mQueryID, getKey().asString()));
}
else
{
diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h
index ed3e51c56f..200f74278e 100755
--- a/indra/newview/llfloateravatarpicker.h
+++ b/indra/newview/llfloateravatarpicker.h
@@ -28,6 +28,8 @@
#define LLFLOATERAVATARPICKER_H
#include "llfloater.h"
+#include "lleventcoro.h"
+#include "llcoros.h"
#include <vector>
@@ -84,6 +86,7 @@ private:
void populateFriend();
BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected.
+ static void findCoro(LLCoros::self& self, std::string url, LLUUID mQueryID, std::string mName);
void find();
void setAllowMultiple(BOOL allow_multiple);
LLScrollListCtrl* getActiveList();
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 3c18d11248..0d99c9ac14 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -2182,7 +2182,7 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const
return text;
}
-void LLVOAvatarSelf::appearanceChangeMetricsCoro(LLCoros::self& self, std::string &url)
+void LLVOAvatarSelf::appearanceChangeMetricsCoro(LLCoros::self& self, std::string url)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 46f92763a2..b3b5fe6c2f 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -402,7 +402,7 @@ private:
F32 mDebugBakedTextureTimes[LLAvatarAppearanceDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture
void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
- void appearanceChangeMetricsCoro(LLCoros::self& self, std::string &url);
+ void appearanceChangeMetricsCoro(LLCoros::self& self, std::string url);
bool mInitialMetric;
S32 mMetricSequence;
/** Diagnostics
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index a609f02710..fd1892e94b 100755
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -605,7 +605,7 @@ void LLVoiceChannelGroup::setState(EState state)
}
}
-void LLVoiceChannelGroup::voiceCallCapCoro(LLCoros::self& self, std::string &url)
+void LLVoiceChannelGroup::voiceCallCapCoro(LLCoros::self& self, std::string url)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h
index 13d73a51f8..0dac0b1f6a 100755
--- a/indra/newview/llvoicechannel.h
+++ b/indra/newview/llvoicechannel.h
@@ -159,7 +159,7 @@ protected:
virtual void setState(EState state);
private:
- void voiceCallCapCoro(LLCoros::self& self, std::string &url);
+ void voiceCallCapCoro(LLCoros::self& self, std::string url);
U32 mRetries;
BOOL mIsRetrying;
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 6d8f48b705..c70ce5801d 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -452,7 +452,7 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries)
}
}
-void LLVivoxVoiceClient::voiceAccountProvisionCoro(LLCoros::self& self, std::string &url, S32 retries)
+void LLVivoxVoiceClient::voiceAccountProvisionCoro(LLCoros::self& self, std::string url, S32 retries)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
@@ -3933,7 +3933,7 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo()
}
}
-void LLVivoxVoiceClient::parcelVoiceInfoRequestCoro(LLCoros::self& self, std::string &url)
+void LLVivoxVoiceClient::parcelVoiceInfoRequestCoro(LLCoros::self& self, std::string url)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 5e20351e73..f00108050b 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -636,8 +636,8 @@ protected:
private:
- void voiceAccountProvisionCoro(LLCoros::self& self, std::string &url, S32 retries);
- void parcelVoiceInfoRequestCoro(LLCoros::self& self, std::string &url);
+ void voiceAccountProvisionCoro(LLCoros::self& self, std::string url, S32 retries);
+ void parcelVoiceInfoRequestCoro(LLCoros::self& self, std::string url);
LLVoiceVersionInfo mVoiceVersion;