From ff121254b29ea628472faf1eda06058f06c050d1 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Fri, 22 May 2015 09:27:33 -0700 Subject: Removed dead HTTP client adapter code Partial conversion of group manager clean up some debug code in web profiles. --- indra/newview/llgroupmgr.cpp | 183 +++++++++++++++++++++++++++++++------------ 1 file changed, 135 insertions(+), 48 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 56e671d902..21220507e7 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -53,6 +53,7 @@ #include "lltrans.h" #include "llviewerregion.h" #include +#include "llcorehttputil.h" #if LL_MSVC #pragma warning(push) @@ -768,9 +769,9 @@ void LLGroupMgrGroupData::removeBanEntry(const LLUUID& ban_id) // LLGroupMgr // -LLGroupMgr::LLGroupMgr() +LLGroupMgr::LLGroupMgr(): + mMemberRequestInFlight(false) { - mLastGroupMembersRequestFrame = 0; } LLGroupMgr::~LLGroupMgr() @@ -1861,7 +1862,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, group_datap->mMemberVersion.generate(); } - +#if 1 // Responder class for capability group management class GroupBanDataResponder : public LLHTTPClient::Responder { @@ -1900,6 +1901,77 @@ void GroupBanDataResponder::httpSuccess() } } +#else +//void LLGroupMgr::groupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, +// LLGroupMgr::EBanRequestAction action, uuid_vec_t banList) +void LLGroupMgr::groupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, + LLGroupMgr::EBanRequestAction action, LLSD body) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + + std::string finalUrl = url + "?group_id=" + groupId.asString(); + + EBanRequestAction currAction = action; + + do + { + LLSD result; + + if (currAction & (BAN_CREATE | BAN_DELETE)) // these two actions result in POSTS + { // build the post data. +// LLSD postData = LLSD::emptyMap(); +// +// postData["ban_action"] = (LLSD::Integer)(currAction & ~BAN_UPDATE); +// // Add our list of potential banned residents to the list +// postData["ban_ids"] = LLSD::emptyArray(); +// +// LLSD banEntry; +// for (uuid_vec_t::const_iterator it = banList.begin(); it != banList.end(); ++it) +// { +// banEntry = (*it); +// postData["ban_ids"].append(banEntry); +// } +// +// result = httpAdapter->postAndYield(self, httpRequest, finalUrl, postData); + + result = httpAdapter->postAndYield(self, httpRequest, finalUrl, body); + } + else + { + result = httpAdapter->getAndYield(self, httpRequest, finalUrl); + } + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("GrpMgr") << "Error receiving group member data " << LL_ENDL; + return; + } + + if (result.has("ban_list")) + { + result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); + // group ban data received + processGroupBanRequest(result); + } + + if (currAction & BAN_UPDATE) + { + currAction = BAN_NO_ACTION; + continue; + } + break; + } while (true); +} + +#endif + + void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, const LLUUID& group_id, U32 ban_action, /* = BAN_NO_ACTION */ @@ -1925,7 +1997,32 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, { return; } - cap_url += "?group_id=" + group_id.asString(); + +#if 0 + + LLSD body = LLSD::emptyMap(); + body["ban_action"] = (LLSD::Integer)(ban_action & ~BAN_UPDATE); + // Add our list of potential banned residents to the list + body["ban_ids"] = LLSD::emptyArray(); + LLSD ban_entry; + + uuid_vec_t::const_iterator iter = ban_list.begin(); + for (; iter != ban_list.end(); ++iter) + { + ban_entry = (*iter); + body["ban_ids"].append(ban_entry); + } + + LLCoros::instance().launch("LLGroupMgr::groupBanRequestCoro", + boost::bind(&LLGroupMgr::groupBanRequestCoro, this, _1, cap_url, group_id, + static_cast(ban_action), body)); + +// LLCoros::instance().launch("LLGroupMgr::groupBanRequestCoro", +// boost::bind(&LLGroupMgr::groupBanRequestCoro, this, _1, cap_url, group_id, +// static_cast(ban_action), ban_list)); + +#else + cap_url += "?group_id=" + group_id.asString(); LLSD body = LLSD::emptyMap(); body["ban_action"] = (LLSD::Integer)(ban_action & ~BAN_UPDATE); @@ -1953,9 +2050,9 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, case REQUEST_DEL: break; } +#endif } - void LLGroupMgr::processGroupBanRequest(const LLSD& content) { // Did we get anything in content? @@ -1992,45 +2089,42 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) LLGroupMgr::getInstance()->notifyObservers(GC_BANLIST); } +void LLGroupMgr::groupMembersRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mMemberRequestInFlight = true; -// Responder class for capability group management -class GroupMemberDataResponder : public LLHTTPClient::Responder -{ - LOG_CLASS(GroupMemberDataResponder); -public: - GroupMemberDataResponder() {} - virtual ~GroupMemberDataResponder() {} + LLSD postData = LLSD::emptyMap(); + postData["group_id"] = groupId; -private: - /* virtual */ void httpSuccess(); - /* virtual */ void httpFailure(); - LLSD mMemberData; -}; + LLSD result = httpAdapter->postAndYield(self, httpRequest, url, postData, httpOpts); -void GroupMemberDataResponder::httpFailure() -{ - LL_WARNS("GrpMgr") << "Error receiving group member data " - << dumpResponse() << LL_ENDL; -} + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); -void GroupMemberDataResponder::httpSuccess() -{ - const LLSD& content = getContent(); - if (!content.isMap()) - { - failureResult(HTTP_INTERNAL_ERROR, "Malformed response contents", content); - return; - } - LLGroupMgr::processCapGroupMembersRequest(content); -} + if (!status) + { + LL_WARNS("GrpMgr") << "Error receiving group member data " << LL_ENDL; + mMemberRequestInFlight = false; + return; + } + result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); + LLGroupMgr::processCapGroupMembersRequest(result); + mMemberRequestInFlight = false; +} -// static void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) { + static U32 lastGroupMemberRequestFrame = 0; + // Have we requested the information already this frame? - if(mLastGroupMembersRequestFrame == gFrameCount) + if ((lastGroupMemberRequestFrame == gFrameCount) || (mMemberRequestInFlight)) return; LLViewerRegion* currentRegion = gAgent.getRegion(); @@ -2059,20 +2153,13 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) return; } - // Post to our service. Add a body containing the group_id. - LLSD body = LLSD::emptyMap(); - body["group_id"] = group_id; - - LLHTTPClient::ResponderPtr grp_data_responder = new GroupMemberDataResponder(); - - // This could take a while to finish, timeout after 5 minutes. - LLHTTPClient::post(cap_url, body, grp_data_responder, LLSD(), 300); + lastGroupMemberRequestFrame = gFrameCount; - mLastGroupMembersRequestFrame = gFrameCount; + LLCoros::instance().launch("LLGroupMgr::groupMembersRequestCoro", + boost::bind(&LLGroupMgr::groupMembersRequestCoro, this, _1, cap_url, group_id)); } -// static void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) { // Did we get anything in content? @@ -2089,7 +2176,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) LLUUID group_id = content["group_id"].asUUID(); - LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id); + LLGroupMgrGroupData* group_datap = getGroupData(group_id); if(!group_datap) { LL_WARNS("GrpMgr") << "Received incorrect, possibly stale, group or request id" << LL_ENDL; @@ -2183,7 +2270,7 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) // TODO: // Refactor to reduce multiple calls for data we already have. if(group_datap->mTitles.size() < 1) - LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id); + sendGroupTitlesRequest(group_id); group_datap->mMemberDataComplete = true; @@ -2192,11 +2279,11 @@ void LLGroupMgr::processCapGroupMembersRequest(const LLSD& content) if (group_datap->mPendingRoleMemberRequest || !group_datap->mRoleMemberDataComplete) { group_datap->mPendingRoleMemberRequest = false; - LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_id); + sendGroupRoleMembersRequest(group_id); } group_datap->mChanged = TRUE; - LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA); + notifyObservers(GC_MEMBER_DATA); } -- cgit v1.2.3 From d0d58c41b48f8a2a0e18610b577059ee8419be5c Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 4 Jun 2015 17:36:24 -0700 Subject: Default headers added. Group manager finished conversion. Outfit folders coverted. --- indra/newview/llgroupmgr.cpp | 223 ++++++++++++++++--------------------------- 1 file changed, 81 insertions(+), 142 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 21220507e7..0852104ba7 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1862,120 +1862,94 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, group_datap->mMemberVersion.generate(); } -#if 1 -// Responder class for capability group management -class GroupBanDataResponder : public LLHTTPClient::Responder +void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) { -public: - GroupBanDataResponder(const LLUUID& gropup_id, BOOL force_refresh=false); - virtual ~GroupBanDataResponder() {} - virtual void httpSuccess(); - virtual void httpFailure(); -private: - LLUUID mGroupID; - BOOL mForceRefresh; -}; + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); -GroupBanDataResponder::GroupBanDataResponder(const LLUUID& gropup_id, BOOL force_refresh) : - mGroupID(gropup_id), - mForceRefresh(force_refresh) -{} + std::string finalUrl = url + "?group_id=" + groupId.asString(); -void GroupBanDataResponder::httpFailure() -{ - LL_WARNS("GrpMgr") << "Error receiving group member data [status:" - << mStatus << "]: " << mContent << LL_ENDL; -} + LLSD result = httpAdapter->getAndYield(self, httpRequest, finalUrl); -void GroupBanDataResponder::httpSuccess() -{ - if (mContent.has("ban_list")) - { - // group ban data received - LLGroupMgr::processGroupBanRequest(mContent); - } - else if (mForceRefresh) - { - // no ban data received, refreshing data after successful operation - LLGroupMgr::getInstance()->sendGroupBanRequest(LLGroupMgr::REQUEST_GET, mGroupID); - } + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("GrpMgr") << "Error receiving group member data " << LL_ENDL; + return; + } + + if (result.has("ban_list")) + { + result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); + // group ban data received + processGroupBanRequest(result); + } } -#else -//void LLGroupMgr::groupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, -// LLGroupMgr::EBanRequestAction action, uuid_vec_t banList) -void LLGroupMgr::groupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, - LLGroupMgr::EBanRequestAction action, LLSD body) +void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, + U32 action, uuid_vec_t banList, bool update) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders, false); + LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions, false); + + httpOptions->setFollowRedirects(false); + + httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); + std::string finalUrl = url + "?group_id=" + groupId.asString(); - EBanRequestAction currAction = action; + LLSD postData = LLSD::emptyMap(); + postData["ban_action"] = (LLSD::Integer)action; + // Add our list of potential banned residents to the list + postData["ban_ids"] = LLSD::emptyArray(); + LLSD banEntry; - do + uuid_vec_t::const_iterator it = banList.begin(); + for (; it != banList.end(); ++it) { - LLSD result; - - if (currAction & (BAN_CREATE | BAN_DELETE)) // these two actions result in POSTS - { // build the post data. -// LLSD postData = LLSD::emptyMap(); -// -// postData["ban_action"] = (LLSD::Integer)(currAction & ~BAN_UPDATE); -// // Add our list of potential banned residents to the list -// postData["ban_ids"] = LLSD::emptyArray(); -// -// LLSD banEntry; -// for (uuid_vec_t::const_iterator it = banList.begin(); it != banList.end(); ++it) -// { -// banEntry = (*it); -// postData["ban_ids"].append(banEntry); -// } -// -// result = httpAdapter->postAndYield(self, httpRequest, finalUrl, postData); - - result = httpAdapter->postAndYield(self, httpRequest, finalUrl, body); - } - else - { - result = httpAdapter->getAndYield(self, httpRequest, finalUrl); - } - - LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; - LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - - if (!status) - { - LL_WARNS("GrpMgr") << "Error receiving group member data " << LL_ENDL; - return; - } - - if (result.has("ban_list")) - { - result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); - // group ban data received - processGroupBanRequest(result); - } - - if (currAction & BAN_UPDATE) - { - currAction = BAN_NO_ACTION; - continue; - } - break; - } while (true); -} + banEntry = (*it); + postData["ban_ids"].append(banEntry); + } -#endif + LL_WARNS() << "post: " << ll_pretty_print_sd(postData) << LL_ENDL; + LLSD result = httpAdapter->postAndYield(self, httpRequest, finalUrl, postData, httpOptions, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("GrpMgr") << "Error posting group member data " << LL_ENDL; + return; + } + + if (result.has("ban_list")) + { + result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS); + // group ban data received + processGroupBanRequest(result); + } + + if (update) + { + getGroupBanRequestCoro(self, url, groupId); + } +} void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, const LLUUID& group_id, U32 ban_action, /* = BAN_NO_ACTION */ - const std::vector ban_list) /* = std::vector() */ + const std::vector &ban_list) /* = std::vector() */ { LLViewerRegion* currentRegion = gAgent.getRegion(); if(!currentRegion) @@ -1998,59 +1972,24 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, return; } -#if 0 + U32 action = ban_action & ~BAN_UPDATE; + bool update = ((ban_action & BAN_UPDATE) == BAN_UPDATE); - LLSD body = LLSD::emptyMap(); - body["ban_action"] = (LLSD::Integer)(ban_action & ~BAN_UPDATE); - // Add our list of potential banned residents to the list - body["ban_ids"] = LLSD::emptyArray(); - LLSD ban_entry; - - uuid_vec_t::const_iterator iter = ban_list.begin(); - for (; iter != ban_list.end(); ++iter) + switch (request_type) { - ban_entry = (*iter); - body["ban_ids"].append(ban_entry); + case REQUEST_GET: + LLCoros::instance().launch("LLGroupMgr::getGroupBanRequestCoro", + boost::bind(&LLGroupMgr::getGroupBanRequestCoro, this, _1, cap_url, group_id)); + break; + case REQUEST_POST: + LLCoros::instance().launch("LLGroupMgr::postGroupBanRequestCoro", + boost::bind(&LLGroupMgr::postGroupBanRequestCoro, this, _1, cap_url, group_id, + action, ban_list, update)); + break; + case REQUEST_PUT: + case REQUEST_DEL: + break; } - - LLCoros::instance().launch("LLGroupMgr::groupBanRequestCoro", - boost::bind(&LLGroupMgr::groupBanRequestCoro, this, _1, cap_url, group_id, - static_cast(ban_action), body)); - -// LLCoros::instance().launch("LLGroupMgr::groupBanRequestCoro", -// boost::bind(&LLGroupMgr::groupBanRequestCoro, this, _1, cap_url, group_id, -// static_cast(ban_action), ban_list)); - -#else - cap_url += "?group_id=" + group_id.asString(); - - LLSD body = LLSD::emptyMap(); - body["ban_action"] = (LLSD::Integer)(ban_action & ~BAN_UPDATE); - // Add our list of potential banned residents to the list - body["ban_ids"] = LLSD::emptyArray(); - LLSD ban_entry; - - uuid_vec_t::const_iterator iter = ban_list.begin(); - for(;iter != ban_list.end(); ++iter) - { - ban_entry = (*iter); - body["ban_ids"].append(ban_entry); - } - - LLHTTPClient::ResponderPtr grp_ban_responder = new GroupBanDataResponder(group_id, ban_action & BAN_UPDATE); - switch(request_type) - { - case REQUEST_GET: - LLHTTPClient::get(cap_url, grp_ban_responder); - break; - case REQUEST_POST: - LLHTTPClient::post(cap_url, body, grp_ban_responder); - break; - case REQUEST_PUT: - case REQUEST_DEL: - break; - } -#endif } void LLGroupMgr::processGroupBanRequest(const LLSD& content) -- cgit v1.2.3 From 80d17b2dd9cdd7a9445480fdb0e12774396751eb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 29 Jun 2015 17:19:51 -0400 Subject: MAINT-4952: Use IntrusivePtr for BufferArray,HttpHeaders,HttpOptions. Specifically, change the ptr_t typedefs for these LLCore classes to use IntrusivePtr rather than directly using boost::intrusive_ptr. This allows us to use a simple ptr_t(raw ptr) constructor rather than having to remember to code ptr_t(raw ptr, false) everywhere. In fact, the latter form is now invalid: remove the now-extraneous 'false' constructor parameters. --- indra/newview/llgroupmgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 0852104ba7..0fb39ab02e 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1897,8 +1897,8 @@ void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, L LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders, false); - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions, false); + LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); httpOptions->setFollowRedirects(false); -- cgit v1.2.3 From b262ded7e0cf21314524bf702b0e4fe28a3c3060 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 1 Jul 2015 18:33:29 -0400 Subject: MAINT-5351: Remove 'self' parameter from coroutine functions. lleventcoro_test.cpp runs clean (as modified for new API), and all the rest builds clean, but the resulting viewer is as yet untested. --- indra/newview/llgroupmgr.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 0fb39ab02e..edae0bfd19 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1862,7 +1862,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, group_datap->mMemberVersion.generate(); } -void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) +void LLGroupMgr::getGroupBanRequestCoro(std::string url, LLUUID groupId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -1871,7 +1871,7 @@ void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LL std::string finalUrl = url + "?group_id=" + groupId.asString(); - LLSD result = httpAdapter->getAndYield(self, httpRequest, finalUrl); + LLSD result = httpAdapter->getAndYield(httpRequest, finalUrl); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -1890,7 +1890,7 @@ void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LL } } -void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, +void LLGroupMgr::postGroupBanRequestCoro(std::string url, LLUUID groupId, U32 action, uuid_vec_t banList, bool update) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -1922,7 +1922,7 @@ void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, L LL_WARNS() << "post: " << ll_pretty_print_sd(postData) << LL_ENDL; - LLSD result = httpAdapter->postAndYield(self, httpRequest, finalUrl, postData, httpOptions, httpHeaders); + LLSD result = httpAdapter->postAndYield(httpRequest, finalUrl, postData, httpOptions, httpHeaders); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -1942,7 +1942,7 @@ void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, L if (update) { - getGroupBanRequestCoro(self, url, groupId); + getGroupBanRequestCoro(url, groupId); } } @@ -1979,11 +1979,11 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, { case REQUEST_GET: LLCoros::instance().launch("LLGroupMgr::getGroupBanRequestCoro", - boost::bind(&LLGroupMgr::getGroupBanRequestCoro, this, _1, cap_url, group_id)); + boost::bind(&LLGroupMgr::getGroupBanRequestCoro, this, cap_url, group_id)); break; case REQUEST_POST: LLCoros::instance().launch("LLGroupMgr::postGroupBanRequestCoro", - boost::bind(&LLGroupMgr::postGroupBanRequestCoro, this, _1, cap_url, group_id, + boost::bind(&LLGroupMgr::postGroupBanRequestCoro, this, cap_url, group_id, action, ban_list, update)); break; case REQUEST_PUT: @@ -2028,7 +2028,7 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) LLGroupMgr::getInstance()->notifyObservers(GC_BANLIST); } -void LLGroupMgr::groupMembersRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) +void LLGroupMgr::groupMembersRequestCoro(std::string url, LLUUID groupId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -2041,7 +2041,7 @@ void LLGroupMgr::groupMembersRequestCoro(LLCoros::self& self, std::string url, L LLSD postData = LLSD::emptyMap(); postData["group_id"] = groupId; - LLSD result = httpAdapter->postAndYield(self, httpRequest, url, postData, httpOpts); + LLSD result = httpAdapter->postAndYield(httpRequest, url, postData, httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -2095,7 +2095,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) lastGroupMemberRequestFrame = gFrameCount; LLCoros::instance().launch("LLGroupMgr::groupMembersRequestCoro", - boost::bind(&LLGroupMgr::groupMembersRequestCoro, this, _1, cap_url, group_id)); + boost::bind(&LLGroupMgr::groupMembersRequestCoro, this, cap_url, group_id)); } -- cgit v1.2.3 From 247eb0c9c3418c10be8f2a0e3c8116758efa702f Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 7 Jul 2015 19:41:27 +0100 Subject: Backout selfles merge 738255dbbfd679d9e615baab3398e5e345bbb3c5 --- indra/newview/llgroupmgr.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index edae0bfd19..0fb39ab02e 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1862,7 +1862,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, group_datap->mMemberVersion.generate(); } -void LLGroupMgr::getGroupBanRequestCoro(std::string url, LLUUID groupId) +void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -1871,7 +1871,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->getAndYield(self, httpRequest, finalUrl); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -1890,7 +1890,7 @@ void LLGroupMgr::getGroupBanRequestCoro(std::string url, LLUUID groupId) } } -void LLGroupMgr::postGroupBanRequestCoro(std::string url, LLUUID groupId, +void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, U32 action, uuid_vec_t banList, bool update) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -1922,7 +1922,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->postAndYield(self, httpRequest, finalUrl, postData, httpOptions, httpHeaders); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -1942,7 +1942,7 @@ void LLGroupMgr::postGroupBanRequestCoro(std::string url, LLUUID groupId, if (update) { - getGroupBanRequestCoro(url, groupId); + getGroupBanRequestCoro(self, url, groupId); } } @@ -1979,11 +1979,11 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, { case REQUEST_GET: LLCoros::instance().launch("LLGroupMgr::getGroupBanRequestCoro", - boost::bind(&LLGroupMgr::getGroupBanRequestCoro, this, cap_url, group_id)); + boost::bind(&LLGroupMgr::getGroupBanRequestCoro, this, _1, cap_url, group_id)); break; case REQUEST_POST: LLCoros::instance().launch("LLGroupMgr::postGroupBanRequestCoro", - boost::bind(&LLGroupMgr::postGroupBanRequestCoro, this, cap_url, group_id, + boost::bind(&LLGroupMgr::postGroupBanRequestCoro, this, _1, cap_url, group_id, action, ban_list, update)); break; case REQUEST_PUT: @@ -2028,7 +2028,7 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) LLGroupMgr::getInstance()->notifyObservers(GC_BANLIST); } -void LLGroupMgr::groupMembersRequestCoro(std::string url, LLUUID groupId) +void LLGroupMgr::groupMembersRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -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->postAndYield(self, httpRequest, url, postData, httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -2095,7 +2095,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) lastGroupMemberRequestFrame = gFrameCount; LLCoros::instance().launch("LLGroupMgr::groupMembersRequestCoro", - boost::bind(&LLGroupMgr::groupMembersRequestCoro, this, cap_url, group_id)); + boost::bind(&LLGroupMgr::groupMembersRequestCoro, this, _1, cap_url, group_id)); } -- cgit v1.2.3 From efa9a0f99c17b2b937120bcad6e3d45944122ed9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 10 Jul 2015 19:30:10 -0400 Subject: Backed out changeset bab1000e1b2d: restore 'selfless' changes --- indra/newview/llgroupmgr.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 0fb39ab02e..edae0bfd19 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1862,7 +1862,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, group_datap->mMemberVersion.generate(); } -void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) +void LLGroupMgr::getGroupBanRequestCoro(std::string url, LLUUID groupId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -1871,7 +1871,7 @@ void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LL std::string finalUrl = url + "?group_id=" + groupId.asString(); - LLSD result = httpAdapter->getAndYield(self, httpRequest, finalUrl); + LLSD result = httpAdapter->getAndYield(httpRequest, finalUrl); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -1890,7 +1890,7 @@ void LLGroupMgr::getGroupBanRequestCoro(LLCoros::self& self, std::string url, LL } } -void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId, +void LLGroupMgr::postGroupBanRequestCoro(std::string url, LLUUID groupId, U32 action, uuid_vec_t banList, bool update) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -1922,7 +1922,7 @@ void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, L LL_WARNS() << "post: " << ll_pretty_print_sd(postData) << LL_ENDL; - LLSD result = httpAdapter->postAndYield(self, httpRequest, finalUrl, postData, httpOptions, httpHeaders); + LLSD result = httpAdapter->postAndYield(httpRequest, finalUrl, postData, httpOptions, httpHeaders); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -1942,7 +1942,7 @@ void LLGroupMgr::postGroupBanRequestCoro(LLCoros::self& self, std::string url, L if (update) { - getGroupBanRequestCoro(self, url, groupId); + getGroupBanRequestCoro(url, groupId); } } @@ -1979,11 +1979,11 @@ void LLGroupMgr::sendGroupBanRequest( EBanRequestType request_type, { case REQUEST_GET: LLCoros::instance().launch("LLGroupMgr::getGroupBanRequestCoro", - boost::bind(&LLGroupMgr::getGroupBanRequestCoro, this, _1, cap_url, group_id)); + boost::bind(&LLGroupMgr::getGroupBanRequestCoro, this, cap_url, group_id)); break; case REQUEST_POST: LLCoros::instance().launch("LLGroupMgr::postGroupBanRequestCoro", - boost::bind(&LLGroupMgr::postGroupBanRequestCoro, this, _1, cap_url, group_id, + boost::bind(&LLGroupMgr::postGroupBanRequestCoro, this, cap_url, group_id, action, ban_list, update)); break; case REQUEST_PUT: @@ -2028,7 +2028,7 @@ void LLGroupMgr::processGroupBanRequest(const LLSD& content) LLGroupMgr::getInstance()->notifyObservers(GC_BANLIST); } -void LLGroupMgr::groupMembersRequestCoro(LLCoros::self& self, std::string url, LLUUID groupId) +void LLGroupMgr::groupMembersRequestCoro(std::string url, LLUUID groupId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -2041,7 +2041,7 @@ void LLGroupMgr::groupMembersRequestCoro(LLCoros::self& self, std::string url, L LLSD postData = LLSD::emptyMap(); postData["group_id"] = groupId; - LLSD result = httpAdapter->postAndYield(self, httpRequest, url, postData, httpOpts); + LLSD result = httpAdapter->postAndYield(httpRequest, url, postData, httpOpts); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); @@ -2095,7 +2095,7 @@ void LLGroupMgr::sendCapGroupMembersRequest(const LLUUID& group_id) lastGroupMemberRequestFrame = gFrameCount; LLCoros::instance().launch("LLGroupMgr::groupMembersRequestCoro", - boost::bind(&LLGroupMgr::groupMembersRequestCoro, this, _1, cap_url, group_id)); + boost::bind(&LLGroupMgr::groupMembersRequestCoro, this, cap_url, group_id)); } -- cgit v1.2.3 From 97236a42ca08979897d5c7b0826312345754cd67 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 14 Sep 2015 11:15:23 -0700 Subject: MAINT-5507: Remove HTTPClient and related cruft. --- indra/newview/llgroupmgr.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index eda9e51d23..b218f4f756 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -41,7 +41,6 @@ #include "llui.h" #include "message.h" #include "roles_constants.h" -#include "llhttpclient.h" #include "lltransactiontypes.h" #include "llstatusbar.h" #include "lleconomy.h" -- cgit v1.2.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/newview/llgroupmgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llgroupmgr.cpp') 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); -- cgit v1.2.3 From c9a81ae0792bd0b6fb60789177101880b81d7dde Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 12 Jan 2016 19:20:54 +0200 Subject: MAINT-6041 Crash in LLGroupMgr::processGroupPropertiesReply Added a Null check --- indra/newview/llgroupmgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llgroupmgr.cpp') diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index e1315adfde..012a4fdb2f 100755 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1053,6 +1053,11 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) { LL_DEBUGS() << "LLGroupMgr::processGroupPropertiesReply" << LL_ENDL; + if (!msg) + { + LL_ERRS() << "Can't access the messaging system" << LL_ENDL; + return; + } LLUUID agent_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) -- cgit v1.2.3