From f945415210f0e18c2c6d941fda6b7d45cb0f06f1 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 13 Mar 2013 06:26:25 +0000 Subject: Large changes to the LLCurl::Responder API, as well as pulling in some changes to common libraries from the server codebase: * Additional error checking in http handlers. * Uniform log spam for http errors. * Switch to using constants for http heads and status codes. * Fixed bugs in incorrectly checking if parsing LLSD xml resulted in an error. * Reduced spam regarding LLSD parsing errors in the default completedRaw http handler. It should not longer be necessary to short-circuit completedRaw to avoid spam. * Ported over a few bug fixes from the server code. * Switch mode http status codes to use S32 instead of U32. * Ported LLSD::asStringRef from server code; avoids copying strings all over the place. * Ported server change to LLSD::asBinary; this always returns a reference now instead of copying the entire binary blob. * Ported server pretty notation format (and pretty binary format) to llsd serialization. * The new LLCurl::Responder API no longer has two error handlers to choose from. Overriding the following methods have been deprecated: ** error - use httpFailure ** errorWithContent - use httpFailure ** result - use httpSuccess ** completed - use httpCompleted ** completedHeader - no longer necessary; call getResponseHeaders() from a completion method to obtain these headers. * In order to 'catch' a completed http request, override one of these methods: ** httpSuccess - Called for any 2xx status code. ** httpFailure - Called for any non-2xx status code. ** httpComplete - Called for all status codes. Default implementation is to call either httpSuccess or httpFailure. * It is recommended to keep these methods protected/private in order to avoid triggering of these methods without using a 'push' method (see below). * Uniform error handling should followed whenever possible by calling a variant of this during httpFailure: ** llwarns << dumpResponse() << llendl; * Be sure to include LOG_CLASS(your_class_name) in your class in order for the log entry to give more context. * In order to 'push' a result into the responder, you should no longer call error, errorWithContent, result, or completed. * Nor should you directly call httpSuccess/Failure/Completed (unless passing a message up to a parent class). * Instead, you can set the internal content of a responder and trigger a corresponding method using the following methods: ** successResult - Sets results and calls httpSuccess ** failureResult - Sets results and calls httpFailure ** completedResult - Sets results and calls httpCompleted * To obtain information about a the response from a reponder method, use the following getters: ** getStatus - HTTP status code ** getReason - Reason string ** getContent - Content (Parsed body LLSD) ** getResponseHeaders - Response Headers (LLSD map) ** getHTTPMethod - HTTP method of the request ** getURL - URL of the request * It is still possible to override completeRaw if you want to manipulate data directly out of LLPumpIO. * See indra/llmessage/llcurl.h for more information. --- indra/llcommon/CMakeLists.txt | 1 - indra/llcommon/llhttpstatuscodes.h | 89 ------------------------------------ indra/llcommon/llsd.cpp | 11 +++-- indra/llcommon/llsd.h | 5 +- indra/llcommon/llsdserialize.cpp | 65 +++++++++++++++++++++----- indra/llcommon/llsdserialize.h | 28 +++++++++++- indra/llcommon/llsdserialize_xml.cpp | 15 +++--- 7 files changed, 97 insertions(+), 117 deletions(-) delete mode 100644 indra/llcommon/llhttpstatuscodes.h (limited to 'indra/llcommon') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 5cce8ff2c4..31fac7caab 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -176,7 +176,6 @@ set(llcommon_HEADER_FILES llhandle.h llhash.h llheartbeat.h - llhttpstatuscodes.h llindexedqueue.h llinitparam.h llinstancetracker.h diff --git a/indra/llcommon/llhttpstatuscodes.h b/indra/llcommon/llhttpstatuscodes.h deleted file mode 100644 index 0173461dad..0000000000 --- a/indra/llcommon/llhttpstatuscodes.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * @file llhttpstatuscodes.h - * @brief Constants for HTTP status codes - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_HTTP_STATUS_CODES_H -#define LL_HTTP_STATUS_CODES_H - -#include "stdtypes.h" - -// Standard errors from HTTP spec: -// http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 -const S32 HTTP_CONTINUE = 100; -const S32 HTTP_SWITCHING_PROTOCOLS = 101; - -// Success -const S32 HTTP_OK = 200; -const S32 HTTP_CREATED = 201; -const S32 HTTP_ACCEPTED = 202; -const S32 HTTP_NON_AUTHORITATIVE_INFORMATION = 203; -const S32 HTTP_NO_CONTENT = 204; -const S32 HTTP_RESET_CONTENT = 205; -const S32 HTTP_PARTIAL_CONTENT = 206; - -// Redirection -const S32 HTTP_MULTIPLE_CHOICES = 300; -const S32 HTTP_MOVED_PERMANENTLY = 301; -const S32 HTTP_FOUND = 302; -const S32 HTTP_SEE_OTHER = 303; -const S32 HTTP_NOT_MODIFIED = 304; -const S32 HTTP_USE_PROXY = 305; -const S32 HTTP_TEMPORARY_REDIRECT = 307; - -// Client Error -const S32 HTTP_BAD_REQUEST = 400; -const S32 HTTP_UNAUTHORIZED = 401; -const S32 HTTP_PAYMENT_REQUIRED = 402; -const S32 HTTP_FORBIDDEN = 403; -const S32 HTTP_NOT_FOUND = 404; -const S32 HTTP_METHOD_NOT_ALLOWED = 405; -const S32 HTTP_NOT_ACCEPTABLE = 406; -const S32 HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; -const S32 HTTP_REQUEST_TIME_OUT = 408; -const S32 HTTP_CONFLICT = 409; -const S32 HTTP_GONE = 410; -const S32 HTTP_LENGTH_REQUIRED = 411; -const S32 HTTP_PRECONDITION_FAILED = 412; -const S32 HTTP_REQUEST_ENTITY_TOO_LARGE = 413; -const S32 HTTP_REQUEST_URI_TOO_LARGE = 414; -const S32 HTTP_UNSUPPORTED_MEDIA_TYPE = 415; -const S32 HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; -const S32 HTTP_EXPECTATION_FAILED = 417; - -// Server Error -const S32 HTTP_INTERNAL_SERVER_ERROR = 500; -const S32 HTTP_NOT_IMPLEMENTED = 501; -const S32 HTTP_BAD_GATEWAY = 502; -const S32 HTTP_SERVICE_UNAVAILABLE = 503; -const S32 HTTP_GATEWAY_TIME_OUT = 504; -const S32 HTTP_VERSION_NOT_SUPPORTED = 505; - -// We combine internal process errors with status codes -// These status codes should not be sent over the wire -// and indicate something went wrong internally. -// If you get these they are not normal. -const S32 HTTP_INTERNAL_ERROR = 499; - -#endif diff --git a/indra/llcommon/llsd.cpp b/indra/llcommon/llsd.cpp index 8276ec836a..9e4b92227e 100644 --- a/indra/llcommon/llsd.cpp +++ b/indra/llcommon/llsd.cpp @@ -126,7 +126,9 @@ public: virtual UUID asUUID() const { return LLUUID(); } virtual Date asDate() const { return LLDate(); } virtual URI asURI() const { return LLURI(); } - virtual Binary asBinary() const { return std::vector(); } + virtual const Binary& asBinary() const { static const std::vector empty; return empty; } + + virtual const String& asStringRef() const { static const std::string empty; return empty; } virtual bool has(const String&) const { return false; } virtual LLSD get(const String&) const { return LLSD(); } @@ -270,6 +272,7 @@ namespace virtual LLSD::Date asDate() const { return LLDate(mValue); } virtual LLSD::URI asURI() const { return LLURI(mValue); } virtual int size() const { return mValue.size(); } + virtual const LLSD::String& asStringRef() const { return mValue; } }; LLSD::Integer ImplString::asInteger() const @@ -348,7 +351,7 @@ namespace public: ImplBinary(const LLSD::Binary& v) : Base(v) { } - virtual LLSD::Binary asBinary() const{ return mValue; } + virtual const LLSD::Binary& asBinary() const{ return mValue; } }; @@ -838,7 +841,9 @@ LLSD::String LLSD::asString() const { return safe(impl).asString(); } LLSD::UUID LLSD::asUUID() const { return safe(impl).asUUID(); } LLSD::Date LLSD::asDate() const { return safe(impl).asDate(); } LLSD::URI LLSD::asURI() const { return safe(impl).asURI(); } -LLSD::Binary LLSD::asBinary() const { return safe(impl).asBinary(); } +const LLSD::Binary& LLSD::asBinary() const { return safe(impl).asBinary(); } + +const LLSD::String& LLSD::asStringRef() const { return safe(impl).asStringRef(); } // const char * helpers LLSD::LLSD(const char* v) : impl(0) { ALLOC_LLSD_OBJECT; assign(v); } diff --git a/indra/llcommon/llsd.h b/indra/llcommon/llsd.h index 5eb69059ac..b9f490718c 100644 --- a/indra/llcommon/llsd.h +++ b/indra/llcommon/llsd.h @@ -249,7 +249,10 @@ public: UUID asUUID() const; Date asDate() const; URI asURI() const; - Binary asBinary() const; + const Binary& asBinary() const; + + // asStringRef on any non-string type will return a ref to an empty string. + const String& asStringRef() const; operator Boolean() const { return asBoolean(); } operator Integer() const { return asInteger(); } diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index ad4fce6f35..774d827762 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -873,7 +873,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const { /** * Undefined: '!'
- * Boolean: 't' for true 'f' for false
+ * Boolean: '1' for true '0' for false
* Integer: 'i' + 4 bytes network byte order
* Real: 'r' + 8 bytes IEEE double
* UUID: 'u' + 16 byte unsigned integer
@@ -1260,13 +1260,38 @@ std::string LLSDNotationFormatter::escapeString(const std::string& in) // virtual S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 options) const +{ + S32 rv = format_impl(data, ostr, options, 0); + return rv; +} + +S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 options, U32 level) const { S32 format_count = 1; + std::string pre; + std::string post; + + if (options & LLSDFormatter::OPTIONS_PRETTY) + { + for (U32 i = 0; i < level; i++) + { + pre += " "; + } + post = "\n"; + } + switch(data.type()) { case LLSD::TypeMap: { + if (0 != level) ostr << post << pre; ostr << "{"; + std::string inner_pre; + if (options & LLSDFormatter::OPTIONS_PRETTY) + { + inner_pre = pre + " "; + } + bool need_comma = false; LLSD::map_const_iterator iter = data.beginMap(); LLSD::map_const_iterator end = data.endMap(); @@ -1274,18 +1299,18 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti { if(need_comma) ostr << ","; need_comma = true; - ostr << '\''; + ostr << post << inner_pre << '\''; serialize_string((*iter).first, ostr); ostr << "':"; - format_count += format((*iter).second, ostr); + format_count += format_impl((*iter).second, ostr, options, level + 2); } - ostr << "}"; + ostr << post << pre << "}"; break; } case LLSD::TypeArray: { - ostr << "["; + ostr << post << pre << "["; bool need_comma = false; LLSD::array_const_iterator iter = data.beginArray(); LLSD::array_const_iterator end = data.endArray(); @@ -1293,7 +1318,7 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti { if(need_comma) ostr << ","; need_comma = true; - format_count += format(*iter, ostr); + format_count += format_impl(*iter, ostr, options, level + 1); } ostr << "]"; break; @@ -1343,7 +1368,7 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti case LLSD::TypeString: ostr << '\''; - serialize_string(data.asString(), ostr); + serialize_string(data.asStringRef(), ostr); ostr << '\''; break; @@ -1360,9 +1385,26 @@ S32 LLSDNotationFormatter::format(const LLSD& data, std::ostream& ostr, U32 opti case LLSD::TypeBinary: { // *FIX: memory inefficient. - std::vector buffer = data.asBinary(); + const std::vector& buffer = data.asBinary(); ostr << "b(" << buffer.size() << ")\""; - if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size()); + if(buffer.size()) + { + if (options & LLSDFormatter::OPTIONS_PRETTY_BINARY) + { + std::ios_base::fmtflags old_flags = ostr.flags(); + ostr.setf( std::ios::hex, std::ios::basefield ); + ostr << "0x"; + for (int i = 0; i < buffer.size(); i++) + { + ostr << (int) buffer[i]; + } + ostr.flags(old_flags); + } + else + { + ostr.write((const char*)&buffer[0], buffer.size()); + } + } ostr << "\""; break; } @@ -1460,7 +1502,7 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option case LLSD::TypeString: ostr.put('s'); - formatString(data.asString(), ostr); + formatString(data.asStringRef(), ostr); break; case LLSD::TypeDate: @@ -1478,9 +1520,8 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option case LLSD::TypeBinary: { - // *FIX: memory inefficient. ostr.put('b'); - std::vector buffer = data.asBinary(); + const std::vector& buffer = data.asBinary(); U32 size_nbo = htonl(buffer.size()); ostr.write((const char*)(&size_nbo), sizeof(U32)); if(buffer.size()) ostr.write((const char*)&buffer[0], buffer.size()); diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h index e7a5507385..23a0c8cfb1 100644 --- a/indra/llcommon/llsdserialize.h +++ b/indra/llcommon/llsdserialize.h @@ -416,7 +416,8 @@ public: typedef enum e_formatter_options_type { OPTIONS_NONE = 0, - OPTIONS_PRETTY = 1 + OPTIONS_PRETTY = 1, + OPTIONS_PRETTY_BINARY = 2 } EFormatterOptions; /** @@ -507,6 +508,17 @@ public: * @return Returns The number of LLSD objects fomatted out */ virtual S32 format(const LLSD& data, std::ostream& ostr, U32 options = LLSDFormatter::OPTIONS_NONE) const; + +protected: + + /** + * @brief Implementation to format the data. This is called recursively. + * + * @param data The data to write. + * @param ostr The destination stream for the data. + * @return Returns The number of LLSD objects fomatted out + */ + S32 format_impl(const LLSD& data, std::ostream& ostr, U32 options, U32 level) const; }; @@ -634,7 +646,7 @@ protected: * * * *NOTE - formerly this class inherited from its template parameter Formatter, - * but all insnatiations passed in LLRefCount subclasses. This conflicted with + * but all instantiations passed in LLRefCount subclasses. This conflicted with * the auto allocation intended for this class template (demonstrated in the * example above). -brad */ @@ -720,6 +732,18 @@ public: LLPointer f = new LLSDNotationFormatter; return f->format(sd, str, LLSDFormatter::OPTIONS_NONE); } + static S32 toPrettyNotation(const LLSD& sd, std::ostream& str) + { + LLPointer f = new LLSDNotationFormatter; + return f->format(sd, str, LLSDFormatter::OPTIONS_PRETTY); + } + static S32 toPrettyBinaryNotation(const LLSD& sd, std::ostream& str) + { + LLPointer f = new LLSDNotationFormatter; + return f->format(sd, str, + LLSDFormatter::OPTIONS_PRETTY | + LLSDFormatter::OPTIONS_PRETTY_BINARY); + } static S32 fromNotation(LLSD& sd, std::istream& str, S32 max_bytes) { LLPointer p = new LLSDNotationParser; diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp index cef743a7be..3ef7a7e4c1 100644 --- a/indra/llcommon/llsdserialize_xml.cpp +++ b/indra/llcommon/llsdserialize_xml.cpp @@ -168,8 +168,8 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti break; case LLSD::TypeString: - if(data.asString().empty()) ostr << pre << "" << post; - else ostr << pre << "" << escapeString(data.asString()) <<"" << post; + if(data.asStringRef().empty()) ostr << pre << "" << post; + else ostr << pre << "" << escapeString(data.asStringRef()) <<"" << post; break; case LLSD::TypeDate: @@ -182,7 +182,7 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti case LLSD::TypeBinary: { - LLSD::Binary buffer = data.asBinary(); + const LLSD::Binary& buffer = data.asBinary(); if(buffer.empty()) { ostr << pre << "" << post; @@ -375,13 +375,10 @@ S32 LLSDXMLParser::Impl::parse(std::istream& input, LLSD& data) { break; } + count = get_till_eol(input, (char *)buffer, BUFFER_SIZE); + if (!count) { - - count = get_till_eol(input, (char *)buffer, BUFFER_SIZE); - if (!count) - { - break; - } + break; } status = XML_ParseBuffer(mParser, count, false); -- cgit v1.3 From f7c9739fd9bb4355765ecff4b92e879b38302e49 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 5 Jun 2013 15:13:48 -0400 Subject: SH-3635 WIP - COF slammer works in AISv3 regions. Extensive rework of onAISUpdateReceived. --- indra/llcommon/llsdutil.cpp | 2 +- indra/llinventory/llinventory.cpp | 6 ++ indra/newview/llinventorymodel.cpp | 167 ++++++++++++++++++++++++++++++------ indra/newview/llinventorymodel.h | 2 +- indra/newview/llviewerinventory.cpp | 32 ++++++- 5 files changed, 179 insertions(+), 30 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 803417d368..562fd26658 100755 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -182,7 +182,7 @@ char* ll_pretty_print_sd_ptr(const LLSD* sd) char* ll_pretty_print_sd(const LLSD& sd) { - const U32 bufferSize = 10 * 1024; + const U32 bufferSize = 100 * 1024; static char buffer[bufferSize]; std::ostringstream stream; //stream.rdbuf()->pubsetbuf(buffer, bufferSize); diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index a529aa3af3..77b837f8ac 100755 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -50,6 +50,7 @@ static const std::string INV_DESC_LABEL("desc"); static const std::string INV_PERMISSIONS_LABEL("permissions"); static const std::string INV_SHADOW_ID_LABEL("shadow_id"); static const std::string INV_ASSET_ID_LABEL("asset_id"); +static const std::string INV_LINKED_ID_LABEL("linked_id"); static const std::string INV_SALE_INFO_LABEL("sale_info"); static const std::string INV_FLAGS_LABEL("flags"); static const std::string INV_CREATION_DATE_LABEL("created_at"); @@ -1109,6 +1110,11 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd) { mAssetUUID = sd[w]; } + w = INV_LINKED_ID_LABEL; + if (sd.has(w)) + { + mAssetUUID = sd[w]; + } w = INV_ASSET_TYPE_LABEL; if (sd.has(w)) { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 38fa3c36e3..1a5e76183c 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1172,77 +1172,188 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS { LL_DEBUGS("Inventory") << "ais update " << context << ":" << ll_pretty_print_sd(update) << llendl; + // Track changes to descendent counts for accounting. + std::map cat_deltas; + typedef std::map > deferred_item_map_t; + deferred_item_map_t items_created; + deferred_item_map_t items_updated; + std::set objects_deleted; + + // parse _categories_removed -> objects_deleted uuid_vec_t cat_ids; parse_llsd_uuid_array(update,"_categories_removed",cat_ids); for (uuid_vec_t::const_iterator it = cat_ids.begin(); it != cat_ids.end(); ++it) { - onObjectDeletedFromServer(*it, false); + LLViewerInventoryCategory *cat = getCategory(*it); + cat_deltas[cat->getParentUUID()]--; + objects_deleted.insert(*it); } + // parse _categories_items_removed -> objects_deleted uuid_vec_t item_ids; parse_llsd_uuid_array(update,"_category_items_removed",item_ids); for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it) { - onObjectDeletedFromServer(*it, false); + LLViewerInventoryItem *item = getItem(*it); + cat_deltas[item->getParentUUID()]--; + objects_deleted.insert(*it); } + // parse _broken_links_removed -> objects_deleted uuid_vec_t broken_link_ids; parse_llsd_uuid_array(update,"_broken_links_removed",broken_link_ids); for (uuid_vec_t::const_iterator it = broken_link_ids.begin(); it != broken_link_ids.end(); ++it) { - onObjectDeletedFromServer(*it, false); + LLViewerInventoryItem *item = getItem(*it); + cat_deltas[item->getParentUUID()]--; + objects_deleted.insert(*it); } - if (update.has("item_id")) + // parse _created_items + uuid_vec_t created_item_ids; + parse_llsd_uuid_array(update,"_created_items",created_item_ids); + + if (update.has("_embedded")) { - // item has been modified or possibly created (would be better if we could distinguish these cases directly) - LLUUID item_id = update["item_id"].asUUID(); - LLViewerInventoryItem *item = gInventory.getItem(item_id); - LLViewerInventoryCategory *cat = gInventory.getCategory(item_id); - if (item) + const LLSD& embedded = update["_embedded"]; + for(LLSD::map_const_iterator it = embedded.beginMap(), + end = embedded.endMap(); + it != end; ++it) { - LLSD changes; - if (update.has("name") && update["name"] != item->getName()) + const std::string& field = (*it).first; + + // parse created links + if (field == "link") { - changes["name"] = update["name"]; - } - if (update.has("desc") && update["desc"] != item->getActualDescription()) + const LLSD& links = embedded["link"]; + for(LLSD::map_const_iterator linkit = links.beginMap(), + linkend = links.endMap(); + linkit != linkend; ++linkit) + { + const LLUUID link_id((*linkit).first); + const LLSD& link_map = (*linkit).second; + uuid_vec_t::const_iterator pos = + std::find(created_item_ids.begin(), + created_item_ids.end(),link_id); + if (pos != created_item_ids.end()) + { + LLPointer new_link(new LLViewerInventoryItem); + BOOL rv = new_link->unpackMessage(link_map); + if (rv) + { + items_created[link_id] = new_link; + const LLUUID& parent_id = new_link->getParentUUID(); + cat_deltas[parent_id]++; + } + else + { + llwarns << "failed to unpack" << llendl; + } + } + else + { + LL_DEBUGS("Inventory") << "Ignoring link not in created items list " << link_id << llendl; + } + } + } + else { - changes["desc"] = update["desc"]; + llwarns << "unrecognized embedded field " << field << llendl; } - onItemUpdated(item_id,changes,true); } - else if (cat) + + } + + // Parse item update at the top level. + if (update.has("item_id")) + { + LLUUID item_id = update["item_id"].asUUID(); + LLPointer new_item(new LLViewerInventoryItem); + BOOL rv = new_item->unpackMessage(update); + if (rv) { - llerrs << "don't handle cat update yet" << llendl; + items_updated[item_id] = new_item; + // This statement is here to cause a new entry with 0 + // delta to be created if it does not already exist; + // otherwise has no effect. + cat_deltas[new_item->getParentUUID()]; } else { - llerrs << "don't handle creation case yet" << llendl; + llerrs << "unpack failed" << llendl; } - } + // Do descendent/version accounting. + // Can remove this if/when we use the version info directly. + for (std::map::const_iterator catit = cat_deltas.begin(); + catit != cat_deltas.end(); ++catit) + { + const LLUUID cat_id(catit->first); + S32 delta = catit->second; + LLInventoryModel::LLCategoryUpdate up(cat_id, delta); + gInventory.accountForUpdate(up); + } + // TODO - how can we use this version info? Need to be sure all // changes are going through AIS first, or at least through // something with a reliable responder. -#if 0 const std::string& ucv = "_updated_category_versions"; if (update.has(ucv)) { for(LLSD::map_const_iterator it = update[ucv].beginMap(), end = update[ucv].endMap(); - it != end; ++it) + it != end; ++it) { const LLUUID id((*it).first); S32 version = (*it).second.asInteger(); + LLViewerInventoryCategory *cat = gInventory.getCategory(id); + if (cat->getVersion() != version) + { + llwarns << "Possible version mismatch, viewer " << cat->getVersion() + << " server " << version << llendl; + } } } -#endif + + // CREATE ITEMS + for (deferred_item_map_t::const_iterator create_it = items_created.begin(); + create_it != items_created.end(); ++create_it) + { + LLUUID item_id(create_it->first); + LLPointer new_item = create_it->second; + + // FIXME risky function since it calls updateServer() in some + // cases. Maybe break out the update/create cases, in which + // case this is create. + LL_DEBUGS("Inventory") << "created item " << item_id << llendl; + gInventory.updateItem(new_item); + } + // UPDATE ITEMS + for (deferred_item_map_t::const_iterator update_it = items_updated.begin(); + update_it != items_updated.end(); ++update_it) + { + LLUUID item_id(update_it->first); + LLPointer new_item = update_it->second; + // FIXME risky function since it calls updateServer() in some + // cases. Maybe break out the update/create cases, in which + // case this is update. + LL_DEBUGS("Inventory") << "updated item " << item_id << llendl; + gInventory.updateItem(new_item); + } + + // DELETE OBJECTS + for (std::set::const_iterator del_it = objects_deleted.begin(); + del_it != objects_deleted.end(); ++del_it) + { + LL_DEBUGS("Inventory") << "deleted item " << *del_it << llendl; + onObjectDeletedFromServer(*del_it, false, false); + } + } void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, bool update_parent_version) @@ -1395,7 +1506,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo // Update model after an item is confirmed as removed from // server. Works for categories or items. -void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links) +void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool fix_broken_links, bool update_parent_version) { LLPointer obj = getObject(object_id); if(obj) @@ -1406,9 +1517,13 @@ void LLInventoryModel::onObjectDeletedFromServer(const LLUUID& object_id, bool f onDescendentsPurgedFromServer(object_id, fix_broken_links); } + // From item/cat removeFromServer() - LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); - accountForUpdate(up); + if (update_parent_version) + { + LLInventoryModel::LLCategoryUpdate up(obj->getParentUUID(), -1); + accountForUpdate(up); + } // From purgeObject() LLPreview::hide(object_id); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index fd2481b531..a41a824906 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -334,7 +334,7 @@ public: // Update model after an item is confirmed as removed from // server. Works for categories or items. - void onObjectDeletedFromServer(const LLUUID& item_id, bool fix_broken_links = true); + void onObjectDeletedFromServer(const LLUUID& item_id, bool fix_broken_links = true, bool update_parent_version = true); // Update model after all descendents removed from server. void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index db8671d51b..0608c46051 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -493,6 +493,34 @@ private: LLSD mUpdates; }; +class SlamFolderCommand: public AISCommand +{ +public: + SlamFolderCommand(const LLUUID& folder_id, const LLSD& contents, LLPointer callback): + mContents(contents), + AISCommand(callback) + { + std::string cap; + if (!getCap(cap)) + { + llwarns << "No cap found" << llendl; + return; + } + LLUUID tid; + tid.generate(); + std::string url = cap + std::string("/category/") + folder_id.asString() + "/links?tid=" + tid.asString(); + llinfos << url << llendl; + LLCurl::ResponderPtr responder = this; + LLSD headers; + headers["Content-Type"] = "application/llsd+xml"; + F32 timeout = HTTP_REQUEST_EXPIRY_SECS; + command_func_type cmd = boost::bind(&LLHTTPClient::put, url, mContents, responder, headers, timeout); + setCommandFunc(cmd); + } +private: + LLSD mContents; +}; + ///---------------------------------------------------------------------------- /// Class LLViewerInventoryItem ///---------------------------------------------------------------------------- @@ -1835,8 +1863,8 @@ void slam_inventory_folder(const LLUUID& folder_id, std::string cap; if (AISCommand::getCap(cap)) { - //LLPointer cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); - //cmd_ptr->run_command(); + LLPointer cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); + cmd_ptr->run_command(); } else // no cap { -- cgit v1.3 From 3ed3b88892adb4234c375d2d6bd5f0d2da5566c7 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 9 Aug 2013 13:36:36 -0700 Subject: Refactoring link creation calls in preparation for adding AIS v3 hook. --- indra/llcommon/llpointer.h | 126 +++++++++++++++++++ indra/llinventory/llinventory.h | 1 + indra/newview/llagentwearables.cpp | 8 +- indra/newview/llagentwearablesfetch.cpp | 15 +-- indra/newview/llappearancemgr.cpp | 103 ++++------------ indra/newview/llappearancemgr.h | 13 +- indra/newview/llinventorybridge.cpp | 32 +---- indra/newview/llpaneleditwearable.cpp | 15 +-- indra/newview/llviewerinventory.cpp | 212 ++++++++++++++++++++++---------- indra/newview/llviewerinventory.h | 27 ++-- 10 files changed, 336 insertions(+), 216 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index 88c09c8dca..dd43e3aaa2 100755 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -171,4 +171,130 @@ protected: Type* mPointer; }; +template class LLConstPointer +{ +public: + LLConstPointer() : + mPointer(NULL) + { + } + + LLConstPointer(const Type* ptr) : + mPointer(ptr) + { + ref(); + } + + LLConstPointer(const LLConstPointer& ptr) : + mPointer(ptr.mPointer) + { + ref(); + } + + // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template + LLConstPointer(const LLConstPointer& ptr) : + mPointer(ptr.get()) + { + ref(); + } + + ~LLConstPointer() + { + unref(); + } + + const Type* get() const { return mPointer; } + const Type* operator->() const { return mPointer; } + const Type& operator*() const { return *mPointer; } + + operator BOOL() const { return (mPointer != NULL); } + operator bool() const { return (mPointer != NULL); } + bool operator!() const { return (mPointer == NULL); } + bool isNull() const { return (mPointer == NULL); } + bool notNull() const { return (mPointer != NULL); } + + operator const Type*() const { return mPointer; } + bool operator !=(const Type* ptr) const { return (mPointer != ptr); } + bool operator ==(const Type* ptr) const { return (mPointer == ptr); } + bool operator ==(const LLConstPointer& ptr) const { return (mPointer == ptr.mPointer); } + bool operator < (const LLConstPointer& ptr) const { return (mPointer < ptr.mPointer); } + bool operator > (const LLConstPointer& ptr) const { return (mPointer > ptr.mPointer); } + + LLConstPointer& operator =(const Type* ptr) + { + if( mPointer != ptr ) + { + unref(); + mPointer = ptr; + ref(); + } + + return *this; + } + + LLConstPointer& operator =(const LLConstPointer& ptr) + { + if( mPointer != ptr.mPointer ) + { + unref(); + mPointer = ptr.mPointer; + ref(); + } + return *this; + } + + // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template + LLConstPointer& operator =(const LLConstPointer& ptr) + { + if( mPointer != ptr.get() ) + { + unref(); + mPointer = ptr.get(); + ref(); + } + return *this; + } + + // Just exchange the pointers, which will not change the reference counts. + static void swap(LLConstPointer& a, LLConstPointer& b) + { + const Type* temp = a.mPointer; + a.mPointer = b.mPointer; + b.mPointer = temp; + } + +protected: +#ifdef LL_LIBRARY_INCLUDE + void ref(); + void unref(); +#else + void ref() + { + if (mPointer) + { + mPointer->ref(); + } + } + + void unref() + { + if (mPointer) + { + const Type *tempp = mPointer; + mPointer = NULL; + tempp->unref(); + if (mPointer != NULL) + { + llwarns << "Unreference did assignment to non-NULL because of destructor" << llendl; + unref(); + } + } + } +#endif +protected: + const Type* mPointer; +}; + #endif diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index b718f0f9b7..dd504fb155 100755 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -48,6 +48,7 @@ class LLInventoryObject : public LLRefCount { public: typedef std::list > object_list_t; + typedef std::list > const_object_list_t; //-------------------------------------------------------------------- // Initialization diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 8c33a778e3..f3c9998a7d 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -952,15 +952,15 @@ public: /* virtual */ void fire(const LLUUID& inv_item) { llinfos << "One item created " << inv_item.asString() << llendl; - LLViewerInventoryItem *item = gInventory.getItem(inv_item); - mItemsToLink.put(item); + LLConstPointer item = gInventory.getItem(inv_item); + mItemsToLink.push_back(item); updatePendingWearable(inv_item); } ~OnWearableItemCreatedCB() { llinfos << "All items created" << llendl; LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; - LLAppearanceMgr::instance().linkAll(LLAppearanceMgr::instance().getCOF(), + link_inventory_array(LLAppearanceMgr::instance().getCOF(), mItemsToLink, link_waiter); } @@ -1011,7 +1011,7 @@ public: } private: - LLInventoryModel::item_array_t mItemsToLink; + LLInventoryObject::const_object_list_t mItemsToLink; std::vector mWearablesAwaitingItems; }; diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 014c610a5c..a2a667e660 100755 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -117,26 +117,21 @@ public: // Link to all fetched items in COF. LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; + LLInventoryObject::const_object_list_t item_array; for (uuid_vec_t::iterator it = mIDs.begin(); it != mIDs.end(); ++it) { LLUUID id = *it; - LLViewerInventoryItem *item = gInventory.getItem(*it); + LLConstPointer item = gInventory.getItem(*it); if (!item) { - llwarns << "fetch failed!" << llendl; + llwarns << "fetch failed for item " << (*it) << "!" << llendl; continue; } - - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - LLAppearanceMgr::instance().getCOF(), - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK, - link_waiter); + item_array.push_back(item); } + link_inventory_array(LLAppearanceMgr::instance().getCOF(), item_array, link_waiter); } }; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 3818bd8aec..c4bc6f648f 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -909,20 +909,15 @@ void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLView } LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << type << LL_ENDL; - LLViewerInventoryItem *itemp = gInventory.getItem(item_id); + LLConstPointer itemp = gInventory.getItem(item_id); wearable->setItemID(item_id); - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_link_cb,_1,type,wearable,holder)); holder->eraseTypeToRecover(type); llassert(itemp); if (itemp) { - link_inventory_item( gAgent.getID(), - item_id, - LLAppearanceMgr::instance().getCOF(), - itemp->getName(), - itemp->getDescription(), - LLAssetType::AT_LINK, - cb); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(recovered_item_link_cb,_1,type,wearable,holder)); + + link_inventory_object(LLAppearanceMgr::instance().getCOF(), itemp, cb); } } @@ -1551,6 +1546,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL LLInventoryModel::item_array_t* items; gInventory.getDirectDescendentsOf(src_id, cats, items); llinfos << "copying " << items->count() << " items" << llendl; + LLInventoryObject::const_object_list_t link_array; for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); iter != items->end(); ++iter) @@ -1561,14 +1557,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL case LLAssetType::AT_LINK: { LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; - //getActualDescription() is used for a new description - //to propagate ordering information saved in descriptions of links - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - dst_id, - item->getName(), - item->getActualDescription(), - LLAssetType::AT_LINK, cb); + link_array.push_back(LLConstPointer(item)); break; } case LLAssetType::AT_LINK_FOLDER: @@ -1578,12 +1567,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL if (catp && catp->getPreferredType() != LLFolderType::FT_OUTFIT) { LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - dst_id, - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK_FOLDER, cb); + link_array.push_back(LLConstPointer(item)); } break; } @@ -1606,6 +1590,11 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL break; } } + if (!link_array.empty()) + { + const bool resolve_links = true; + link_inventory_array(dst_id, link_array, cb, resolve_links); + } } BOOL LLAppearanceMgr::getCanMakeFolderIntoOutfit(const LLUUID& folder_id) @@ -1753,42 +1742,6 @@ void LLAppearanceMgr::filterWearableItems( } } -// Create links to all listed items. -void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, - LLInventoryModel::item_array_t& items, - LLPointer cb) -{ - for (S32 i=0; igetLinkedUUID(), - cat_uuid, - item->getName(), - item->getActualDescription(), - LLAssetType::AT_LINK, - cb); - - const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid); - const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; -#ifndef LL_RELEASE_FOR_DOWNLOAD - LL_DEBUGS("Avatar") << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << LL_ENDL; -#endif - } -} - -void LLAppearanceMgr::removeAll(LLInventoryModel::item_array_t& items_to_kill, - LLPointer cb) -{ - for (LLInventoryModel::item_array_t::iterator it = items_to_kill.begin(); - it != items_to_kill.end(); - ++it) - { - LLViewerInventoryItem *item = *it; - remove_inventory_item(item->getUUID(), cb); - } -} - void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); @@ -1934,8 +1887,7 @@ void LLAppearanceMgr::createBaseOutfitLink(const LLUUID& category, LLPointergetPreferredType() == LLFolderType::FT_OUTFIT) { - link_inventory_item(gAgent.getID(), category, cof, catp->getName(), "", - LLAssetType::AT_LINK_FOLDER, link_waiter); + link_inventory_object(cof, catp, link_waiter); new_outfit_name = catp->getName(); } @@ -2027,7 +1979,7 @@ void item_array_diff(LLInventoryModel::item_array_t& full_list, S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, LLAssetType::EType type, S32 max_items, - LLInventoryModel::item_array_t& items_to_kill) + LLInventoryObject::object_list_t& items_to_kill) { S32 to_kill_count = 0; @@ -2045,7 +1997,7 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, it != kill_items.end(); ++it) { - items_to_kill.push_back(*it); + items_to_kill.push_back(LLPointer(*it)); to_kill_count++; } return to_kill_count; @@ -2053,7 +2005,7 @@ S32 LLAppearanceMgr::findExcessOrDuplicateItems(const LLUUID& cat_id, void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id, - LLInventoryModel::item_array_t& items_to_kill) + LLInventoryObject::object_list_t& items_to_kill) { findExcessOrDuplicateItems(cat_id,LLAssetType::AT_BODYPART, 1, items_to_kill); @@ -2065,14 +2017,13 @@ void LLAppearanceMgr::findAllExcessOrDuplicateItems(const LLUUID& cat_id, void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer cb) { - LLInventoryModel::item_array_t items_to_kill; + LLInventoryObject::object_list_t items_to_kill; findAllExcessOrDuplicateItems(getCOF(), items_to_kill); if (items_to_kill.size()>0) { // Remove duplicate or excess wearables. Should normally be enforced at the UI level, but // this should catch anything that gets through. - removeAll(items_to_kill, cb); - return; + remove_inventory_items(items_to_kill, cb); } } @@ -2525,7 +2476,7 @@ void LLAppearanceMgr::addCOFItemLink(const LLUUID &item_id, void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, LLPointer cb, const std::string description) -{ +{ const LLViewerInventoryItem *vitem = dynamic_cast(item); if (!vitem) { @@ -2577,18 +2528,10 @@ void LLAppearanceMgr::addCOFItemLink(const LLInventoryItem *item, if (!linked_already) { - std::string link_description = description; - if (vitem->getIsLinkType()) - { - link_description = vitem->getActualDescription(); - } - link_inventory_item( gAgent.getID(), - vitem->getLinkedUUID(), - getCOF(), - vitem->getName(), - link_description, - LLAssetType::AT_LINK, - cb); + LLInventoryObject::const_object_list_t obj_array; + obj_array.push_back(LLConstPointer(vitem)); + const bool resolve_links = true; + link_inventory_array(getCOF(), obj_array, cb, resolve_links); } } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 8c8b5e2489..346577ab9a 100755 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -67,9 +67,9 @@ public: S32 findExcessOrDuplicateItems(const LLUUID& cat_id, LLAssetType::EType type, S32 max_items, - LLInventoryModel::item_array_t& items_to_kill); + LLInventoryObject::object_list_t& items_to_kill); void findAllExcessOrDuplicateItems(const LLUUID& cat_id, - LLInventoryModel::item_array_t& items_to_kill); + LLInventoryObject::object_list_t& items_to_kill); void enforceCOFItemRestrictions(LLPointer cb); S32 getActiveCopyOperations() const; @@ -139,15 +139,6 @@ public: void registerAttachment(const LLUUID& item_id); void setAttachmentInvLinkEnable(bool val); - // utility function for bulk linking. - void linkAll(const LLUUID& category, - LLInventoryModel::item_array_t& items, - LLPointer cb); - - // And bulk removal. - void removeAll(LLInventoryModel::item_array_t& items, - LLPointer cb); - // Add COF link to individual item. void addCOFItemLink(const LLUUID& item_id, LLPointer cb = NULL, const std::string description = ""); void addCOFItemLink(const LLInventoryItem *item, LLPointer cb = NULL, const std::string description = ""); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index cb3f40a5bb..0481bf5f45 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3223,28 +3223,9 @@ void LLFolderBridge::pasteLinkFromClipboard() dropToOutfit(item, move_is_into_current_outfit); } } - else if (LLInventoryCategory *cat = model->getCategory(object_id)) + else if (LLConstPointer obj = model->getObject(object_id)) { - const std::string empty_description = ""; - link_inventory_item( - gAgent.getID(), - cat->getUUID(), - parent_id, - cat->getName(), - empty_description, - LLAssetType::AT_LINK_FOLDER, - LLPointer(NULL)); - } - else if (LLInventoryItem *item = model->getItem(object_id)) - { - link_inventory_item( - gAgent.getID(), - item->getLinkedUUID(), - parent_id, - item->getName(), - item->getDescription(), - LLAssetType::AT_LINK, - LLPointer(NULL)); + link_inventory_object(parent_id, obj, LLPointer(NULL)); } } // Change mode to paste for next paste @@ -3830,14 +3811,7 @@ void LLFolderBridge::dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_c else { LLPointer cb = NULL; - link_inventory_item( - gAgent.getID(), - inv_item->getLinkedUUID(), - mUUID, - inv_item->getName(), - inv_item->getDescription(), - LLAssetType::AT_LINK, - cb); + link_inventory_object(mUUID, LLConstPointer(inv_item), cb); } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index a1222424ee..0532370ff2 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1095,13 +1095,14 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) LL_DEBUGS("Avatar") << "link refresh, creating new link to " << link_item->getLinkedUUID() << " removing old link at " << link_item->getUUID() << " wearable item id " << mWearablePtr->getItemID() << llendl; - link_inventory_item( gAgent.getID(), - link_item->getLinkedUUID(), - LLAppearanceMgr::instance().getCOF(), - link_item->getName(), - description, - LLAssetType::AT_LINK, - gAgentAvatarp->mEndCustomizeCallback); + + LLInventoryObject::const_object_list_t obj_array; + obj_array.push_back(LLConstPointer(link_item)); + const bool resolve_links = true; + link_inventory_array(LLAppearanceMgr::instance().getCOF(), + obj_array, + gAgentAvatarp->mEndCustomizeCallback, + resolve_links); // Remove old link remove_inventory_item(link_item->getUUID(), gAgentAvatarp->mEndCustomizeCallback); } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index bff6767617..33186a5a88 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1074,77 +1074,133 @@ void copy_inventory_item( gAgent.sendReliableMessage(); } -void link_inventory_item( - const LLUUID& agent_id, - const LLUUID& item_id, - const LLUUID& parent_id, - const std::string& new_name, - const std::string& new_description, - const LLAssetType::EType asset_type, - LLPointer cb) +// Create link to single inventory object. +void link_inventory_object(const LLUUID& category, + LLConstPointer baseobj, + LLPointer cb) { - const LLInventoryObject *baseobj = gInventory.getObject(item_id); if (!baseobj) { - llwarns << "attempt to link to unknown item, linked-to-item's itemID " << item_id << llendl; - return; - } - if (baseobj && baseobj->getIsLinkType()) - { - llwarns << "attempt to create a link to a link, linked-to-item's itemID " << item_id << llendl; + llwarns << "Attempt to link to non-existent object" << llendl; return; } - if (baseobj && !LLAssetType::lookupCanLink(baseobj->getType())) - { - // Fail if item can be found but is of a type that can't be linked. - // Arguably should fail if the item can't be found too, but that could - // be a larger behavioral change. - llwarns << "attempt to link an unlinkable item, type = " << baseobj->getActualType() << llendl; - return; - } - - LLUUID transaction_id; - LLInventoryType::EType inv_type = LLInventoryType::IT_NONE; - if (dynamic_cast(baseobj)) - { - inv_type = LLInventoryType::IT_CATEGORY; - } - else + LLInventoryObject::const_object_list_t obj_array; + obj_array.push_back(baseobj); + link_inventory_array(category, obj_array, cb); +} + +void link_inventory_object(const LLUUID& category, + const LLUUID& id, + LLPointer cb) +{ + LLConstPointer baseobj = gInventory.getObject(id); + link_inventory_object(category, baseobj, cb); +} + +// Create links to all listed inventory objects. +void link_inventory_array(const LLUUID& category, + LLInventoryObject::const_object_list_t& baseobj_array, + LLPointer cb, + bool resolve_links /* = false */) +{ +#ifndef LL_RELEASE_FOR_DOWNLOAD + const LLViewerInventoryCategory *cat = gInventory.getCategory(category); + const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; +#endif + LLInventoryObject::const_object_list_t::const_iterator it = baseobj_array.begin(); + LLInventoryObject::const_object_list_t::const_iterator end = baseobj_array.end(); + for (; it != end; ++it) { - const LLViewerInventoryItem *baseitem = dynamic_cast(baseobj); - if (baseitem) + const LLInventoryObject* baseobj = *it; + if (!baseobj) { - inv_type = baseitem->getInventoryType(); + llwarns << "attempt to link to unknown object" << llendl; + continue; + } + if (!resolve_links && baseobj->getIsLinkType()) + { + llwarns << "attempt to create a link to a link, linked-to-object's ID " << baseobj->getUUID() << llendl; + continue; } - } -#if 1 // debugging stuff - LLViewerInventoryCategory* cat = gInventory.getCategory(parent_id); - lldebugs << "cat: " << cat << llendl; - + if (!LLAssetType::lookupCanLink(baseobj->getType())) + { + // Fail if item can be found but is of a type that can't be linked. + // Arguably should fail if the item can't be found too, but that could + // be a larger behavioral change. + llwarns << "attempt to link an unlinkable object, type = " << baseobj->getActualType() << llendl; + continue; + } + + LLUUID transaction_id; + LLInventoryType::EType inv_type = LLInventoryType::IT_NONE; + LLAssetType::EType asset_type = LLAssetType::AT_NONE; + std::string new_desc; + LLUUID linkee_id; + if (dynamic_cast(baseobj)) + { + inv_type = LLInventoryType::IT_CATEGORY; + asset_type = LLAssetType::AT_LINK_FOLDER; + linkee_id = baseobj->getUUID(); + } + else + { + const LLViewerInventoryItem *baseitem = dynamic_cast(baseobj); + if (baseitem) + { + inv_type = baseitem->getInventoryType(); + new_desc = baseitem->getActualDescription(); + switch (baseitem->getActualType()) + { + case LLAssetType::AT_LINK: + case LLAssetType::AT_LINK_FOLDER: + linkee_id = baseobj->getLinkedUUID(); + asset_type = baseitem->getActualType(); + break; + default: + linkee_id = baseobj->getUUID(); + asset_type = LLAssetType::AT_LINK; + break; + } + } + else + { + llwarns << "could not convert object into an item or category: " << baseobj->getUUID() << llendl; + continue; + } + } + + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_LinkInventoryItem); + msg->nextBlock(_PREHASH_AgentData); + { + msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + } + msg->nextBlock(_PREHASH_InventoryBlock); + { + msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); + msg->addUUIDFast(_PREHASH_FolderID, category); + msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); + msg->addUUIDFast(_PREHASH_OldItemID, linkee_id); + msg->addS8Fast(_PREHASH_Type, (S8)asset_type); + msg->addS8Fast(_PREHASH_InvType, (S8)inv_type); + msg->addStringFast(_PREHASH_Name, baseobj->getName()); + msg->addStringFast(_PREHASH_Description, new_desc); + } + gAgent.sendReliableMessage(); +#ifndef LL_RELEASE_FOR_DOWNLOAD + LL_DEBUGS("Inventory") << "Linking Object [ name:" << baseobj->getName() + << " UUID:" << baseobj->getUUID() + << " ] into Category [ name:" << cat_name + << " UUID:" << category << " ] " << LL_ENDL; #endif - LLMessageSystem* msg = gMessageSystem; - msg->newMessageFast(_PREHASH_LinkInventoryItem); - msg->nextBlock(_PREHASH_AgentData); - { - msg->addUUIDFast(_PREHASH_AgentID, agent_id); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); } - msg->nextBlock(_PREHASH_InventoryBlock); - { - msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb)); - msg->addUUIDFast(_PREHASH_FolderID, parent_id); - msg->addUUIDFast(_PREHASH_TransactionID, transaction_id); - msg->addUUIDFast(_PREHASH_OldItemID, item_id); - msg->addS8Fast(_PREHASH_Type, (S8)asset_type); - msg->addS8Fast(_PREHASH_InvType, (S8)inv_type); - msg->addStringFast(_PREHASH_Name, new_name); - msg->addStringFast(_PREHASH_Description, new_description); - } - gAgent.sendReliableMessage(); } + + void move_inventory_item( const LLUUID& agent_id, const LLUUID& session_id, @@ -1301,14 +1357,41 @@ void update_inventory_category( } } +void remove_inventory_items( + LLInventoryObject::object_list_t& items_to_kill, + LLPointer cb) +{ + for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin(); + it != items_to_kill.end(); + ++it) + { + remove_inventory_item(*it, cb); + } +} + void remove_inventory_item( const LLUUID& item_id, LLPointer cb) { - LLPointer obj = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + LLPointer obj = gInventory.getItem(item_id); + if (obj) + { + remove_inventory_item(obj, cb); + } + else + { + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << "(NOT FOUND)" << llendl; + } +} + +void remove_inventory_item( + LLPointer obj, + LLPointer cb) +{ if(obj) { + const LLUUID item_id(obj->getUUID()); + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << obj->getName() << llendl; if (AISCommand::isAPIAvailable()) { LLPointer cmd_ptr = new RemoveItemCommand(item_id, cb); @@ -1336,7 +1419,8 @@ void remove_inventory_item( } else { - llwarns << "remove_inventory_item called for invalid or nonexistent item " << item_id << llendl; + // *TODO: Clean up callback? + llwarns << "remove_inventory_item called for invalid or nonexistent item." << llendl; } } @@ -1632,13 +1716,7 @@ void slam_inventory_folder(const LLUUID& folder_id, ++it) { const LLSD& item_contents = *it; - link_inventory_item(gAgent.getID(), - item_contents["linked_id"].asUUID(), - folder_id, - item_contents["name"].asString(), - item_contents["desc"].asString(), - LLAssetType::EType(item_contents["type"].asInteger()), - cb); + link_inventory_object(folder_id, item_contents["linked_id"].asUUID(), cb); } remove_folder_contents(folder_id,false,cb); } diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 6bc6343f3f..cc715ae21d 100755 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -351,14 +351,17 @@ void copy_inventory_item( const std::string& new_name, LLPointer cb); -void link_inventory_item( - const LLUUID& agent_id, - const LLUUID& item_id, - const LLUUID& parent_id, - const std::string& new_name, - const std::string& new_description, - const LLAssetType::EType asset_type, - LLPointer cb); +// utility functions for inventory linking. +void link_inventory_object(const LLUUID& category, + LLConstPointer baseobj, + LLPointer cb); +void link_inventory_object(const LLUUID& category, + const LLUUID& id, + LLPointer cb); +void link_inventory_array(const LLUUID& category, + LLInventoryObject::const_object_list_t& baseobj_array, + LLPointer cb, + bool resolve_links = false); void move_inventory_item( const LLUUID& agent_id, @@ -382,6 +385,14 @@ void update_inventory_category( const LLSD& updates, LLPointer cb); +void remove_inventory_items( + LLInventoryObject::object_list_t& items, + LLPointer cb); + +void remove_inventory_item( + LLPointer obj, + LLPointer cb); + void remove_inventory_item( const LLUUID& item_id, LLPointer cb); -- cgit v1.3 From e26268add0d10cb7609afd9070f00d0331b78c4e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Nov 2013 11:02:51 -0400 Subject: SH-4595 WIP - reworked descendents of LLInventoryAddedObserver to use gInventory.getAddedIDs(). LLInventoryAddedObserver isn't really needed anymore, but leaving it in as a debugging point at least for now. --- indra/llcommon/lluuid.h | 13 ++++++++----- indra/newview/llinventorymodel.cpp | 18 ++++++++++++------ indra/newview/llinventorymodel.h | 5 ++++- indra/newview/llinventoryobserver.cpp | 33 +++------------------------------ indra/newview/llinventoryobserver.h | 4 +--- indra/newview/lllocationinputctrl.cpp | 6 ++---- indra/newview/llpanelplaces.cpp | 7 +++---- indra/newview/llpanelplaces.h | 2 +- indra/newview/llviewermessage.cpp | 20 ++++++++++++++------ 9 files changed, 48 insertions(+), 60 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 7889828c85..82afc7225f 100755 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -131,10 +131,14 @@ public: }; typedef std::vector uuid_vec_t; - - -// Helper structure for ordering lluuids in stl containers. -// eg: std::map widget_map; +typedef std::set uuid_set_t; + +// Helper structure for ordering lluuids in stl containers. eg: +// std::map widget_map; +// +// (isn't this the default behavior anyway? I think we could +// everywhere replace these with uuid_set_t, but someone should +// verify.) struct lluuid_less { bool operator()(const LLUUID& lhs, const LLUUID& rhs) const @@ -144,7 +148,6 @@ struct lluuid_less }; typedef std::set uuid_list_t; - /* * Sub-classes for keeping transaction IDs and asset IDs * straight. diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index be1a396fff..e9bbf3a7cd 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1454,6 +1454,7 @@ void LLInventoryModel::notifyObservers() mModifyMask = LLInventoryObserver::NONE; mChangedItemIDs.clear(); + mAddedItemIDs.clear(); mIsNotifyObservers = FALSE; } @@ -1473,13 +1474,18 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) if (referent.notNull()) { mChangedItemIDs.insert(referent); - } + + if (mask & LLInventoryObserver::ADD) + { + mAddedItemIDs.insert(referent); + } - // Update all linked items. Starting with just LABEL because I'm - // not sure what else might need to be accounted for this. - if (mModifyMask & LLInventoryObserver::LABEL) - { - addChangedMaskForLinks(referent, LLInventoryObserver::LABEL); + // Update all linked items. Starting with just LABEL because I'm + // not sure what else might need to be accounted for this. + if (mask & LLInventoryObserver::LABEL) + { + addChangedMaskForLinks(referent, LLInventoryObserver::LABEL); + } } } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 7afe1dea35..339740870d 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -73,7 +73,6 @@ public: typedef LLDynamicArray > cat_array_t; typedef LLDynamicArray > item_array_t; - typedef std::set changed_items_t; class fetchInventoryResponder : public LLHTTPClient::Responder { @@ -472,7 +471,9 @@ public: // been changed 'under the hood', but outside the control of the // inventory. The next notify will include that notification. void addChangedMask(U32 mask, const LLUUID& referent); + typedef uuid_set_t changed_items_t; const changed_items_t& getChangedIDs() const { return mChangedItemIDs; } + const changed_items_t& getAddedIDs() const { return mAddedItemIDs; } protected: // Updates all linked items pointing to this id. void addChangedMaskForLinks(const LLUUID& object_id, U32 mask); @@ -483,6 +484,8 @@ private: // Variables used to track what has changed since the last notify. U32 mModifyMask; changed_items_t mChangedItemIDs; + changed_items_t mAddedItemIDs; + //-------------------------------------------------------------------- // Observers diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 6042ab996d..6181474e5b 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -541,34 +541,7 @@ void LLInventoryAddedObserver::changed(U32 mask) return; } - // *HACK: If this was in response to a packet off - // the network, figure out which item was updated. - LLMessageSystem* msg = gMessageSystem; - - std::string msg_name = msg->getMessageName(); - if (msg_name.empty()) - { - return; - } - - // We only want newly created inventory items. JC - if ( msg_name != "UpdateCreateInventoryItem") - { - return; - } - - LLPointer titem = new LLViewerInventoryItem; - S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData); - for (S32 i = 0; i < num_blocks; ++i) - { - titem->unpackMessage(msg, _PREHASH_InventoryData, i); - if (!(titem->getUUID().isNull())) - { - //we don't do anything with null keys - mAdded.push_back(titem->getUUID()); - } - } - if (!mAdded.empty()) + if (!gInventory.getAddedIDs().empty()) { done(); } @@ -581,9 +554,9 @@ void LLInventoryCategoryAddedObserver::changed(U32 mask) return; } - const LLInventoryModel::changed_items_t& changed_ids = gInventory.getChangedIDs(); + const LLInventoryModel::changed_items_t& added_ids = gInventory.getAddedIDs(); - for (LLInventoryModel::changed_items_t::const_iterator cit = changed_ids.begin(); cit != changed_ids.end(); ++cit) + for (LLInventoryModel::changed_items_t::const_iterator cit = added_ids.begin(); cit != added_ids.end(); ++cit) { LLViewerInventoryCategory* cat = gInventory.getCategory(*cit); diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 73288242eb..c3cd0d761e 100755 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -190,13 +190,11 @@ private: class LLInventoryAddedObserver : public LLInventoryObserver { public: - LLInventoryAddedObserver() : mAdded() {} + LLInventoryAddedObserver() {} /*virtual*/ void changed(U32 mask); protected: virtual void done() = 0; - - uuid_vec_t mAdded; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 5022dba934..0d5ecc4059 100755 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -107,8 +107,8 @@ public: private: /*virtual*/ void done() { - uuid_vec_t::const_iterator it = mAdded.begin(), end = mAdded.end(); - for(; it != end; ++it) + const uuid_set_t& added = gInventory.getAddedIDs(); + for (uuid_set_t::const_iterator it = added.begin(); it != added.end(); ++it) { LLInventoryItem* item = gInventory.getItem(*it); if (!item || item->getType() != LLAssetType::AT_LANDMARK) @@ -124,8 +124,6 @@ private: mInput->onLandmarkLoaded(lm); } } - - mAdded.clear(); } LLLocationInputCtrl* mInput; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 730df2ea23..8cd54204e8 100755 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -168,8 +168,7 @@ public: protected: /*virtual*/ void done() { - mPlaces->showAddedLandmarkInfo(mAdded); - mAdded.clear(); + mPlaces->showAddedLandmarkInfo(gInventory.getAddedIDs()); } private: @@ -1100,9 +1099,9 @@ void LLPanelPlaces::changedGlobalPos(const LLVector3d &global_pos) updateVerbs(); } -void LLPanelPlaces::showAddedLandmarkInfo(const uuid_vec_t& items) +void LLPanelPlaces::showAddedLandmarkInfo(const uuid_set_t& items) { - for (uuid_vec_t::const_iterator item_iter = items.begin(); + for (uuid_set_t::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter) { diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 85bdc2c4e1..b3bc248bd9 100755 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -69,7 +69,7 @@ public: void changedGlobalPos(const LLVector3d &global_pos); // Opens landmark info panel when agent creates or receives landmark. - void showAddedLandmarkInfo(const uuid_vec_t& items); + void showAddedLandmarkInfo(const uuid_set_t& items); void setItem(LLInventoryItem* item); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 167c33f3ff..64cbc82578 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1001,7 +1001,12 @@ class LLOpenTaskOffer : public LLInventoryAddedObserver protected: /*virtual*/ void done() { - for (uuid_vec_t::iterator it = mAdded.begin(); it != mAdded.end();) + uuid_vec_t added; + for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it) + { + added.push_back(*it); + } + for (uuid_vec_t::iterator it = added.begin(); it != added.end();) { const LLUUID& item_uuid = *it; bool was_moved = false; @@ -1023,13 +1028,12 @@ protected: if (was_moved) { - it = mAdded.erase(it); + it = added.erase(it); } else ++it; } - open_inventory_offer(mAdded, ""); - mAdded.clear(); + open_inventory_offer(added, ""); } }; @@ -1038,8 +1042,12 @@ class LLOpenTaskGroupOffer : public LLInventoryAddedObserver protected: /*virtual*/ void done() { - open_inventory_offer(mAdded, "group_offer"); - mAdded.clear(); + uuid_vec_t added; + for(uuid_set_t::const_iterator it = gInventory.getAddedIDs().begin(); it != gInventory.getAddedIDs().end(); ++it) + { + added.push_back(*it); + } + open_inventory_offer(added, "group_offer"); gInventory.removeObserver(this); delete this; } -- cgit v1.3 From 487ca1bad37883be0325b564ab557a8f77575388 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 May 2014 17:50:59 -0400 Subject: v-r -> s-e merge WIP --- indra/llappearance/lltexlayer.cpp | 2 +- indra/llcommon/llpointer.h | 126 +++++++++++++++++++ indra/llcommon/tests/stringize_test.cpp | 2 +- indra/llinventory/llinventory.h | 1 + indra/llmessage/llcurl.cpp | 8 +- indra/llmessage/lliohttpserver.cpp | 2 +- indra/llmessage/llsdappservices.cpp | 2 +- indra/newview/llagentwearables.cpp | 21 ++-- indra/newview/llagentwearables.h | 2 +- indra/newview/llaisapi.cpp | 34 ++--- indra/newview/llappearancemgr.cpp | 115 +++++++++-------- indra/newview/llassetuploadqueue.cpp | 2 +- indra/newview/llassetuploadresponders.cpp | 2 +- indra/newview/lleventpoll.cpp | 2 +- indra/newview/llfacebookconnect.cpp | 4 +- indra/newview/llfeaturemanager.cpp | 2 +- indra/newview/llhomelocationresponder.cpp | 6 +- indra/newview/llhttpretrypolicy.cpp | 8 +- indra/newview/llinventorymodel.cpp | 144 +++++++++++----------- indra/newview/llinventorymodelbackgroundfetch.cpp | 4 +- indra/newview/llinventoryobserver.cpp | 2 +- indra/newview/llmeshrepository.cpp | 1 - indra/newview/llpaneleditwearable.cpp | 2 +- indra/newview/llpathfindingmanager.cpp | 14 +-- indra/newview/llpathfindingnavmesh.cpp | 2 - indra/newview/llstartup.cpp | 8 +- indra/newview/lltexturefetch.cpp | 36 +++--- indra/newview/llviewerinventory.cpp | 42 +++---- indra/newview/llviewermedia.cpp | 8 +- indra/newview/llviewerregion.cpp | 23 ++-- indra/newview/llviewerstats.cpp | 6 +- indra/newview/llviewertexture.cpp | 28 ++--- indra/newview/llvoavatar.cpp | 24 ++-- indra/newview/llvoavatarself.cpp | 9 +- indra/newview/llwearablelist.cpp | 2 +- indra/newview/llwebprofile.cpp | 4 +- indra/newview/llwebsharing.cpp | 4 +- 37 files changed, 409 insertions(+), 295 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index b78d9da958..2cf86bb4fe 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1565,7 +1565,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // We can get bad morph masks during login, on minimize, and occasional gl errors. // We should only be doing this when we believe something has changed with respect to the user's appearance. { - LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << llendl; + LL_DEBUGS("Avatar") << "gl alpha cache of morph mask not found, doing readback: " << getName() << LL_ENDL; // clear out a slot if we have filled our cache S32 max_cache_entries = getTexLayerSet()->getAvatarAppearance()->isSelf() ? 4 : 1; while ((S32)mAlphaCache.size() >= max_cache_entries) diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index c9ebc70d19..9a6453ea48 100755 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -166,6 +166,132 @@ protected: Type* mPointer; }; +template class LLConstPointer +{ +public: + LLConstPointer() : + mPointer(NULL) + { + } + + LLConstPointer(const Type* ptr) : + mPointer(ptr) + { + ref(); + } + + LLConstPointer(const LLConstPointer& ptr) : + mPointer(ptr.mPointer) + { + ref(); + } + + // support conversion up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template + LLConstPointer(const LLConstPointer& ptr) : + mPointer(ptr.get()) + { + ref(); + } + + ~LLConstPointer() + { + unref(); + } + + const Type* get() const { return mPointer; } + const Type* operator->() const { return mPointer; } + const Type& operator*() const { return *mPointer; } + + operator BOOL() const { return (mPointer != NULL); } + operator bool() const { return (mPointer != NULL); } + bool operator!() const { return (mPointer == NULL); } + bool isNull() const { return (mPointer == NULL); } + bool notNull() const { return (mPointer != NULL); } + + operator const Type*() const { return mPointer; } + bool operator !=(const Type* ptr) const { return (mPointer != ptr); } + bool operator ==(const Type* ptr) const { return (mPointer == ptr); } + bool operator ==(const LLConstPointer& ptr) const { return (mPointer == ptr.mPointer); } + bool operator < (const LLConstPointer& ptr) const { return (mPointer < ptr.mPointer); } + bool operator > (const LLConstPointer& ptr) const { return (mPointer > ptr.mPointer); } + + LLConstPointer& operator =(const Type* ptr) + { + if( mPointer != ptr ) + { + unref(); + mPointer = ptr; + ref(); + } + + return *this; + } + + LLConstPointer& operator =(const LLConstPointer& ptr) + { + if( mPointer != ptr.mPointer ) + { + unref(); + mPointer = ptr.mPointer; + ref(); + } + return *this; + } + + // support assignment up the type hierarchy. See Item 45 in Effective C++, 3rd Ed. + template + LLConstPointer& operator =(const LLConstPointer& ptr) + { + if( mPointer != ptr.get() ) + { + unref(); + mPointer = ptr.get(); + ref(); + } + return *this; + } + + // Just exchange the pointers, which will not change the reference counts. + static void swap(LLConstPointer& a, LLConstPointer& b) + { + const Type* temp = a.mPointer; + a.mPointer = b.mPointer; + b.mPointer = temp; + } + +protected: +#ifdef LL_LIBRARY_INCLUDE + void ref(); + void unref(); +#else + void ref() + { + if (mPointer) + { + mPointer->ref(); + } + } + + void unref() + { + if (mPointer) + { + const Type *tempp = mPointer; + mPointer = NULL; + tempp->unref(); + if (mPointer != NULL) + { + LL_WARNS() << "Unreference did assignment to non-NULL because of destructor" << LL_ENDL; + unref(); + } + } + } +#endif +protected: + const Type* mPointer; +}; + template class LLCopyOnWritePointer : public LLPointer { diff --git a/indra/llcommon/tests/stringize_test.cpp b/indra/llcommon/tests/stringize_test.cpp index 3e4ca548e5..2a4ed44a67 100755 --- a/indra/llcommon/tests/stringize_test.cpp +++ b/indra/llcommon/tests/stringize_test.cpp @@ -95,7 +95,7 @@ namespace tut ensure_equals(stringize(f), "3.14159"); ensure_equals(stringize(d), "3.14159"); ensure_equals(stringize(abc), "abc def"); - ensure_equals(stringize(def), "def ghi"); //Will generate llwarns due to narrowing. + ensure_equals(stringize(def), "def ghi"); //Will generate LL_WARNS() due to narrowing. ensure_equals(stringize(llsd), "{'abc':'abc def','d':r3.14159,'i':i34}"); } diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index 443d34e145..70b200e139 100755 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -48,6 +48,7 @@ class LLInventoryObject : public LLRefCount, public LLTrace::MemTrackable > object_list_t; + typedef std::list > const_object_list_t; //-------------------------------------------------------------------- // Initialization diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 5f8581b4fd..a80d5a570e 100755 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -261,8 +261,8 @@ void LLCurl::Responder::completedRaw( // Only emit a warning if we failed to parse when 'content-type' == 'application/llsd+xml' if (!parsed && (HTTP_CONTENT_LLSD_XML == getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE))) { - llwarns << "Failed to deserialize . " << mURL << " [status:" << mStatus << "] " - << "(" << mReason << ") body: " << debug_body << llendl; + LL_WARNS() << "Failed to deserialize . " << mURL << " [status:" << mStatus << "] " + << "(" << mReason << ") body: " << debug_body << LL_ENDL; } httpCompleted(); @@ -543,7 +543,7 @@ void LLCurl::Easy::slist_append(const char* str) mHeaders = curl_slist_append(mHeaders, str); if (!mHeaders) { - llwarns << "curl_slist_append() call returned NULL appending " << str << llendl; + LL_WARNS() << "curl_slist_append() call returned NULL appending " << str << LL_ENDL; } } } @@ -934,7 +934,7 @@ S32 LLCurl::Multi::process() else { response = HTTP_INTERNAL_ERROR; - //*TODO: change to llwarns + //*TODO: change to LL_WARNS() LL_ERRS() << "cleaned up curl request completed!" << LL_ENDL; } if (response >= 400) diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index cdd8d25f16..d9042fa8b0 100755 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -352,7 +352,7 @@ void LLHTTPPipe::Response::extendedResult(S32 code, const LLSD& r, const LLSD& h { if(! mPipe) { - llwarns << "LLHTTPPipe::Response::extendedResult: NULL pipe" << llendl; + LL_WARNS() << "LLHTTPPipe::Response::extendedResult: NULL pipe" << LL_ENDL; return; } diff --git a/indra/llmessage/llsdappservices.cpp b/indra/llmessage/llsdappservices.cpp index 577429a941..4ca45267bd 100755 --- a/indra/llmessage/llsdappservices.cpp +++ b/indra/llmessage/llsdappservices.cpp @@ -120,7 +120,7 @@ public: virtual bool validate(const std::string& name, LLSD& context) const { //LL_INFOS() << "validate: " << name << ", " - // << LLSDOStreamer(context) << llendl; + // << LLSDOStreamer(context) << LL_ENDL; if((std::string("PUT") == context[CONTEXT_REQUEST][CONTEXT_VERB].asString()) && !name.empty()) { return true; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 6ce6b33790..11666f6c8f 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -770,7 +770,7 @@ void LLAgentWearables::createStandardWearables() // remove this function once the SH-3455 changesets are universally deployed. void LLAgentWearables::sendDummyAgentWearablesUpdate() { - LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << llendl; + LL_DEBUGS("Avatar") << "sendAgentWearablesUpdate()" << LL_ENDL; // Send the AgentIsNowWearing gMessageSystem->newMessageFast(_PREHASH_AgentIsNowWearing); @@ -936,13 +936,12 @@ void LLAgentWearables::removeWearableFinal(const LLWearableType::EType type, boo // Assumes existing wearables are not dirty. void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& items, - const std::vector< LLViewerWearable* >& wearables, - BOOL remove) + const std::vector< LLViewerWearable* >& wearables) { LL_INFOS() << "setWearableOutfit() start" << LL_ENDL; - S32 count = wearables.count(); - llassert(items.count() == count); + S32 count = wearables.size(); + llassert(items.size() == count); // Check for whether outfit already matches the one requested S32 matched = 0, mismatched = 0; @@ -957,7 +956,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it const LLWearableType::EType type = new_wearable->getType(); if (type < 0 || type>=LLWearableType::WT_COUNT) { - llwarns << "invalid type " << type << llendl; + LL_WARNS() << "invalid type " << type << LL_ENDL; mismatched++; continue; } @@ -970,7 +969,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it { LL_DEBUGS("Avatar") << "mismatch, type " << type << " index " << index << " names " << (curr_wearable ? curr_wearable->getName() : "NONE") << "," - << " names " << (new_wearable ? new_wearable->getName() : "NONE") << llendl; + << " names " << (new_wearable ? new_wearable->getName() : "NONE") << LL_ENDL; mismatched++; continue; } @@ -981,26 +980,26 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it LL_DEBUGS("Avatar") << "mismatch on name or inventory id, names " << curr_wearable->getName() << " vs " << new_item->getName() << " item ids " << curr_wearable->getItemID() << " vs " << new_item->getUUID() - << llendl; + << LL_ENDL; mismatched++; continue; } // If we got here, everything matches. matched++; } - LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << llendl; + LL_DEBUGS("Avatar") << "matched " << matched << " mismatched " << mismatched << LL_ENDL; for (S32 j=0; j& wearables, BOOL remove); + void setWearableOutfit(const LLInventoryItem::item_array_t& items, const std::vector< LLViewerWearable* >& wearables); void setWearableName(const LLUUID& item_id, const std::string& new_name); // *TODO: Move this into llappearance/LLWearableData ? void addLocalTextureObject(const LLWearableType::EType wearable_type, const LLAvatarAppearanceDefines::ETextureIndex texture_type, U32 wearable_index); diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 38eb34676e..da66ea357a 100755 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -171,7 +171,7 @@ RemoveItemCommand::RemoveItemCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/item/") + item_id.asString(); @@ -190,7 +190,7 @@ RemoveCategoryCommand::RemoveCategoryCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/category/") + item_id.asString(); @@ -209,7 +209,7 @@ PurgeDescendentsCommand::PurgeDescendentsCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/category/") + item_id.asString() + "/children"; @@ -230,7 +230,7 @@ UpdateItemCommand::UpdateItemCommand(const LLUUID& item_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/item/") + item_id.asString(); @@ -253,7 +253,7 @@ UpdateCategoryCommand::UpdateCategoryCommand(const LLUUID& cat_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } std::string url = cap + std::string("/category/") + cat_id.asString(); @@ -275,7 +275,7 @@ CreateInventoryCommand::CreateInventoryCommand(const LLUUID& parent_id, std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } LLUUID tid; @@ -297,13 +297,13 @@ SlamFolderCommand::SlamFolderCommand(const LLUUID& folder_id, const LLSD& conten std::string cap; if (!getInvCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } LLUUID tid; tid.generate(); std::string url = cap + std::string("/category/") + folder_id.asString() + "/links?tid=" + tid.asString(); - llinfos << url << llendl; + LL_INFOS() << url << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; headers["Content-Type"] = "application/llsd+xml"; @@ -320,14 +320,14 @@ CopyLibraryCategoryCommand::CopyLibraryCategoryCommand(const LLUUID& source_id, std::string cap; if (!getLibCap(cap)) { - llwarns << "No cap found" << llendl; + LL_WARNS() << "No cap found" << LL_ENDL; return; } LL_DEBUGS("Inventory") << "Copying library category: " << source_id << " => " << dest_id << LL_ENDL; LLUUID tid; tid.generate(); std::string url = cap + std::string("/category/") + source_id.asString() + "?tid=" + tid.asString(); - llinfos << url << llendl; + LL_INFOS() << url << LL_ENDL; LLCurl::ResponderPtr responder = this; LLSD headers; F32 timeout = HTTP_REQUEST_EXPIRY_SECS; @@ -482,7 +482,7 @@ void AISUpdate::parseItem(const LLSD& item_map) else { // *TODO: Wow, harsh. Should we just complain and get out? - llerrs << "unpack failed" << llendl; + LL_ERRS() << "unpack failed" << LL_ENDL; } } @@ -524,7 +524,7 @@ void AISUpdate::parseLink(const LLSD& link_map) else { // *TODO: Wow, harsh. Should we just complain and get out? - llerrs << "unpack failed" << llendl; + LL_ERRS() << "unpack failed" << LL_ENDL; } } @@ -590,7 +590,7 @@ void AISUpdate::parseCategory(const LLSD& category_map) else { // *TODO: Wow, harsh. Should we just complain and get out? - llerrs << "unpack failed" << llendl; + LL_ERRS() << "unpack failed" << LL_ENDL; } // Check for more embedded content. @@ -739,7 +739,7 @@ void AISUpdate::doUpdate() for (std::map::const_iterator catit = mCatDescendentDeltas.begin(); catit != mCatDescendentDeltas.end(); ++catit) { - LL_DEBUGS("Inventory") << "descendent accounting for " << catit->first << llendl; + LL_DEBUGS("Inventory") << "descendent accounting for " << catit->first << LL_ENDL; const LLUUID cat_id(catit->first); // Don't account for update if we just created this category. @@ -853,12 +853,12 @@ void AISUpdate::doUpdate() const LLUUID id = ucv_it->first; S32 version = ucv_it->second; LLViewerInventoryCategory *cat = gInventory.getCategory(id); - LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << llendl; + LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL; if (cat->getVersion() != version) { - llwarns << "Possible version mismatch for category " << cat->getName() + LL_WARNS() << "Possible version mismatch for category " << cat->getName() << ", viewer version " << cat->getVersion() - << " server version " << version << llendl; + << " server version " << version << LL_ENDL; } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 5e3753a476..dc503dc50e 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -665,7 +665,7 @@ LLWearableHoldingPattern::LLWearableHoldingPattern(): } mIndex = sNextIndex++; sActiveHoldingPatterns.insert(this); - LL_DEBUGS("Avatar") << "HP " << index() << " created" << llendl; + LL_DEBUGS("Avatar") << "HP " << index() << " created" << LL_ENDL; selfStartPhase("holding_pattern"); } @@ -676,7 +676,7 @@ LLWearableHoldingPattern::~LLWearableHoldingPattern() { selfStopPhase("holding_pattern"); } - LL_DEBUGS("Avatar") << "HP " << index() << " deleted" << llendl; + LL_DEBUGS("Avatar") << "HP " << index() << " deleted" << LL_ENDL; } bool LLWearableHoldingPattern::isMostRecent() @@ -880,11 +880,11 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L { if (!holder->isMostRecent()) { - llwarns << "HP " << holder->index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + LL_WARNS() << "HP " << holder->index() << " skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << LL_ENDL; // runway skip here? } - llinfos << "HP " << holder->index() << " recovered item link for type " << type << llendl; + LL_INFOS() << "HP " << holder->index() << " recovered item link for type " << type << LL_ENDL; holder->eraseTypeToLink(type); // Add wearable to FoundData for actual wearing LLViewerInventoryItem *item = gInventory.getItem(item_id); @@ -913,7 +913,7 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L } else { - llwarns << self_av_string() << "HP " << holder->index() << " inventory link not found for recovered wearable" << llendl; + LL_WARNS() << self_av_string() << "HP " << holder->index() << " inventory link not found for recovered wearable" << LL_ENDL; } } @@ -1523,7 +1523,7 @@ void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_ { case LLAssetType::AT_LINK: { - LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << LL_ENDL; //getActualDescription() is used for a new description //to propagate ordering information saved in descriptions of links LLSD item_contents; @@ -1539,7 +1539,7 @@ void LLAppearanceMgr::slamCategoryLinks(const LLUUID& src_id, const LLUUID& dst_ LLViewerInventoryCategory *catp = item->getLinkedCategory(); if (catp && include_folder_links) { - LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << LL_ENDL; LLSD base_contents; base_contents["name"] = catp->getName(); base_contents["desc"] = ""; // categories don't have descriptions. @@ -1565,7 +1565,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; gInventory.getDirectDescendentsOf(src_id, cats, items); - llinfos << "copying " << items->count() << " items" << llendl; + LL_INFOS() << "copying " << items->size() << " items" << LL_ENDL; LLInventoryObject::const_object_list_t link_array; for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); iter != items->end(); @@ -1576,7 +1576,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL { case LLAssetType::AT_LINK: { - LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory item " << item->getName() << LL_ENDL; link_array.push_back(LLConstPointer(item)); break; } @@ -1586,7 +1586,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL // Skip copying outfit links. if (catp && catp->getPreferredType() != LLFolderType::FT_OUTFIT) { - LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << llendl; + LL_DEBUGS("Avatar") << "linking inventory folder " << item->getName() << LL_ENDL; link_array.push_back(LLConstPointer(item)); } break; @@ -1766,7 +1766,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) LLViewerInventoryCategory *pcat = gInventory.getCategory(category); if (!pcat) { - llwarns << "no category found for id " << category << llendl; + LL_WARNS() << "no category found for id " << category << LL_ENDL; return; } LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL; @@ -1778,7 +1778,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLInventoryModel::item_array_t gest_items; getDescendentsOfAssetType(cof, gest_items, LLAssetType::AT_GESTURE); - for(S32 i = 0; i < gest_items.count(); ++i) + for(S32 i = 0; i < gest_items.size(); ++i) { LLViewerInventoryItem *gest_item = gest_items.at(i); if ( LLGestureMgr::instance().isGestureActive( gest_item->getLinkedUUID()) ) @@ -1853,7 +1853,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { desc = desc_iter->second; LL_DEBUGS("Avatar") << item->getName() << " overriding desc to: " << desc - << " (was: " << item->getActualDescription() << ")" << llendl; + << " (was: " << item->getActualDescription() << ")" << LL_ENDL; } else { @@ -1944,7 +1944,6 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder) { gAgentWearables.setWearableOutfit(items, wearables); } - LL_DEBUGS("Avatar") << "ends, elapsed " << timer.getElapsedTimeF32() << llendl; } S32 LLAppearanceMgr::countActiveHoldingPatterns() @@ -2089,7 +2088,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, if (!validateClothingOrderingInfo()) { - llwarns << "Clothing ordering error" << llendl; + LL_WARNS() << "Clothing ordering error" << LL_ENDL; } BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); @@ -2124,9 +2123,9 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, LLViewerInventoryCategory *cof = gInventory.getCategory(current_outfit_id); if (!gInventory.isCategoryComplete(current_outfit_id)) { - llwarns << "COF info is not complete. Version " << cof->getVersion() + LL_WARNS() << "COF info is not complete. Version " << cof->getVersion() << " descendent_count " << cof->getDescendentCount() - << " viewer desc count " << cof->getViewerDescendentCount() << llendl; + << " viewer desc count " << cof->getViewerDescendentCount() << LL_ENDL; } if(!wear_items.size()) { @@ -2138,7 +2137,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, sortItemsByActualDescription(wear_items); - LL_DEBUGS("Avatar") << "HP block starts" << llendl; + LL_DEBUGS("Avatar") << "HP block starts" << LL_ENDL; LLTimer hp_block_timer; LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; @@ -2215,7 +2214,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, } post_update_func(); - LL_DEBUGS("Avatar") << "HP block ends, elapsed " << hp_block_timer.getElapsedTimeF32() << llendl; + LL_DEBUGS("Avatar") << "HP block ends, elapsed " << hp_block_timer.getElapsedTimeF32() << LL_ENDL; } void LLAppearanceMgr::getDescendentsOfAssetType(const LLUUID& category, @@ -2740,7 +2739,7 @@ void LLAppearanceMgr::updateIsDirty() if(outfit_items.size() != cof_items.size()) { - LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.count() << " cof " << cof_items.count() << llendl; + LL_DEBUGS("Avatar") << "item count different - base " << outfit_items.size() << " cof " << cof_items.size() << LL_ENDL; // Current outfit folder should have one more item than the outfit folder. // this one item is the link back to the outfit folder itself. mOutfitIsDirty = true; @@ -2762,19 +2761,19 @@ void LLAppearanceMgr::updateIsDirty() { if (item1->getLinkedUUID() != item2->getLinkedUUID()) { - LL_DEBUGS("Avatar") << "link id different " << llendl; + LL_DEBUGS("Avatar") << "link id different " << LL_ENDL; } else { if (item1->getName() != item2->getName()) { - LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << llendl; + LL_DEBUGS("Avatar") << "name different " << item1->getName() << " " << item2->getName() << LL_ENDL; } if (item1->getActualDescription() != item2->getActualDescription()) { LL_DEBUGS("Avatar") << "desc different " << item1->getActualDescription() << " " << item2->getActualDescription() - << " names " << item1->getName() << " " << item2->getName() << llendl; + << " names " << item1->getName() << " " << item2->getName() << LL_ENDL; } } mOutfitIsDirty = true; @@ -2783,7 +2782,7 @@ void LLAppearanceMgr::updateIsDirty() } } llassert(!mOutfitIsDirty); - LL_DEBUGS("Avatar") << "clean" << llendl; + LL_DEBUGS("Avatar") << "clean" << LL_ENDL; } // *HACK: Must match name in Library or agent inventory @@ -2922,7 +2921,7 @@ bool LLAppearanceMgr::updateBaseOutfit() const LLUUID base_outfit_id = getBaseOutfitUUID(); if (base_outfit_id.isNull()) return false; - LL_DEBUGS("Avatar") << "saving cof to base outfit " << base_outfit_id << llendl; + LL_DEBUGS("Avatar") << "saving cof to base outfit " << base_outfit_id << LL_ENDL; LLPointer cb = new LLBoostFuncInventoryCallback(no_op_inventory_func, update_base_outfit_after_ordering); @@ -3053,9 +3052,9 @@ bool LLAppearanceMgr::validateClothingOrderingInfo(LLUUID cat_id) const LLUUID& item_id = it->first; const std::string& new_order_str = it->second; LLViewerInventoryItem *item = gInventory.getItem(item_id); - llwarns << "Order validation fails: " << item->getName() + LL_WARNS() << "Order validation fails: " << item->getName() << " needs to update desc to: " << new_order_str - << " (from: " << item->getActualDescription() << ")" << llendl; + << " (from: " << item->getActualDescription() << ")" << LL_ENDL; } return desc_map.size() == 0; @@ -3085,7 +3084,7 @@ void LLAppearanceMgr::updateClothingOrderingInfo(LLUUID cat_id, const std::string& new_order_str = it->second; LLViewerInventoryItem *item = gInventory.getItem(item_id); LL_DEBUGS("Avatar") << item->getName() << " updating desc to: " << new_order_str - << " (was: " << item->getActualDescription() << ")" << llendl; + << " (was: " << item->getActualDescription() << ")" << LL_ENDL; updates["desc"] = new_order_str; update_inventory_item(item_id,updates,cb); } @@ -3148,27 +3147,27 @@ void RequestAgentUpdateAppearanceResponder::onRequestRequested() LL_DEBUGS("Avatar") << "cof_version " << cof_version << " last_rcv " << last_rcv << " last_req " << last_req - << " in flight " << mInFlightCounter << llendl; + << " in flight " << mInFlightCounter << LL_ENDL; if ((mInFlightCounter>0) && (mInFlightTimer.hasExpired())) { - LL_WARNS("Avatar") << "in flight timer expired, resetting " << llendl; + LL_WARNS("Avatar") << "in flight timer expired, resetting " << LL_ENDL; mInFlightCounter = 0; } if (cof_version < last_rcv) { LL_DEBUGS("Avatar") << "Have already received update for cof version " << last_rcv - << " will not request for " << cof_version << llendl; + << " will not request for " << cof_version << LL_ENDL; return; } if (mInFlightCounter>0 && last_req >= cof_version) { LL_DEBUGS("Avatar") << "Request already in flight for cof version " << last_req - << " will not request for " << cof_version << llendl; + << " will not request for " << cof_version << LL_ENDL; return; } // Actually send the request. - LL_DEBUGS("Avatar") << "Will send request for cof_version " << cof_version << llendl; + LL_DEBUGS("Avatar") << "Will send request for cof_version " << cof_version << LL_ENDL; mRetryPolicy->reset(); sendRequest(); } @@ -3183,17 +3182,17 @@ void RequestAgentUpdateAppearanceResponder::sendRequest() if (!gAgent.getRegion()) { - llwarns << "Region not set, cannot request server appearance update" << llendl; + LL_WARNS() << "Region not set, cannot request server appearance update" << LL_ENDL; return; } if (gAgent.getRegion()->getCentralBakeVersion()==0) { - llwarns << "Region does not support baking" << llendl; + LL_WARNS() << "Region does not support baking" << LL_ENDL; } std::string url = gAgent.getRegion()->getCapability("UpdateAvatarAppearance"); if (url.empty()) { - llwarns << "No cap for UpdateAvatarAppearance." << llendl; + LL_WARNS() << "No cap for UpdateAvatarAppearance." << LL_ENDL; return; } @@ -3211,7 +3210,7 @@ void RequestAgentUpdateAppearanceResponder::sendRequest() body["cof_version"] = cof_version+999; } } - LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << llendl; + LL_DEBUGS("Avatar") << "request url " << url << " my_cof_version " << cof_version << LL_ENDL; mInFlightCounter++; mInFlightTimer.setTimerExpirySec(60.0); @@ -3223,7 +3222,7 @@ void RequestAgentUpdateAppearanceResponder::sendRequest() void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) { LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger() - << " ================================= " << llendl; + << " ================================= " << LL_ENDL; std::set ais_items, local_items; const LLSD& cof_raw = content["cof_raw"]; for (LLSD::array_const_iterator it = cof_raw.beginArray(); @@ -3238,14 +3237,14 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) LL_INFOS("Avatar") << "AIS Link: item_id: " << item["item_id"].asUUID() << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() - << llendl; + << LL_ENDL; } else if (item["type"].asInteger() == 25) // folder link { LL_INFOS("Avatar") << "AIS Folder link: item_id: " << item["item_id"].asUUID() << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() - << llendl; + << LL_ENDL; } else { @@ -3253,34 +3252,34 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) << " linked_item_id: " << item["asset_id"].asUUID() << " name: " << item["name"].asString() << " type: " << item["type"].asInteger() - << llendl; + << LL_ENDL; } } } - LL_INFOS("Avatar") << llendl; + LL_INFOS("Avatar") << LL_ENDL; LL_INFOS("Avatar") << "Local COF, version requested: " << content["observed"].asInteger() - << " ================================= " << llendl; + << " ================================= " << LL_ENDL; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; gInventory.collectDescendents(LLAppearanceMgr::instance().getCOF(), cat_array,item_array,LLInventoryModel::EXCLUDE_TRASH); - for (S32 i=0; igetUUID()); LL_INFOS("Avatar") << "LOCAL: item_id: " << inv_item->getUUID() << " linked_item_id: " << inv_item->getLinkedUUID() << " name: " << inv_item->getName() << " parent: " << inv_item->getParentUUID() - << llendl; + << LL_ENDL; } - LL_INFOS("Avatar") << " ================================= " << llendl; + LL_INFOS("Avatar") << " ================================= " << LL_ENDL; S32 local_only = 0, ais_only = 0; for (std::set::iterator it = local_items.begin(); it != local_items.end(); ++it) { if (ais_items.find(*it) == ais_items.end()) { - LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << llendl; + LL_INFOS("Avatar") << "LOCAL ONLY: " << *it << LL_ENDL; local_only++; } } @@ -3288,7 +3287,7 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) { if (local_items.find(*it) == local_items.end()) { - LL_INFOS("Avatar") << "AIS ONLY: " << *it << llendl; + LL_INFOS("Avatar") << "AIS ONLY: " << *it << LL_ENDL; ais_only++; } } @@ -3297,7 +3296,7 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) LL_INFOS("Avatar") << "COF contents identical, only version numbers differ (req " << content["observed"].asInteger() << " rcv " << content["expected"].asInteger() - << ")" << llendl; + << ")" << LL_ENDL; } } @@ -3311,7 +3310,7 @@ void RequestAgentUpdateAppearanceResponder::debugCOF(const LLSD& content) } if (content["success"].asBoolean()) { - LL_DEBUGS("Avatar") << "succeeded" << llendl; + LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL; if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", content); @@ -3352,13 +3351,13 @@ void RequestAgentUpdateAppearanceResponder::onFailure() mRetryPolicy->onFailure(getStatus(), getResponseHeaders()); if (mRetryPolicy->shouldRetry(seconds_to_wait)) { - llinfos << "retrying" << llendl; + LL_INFOS() << "retrying" << LL_ENDL; doAfterInterval(boost::bind(&RequestAgentUpdateAppearanceResponder::sendRequest,this), seconds_to_wait); } else { - llwarns << "giving up after too many retries" << llendl; + LL_WARNS() << "giving up after too many retries" << LL_ENDL; } } @@ -3541,14 +3540,14 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) return; } - LL_DEBUGS("Avatar") << "called" << llendl; + LL_DEBUGS("Avatar") << "called" << LL_ENDL; LLSD key; //EXT-7727. For new accounts inventory callback is created during login process // and may be processed after login process is finished if (show_panel) { - LL_DEBUGS("Avatar") << "showing panel" << llendl; + LL_DEBUGS("Avatar") << "showing panel" << LL_ENDL; LLFloaterSidePanelContainer::showPanel("appearance", "panel_outfits_inventory", key); } @@ -3567,7 +3566,7 @@ void show_created_outfit(LLUUID& folder_id, bool show_panel = true) // link, since, the COF version has changed. There is a race // condition in initial outfit setup which can lead to rez // failures - SH-3860. - LL_DEBUGS("Avatar") << "requesting appearance update after createBaseOutfitLink" << llendl; + LL_DEBUGS("Avatar") << "requesting appearance update after createBaseOutfitLink" << LL_ENDL; LLPointer cb = new LLUpdateAppearanceOnDestroy; LLAppearanceMgr::getInstance()->createBaseOutfitLink(folder_id, cb); } @@ -3593,7 +3592,7 @@ void LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, boo { if (!isAgentAvatarValid()) return; - LL_DEBUGS("Avatar") << "creating new outfit" << llendl; + LL_DEBUGS("Avatar") << "creating new outfit" << LL_ENDL; gAgentWearables.notifyLoadingStarted(); @@ -3714,7 +3713,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b // LL_DEBUGS("Inventory") << "swap, item " // << ll_pretty_print_sd(item->asLLSD()) // << " swap_item " - // << ll_pretty_print_sd(swap_item->asLLSD()) << llendl; + // << ll_pretty_print_sd(swap_item->asLLSD()) << LL_ENDL; // FIXME switch to use AISv3 where supported. //items need to be updated on a dataserver diff --git a/indra/newview/llassetuploadqueue.cpp b/indra/newview/llassetuploadqueue.cpp index 6f97ca6bc7..8833c57948 100755 --- a/indra/newview/llassetuploadqueue.cpp +++ b/indra/newview/llassetuploadqueue.cpp @@ -74,7 +74,7 @@ protected: virtual void httpFailure() { // Parent class will spam the failure. - //llwarns << dumpResponse() << llendl; + //LL_WARNS() << dumpResponse() << LL_ENDL; LLUpdateTaskInventoryResponder::httpFailure(); LLAssetUploadQueue *queue = mSupplier->get(); if (queue) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index e92c897ad8..a98ff64d0a 100755 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -297,7 +297,7 @@ void LLAssetUploadResponder::uploadUpload(const LLSD& content) void LLAssetUploadResponder::uploadFailure(const LLSD& content) { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot"); diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index e603cd0483..4de6ad4d2f 100755 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -260,7 +260,7 @@ namespace LL_WARNS() << "LLEventPollResponder: id undefined" << LL_ENDL; } - // was llinfos but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG + // was LL_INFOS() but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG LL_DEBUGS() << "LLEventPollResponder::httpSuccess <" << mCount << "> " << events.size() << "events (id " << LLSDXMLStreamer(mAcknowledge) << ")" << LL_ENDL; diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 1a3ddf2b91..e2fa117453 100755 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -303,8 +303,8 @@ public: if ( HTTP_FOUND == getStatus() ) { LL_INFOS() << "Facebook: Info received" << LL_ENDL; - LL_DEBUGS("FacebookConnect") << "Getting Facebook info successful. info: " << info << LL_ENDL; - LLFacebookConnect::instance().storeInfo(info); + LL_DEBUGS("FacebookConnect") << "Getting Facebook info successful. info: " << getContent() << LL_ENDL; + LLFacebookConnect::instance().storeInfo(getContent()); } else { diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 9227d2102e..d0555477ea 100755 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -651,7 +651,7 @@ public: { mContent["body"] = body; } - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; } } diff --git a/indra/newview/llhomelocationresponder.cpp b/indra/newview/llhomelocationresponder.cpp index 7496b0a922..d0492bcdb4 100755 --- a/indra/newview/llhomelocationresponder.cpp +++ b/indra/newview/llhomelocationresponder.cpp @@ -104,9 +104,5 @@ void LLHomeLocationResponder::httpSuccess() void LLHomeLocationResponder::httpFailure() { -<<<<<<< local - llwarns << dumpResponse() << llendl; -======= - LL_WARNS() << "LLHomeLocationResponder error [status:" << status << "]: " << content << LL_ENDL; ->>>>>>> other + LL_WARNS() << dumpResponse() << LL_ENDL; } diff --git a/indra/newview/llhttpretrypolicy.cpp b/indra/newview/llhttpretrypolicy.cpp index ae429f11f8..7001a9a88b 100755 --- a/indra/newview/llhttpretrypolicy.cpp +++ b/indra/newview/llhttpretrypolicy.cpp @@ -94,7 +94,7 @@ void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_ti { if (!mShouldRetry) { - llinfos << "keep on failing" << llendl; + LL_INFOS() << "keep on failing" << LL_ENDL; return; } if (mRetryCount > 0) @@ -111,17 +111,17 @@ void LLAdaptiveRetryPolicy::onFailureCommon(S32 status, bool has_retry_header_ti if (mRetryCount>=mMaxRetries) { - llinfos << "Too many retries " << mRetryCount << ", will not retry" << llendl; + LL_INFOS() << "Too many retries " << mRetryCount << ", will not retry" << LL_ENDL; mShouldRetry = false; } if (!mRetryOn4xx && !isHttpServerErrorStatus(status)) { - llinfos << "Non-server error " << status << ", will not retry" << llendl; + LL_INFOS() << "Non-server error " << status << ", will not retry" << LL_ENDL; mShouldRetry = false; } if (mShouldRetry) { - llinfos << "Retry count " << mRetryCount << " should retry after " << wait_time << llendl; + LL_INFOS() << "Retry count " << mRetryCount << " should retry after " << wait_time << LL_ENDL; mRetryTimer.reset(); mRetryTimer.setTimerExpirySec(wait_time); } diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 7b3aacd5e9..29b9c2b998 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -253,7 +253,7 @@ bool LLInventoryModel::getObjectTopmostAncestor(const LLUUID& object_id, LLUUID& LLInventoryObject *parent_object = getObject(object->getParentUUID()); if (!parent_object) { - llwarns << "unable to trace topmost ancestor, missing item for uuid " << object->getParentUUID() << llendl; + LL_WARNS() << "unable to trace topmost ancestor, missing item for uuid " << object->getParentUUID() << LL_ENDL; return false; } object = parent_object; @@ -522,7 +522,7 @@ protected: } LLUUID category_id = content["folder_id"].asUUID(); - LL_DEBUGS("Avatar") << ll_pretty_print_sd(content) << llendl; + LL_DEBUGS("Avatar") << ll_pretty_print_sd(content) << LL_ENDL; // Add the category to the internal representation LLPointer cat = new LLViewerInventoryCategory( category_id, @@ -599,7 +599,7 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, request["message"] = "CreateInventoryCategory"; request["payload"] = body; - LL_DEBUGS("Avatar") << "create category request: " << ll_pretty_print_sd(request) << llendl; + LL_DEBUGS("Avatar") << "create category request: " << ll_pretty_print_sd(request) << LL_ENDL; // viewer_region->getCapAPI().post(request); LLHTTPClient::post( url, @@ -791,7 +791,7 @@ LLInventoryModel::item_array_t LLInventoryModel::collectLinksTo(const LLUUID& id LLViewerInventoryItem *item = getItem(it->second); if (item) { - items.put(item); + items.push_back(item); } } @@ -1171,7 +1171,7 @@ void LLInventoryModel::onAISUpdateReceived(const std::string& context, const LLS AISUpdate ais_update(update); // parse update llsd into stuff to do. ais_update.doUpdate(); // execute the updates in the appropriate order. - llinfos << "elapsed: " << timer.getElapsedTimeF32() << llendl; + LL_INFOS() << "elapsed: " << timer.getElapsedTimeF32() << LL_ENDL; } // Does not appear to be used currently. @@ -1180,7 +1180,7 @@ void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, U32 mask = LLInventoryObserver::NONE; LLPointer item = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (item ? item->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (item ? item->getName() : "(NOT FOUND)") << LL_ENDL; if(item) { for (LLSD::map_const_iterator it = updates.beginMap(); @@ -1188,19 +1188,19 @@ void LLInventoryModel::onItemUpdated(const LLUUID& item_id, const LLSD& updates, { if (it->first == "name") { - llinfos << "Updating name from " << item->getName() << " to " << it->second.asString() << llendl; + LL_INFOS() << "Updating name from " << item->getName() << " to " << it->second.asString() << LL_ENDL; item->rename(it->second.asString()); mask |= LLInventoryObserver::LABEL; } else if (it->first == "desc") { - llinfos << "Updating description from " << item->getActualDescription() - << " to " << it->second.asString() << llendl; + LL_INFOS() << "Updating description from " << item->getActualDescription() + << " to " << it->second.asString() << LL_ENDL; item->setDescription(it->second.asString()); } else { - llerrs << "unhandled updates for field: " << it->first << llendl; + LL_ERRS() << "unhandled updates for field: " << it->first << LL_ENDL; } } mask |= LLInventoryObserver::INTERNAL; @@ -1221,7 +1221,7 @@ void LLInventoryModel::onCategoryUpdated(const LLUUID& cat_id, const LLSD& updat U32 mask = LLInventoryObserver::NONE; LLPointer cat = gInventory.getCategory(cat_id); - LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (cat ? cat->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (cat ? cat->getName() : "(NOT FOUND)") << LL_ENDL; if(cat) { for (LLSD::map_const_iterator it = updates.beginMap(); @@ -1229,13 +1229,13 @@ void LLInventoryModel::onCategoryUpdated(const LLUUID& cat_id, const LLSD& updat { if (it->first == "name") { - llinfos << "Updating name from " << cat->getName() << " to " << it->second.asString() << llendl; + LL_INFOS() << "Updating name from " << cat->getName() << " to " << it->second.asString() << LL_ENDL; cat->rename(it->second.asString()); mask |= LLInventoryObserver::LABEL; } else { - llerrs << "unhandled updates for field: " << it->first << llendl; + LL_ERRS() << "unhandled updates for field: " << it->first << LL_ENDL; } } mask |= LLInventoryObserver::INTERNAL; @@ -1270,12 +1270,12 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo categories, items, LLInventoryModel::INCLUDE_TRASH); - S32 count = items.count(); + S32 count = items.size(); LLUUID uu_id; for(S32 i = 0; i < count; ++i) { - uu_id = items.get(i)->getUUID(); + uu_id = items.at(i)->getUUID(); // This check prevents the deletion of a previously deleted item. // This is necessary because deletion is not done in a hierarchical @@ -1287,7 +1287,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo } } - count = categories.count(); + count = categories.size(); // Slightly kludgy way to make sure categories are removed // only after their child categories have gone away. @@ -1301,7 +1301,7 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo deleted_count = 0; for(S32 i = 0; i < count; ++i) { - uu_id = categories.get(i)->getUUID(); + uu_id = categories.at(i)->getUUID(); if (getCategory(uu_id)) { cat_array_t* cat_list = getUnlockedCatArray(uu_id); @@ -1317,8 +1317,8 @@ void LLInventoryModel::onDescendentsPurgedFromServer(const LLUUID& object_id, bo while (deleted_count > 0); if (total_deleted_count != count) { - llwarns << "Unexpected count of categories deleted, got " - << total_deleted_count << " expected " << count << llendl; + LL_WARNS() << "Unexpected count of categories deleted, got " + << total_deleted_count << " expected " << count << LL_ENDL; } //gInventory.validate(); } @@ -1386,7 +1386,7 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo { if (item_list->size()) { - llwarns << "Deleting cat " << id << " while it still has child items" << llendl; + LL_WARNS() << "Deleting cat " << id << " while it still has child items" << LL_ENDL; } delete item_list; mParentChildItemTree.erase(id); @@ -1396,7 +1396,7 @@ void LLInventoryModel::deleteObject(const LLUUID& id, bool fix_broken_links, boo { if (cat_list->size()) { - llwarns << "Deleting cat " << id << " while it still has child cats" << llendl; + LL_WARNS() << "Deleting cat " << id << " while it still has child cats" << LL_ENDL; } delete cat_list; mParentChildCategoryTree.erase(id); @@ -1513,14 +1513,14 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) LLViewerInventoryItem *item = getItem(referent); if (item) { - llwarns << "Item " << item->getName() << llendl; + LL_WARNS() << "Item " << item->getName() << LL_ENDL; } else { LLViewerInventoryCategory *cat = getCategory(referent); if (cat) { - llwarns << "Category " << cat->getName() << llendl; + LL_WARNS() << "Category " << cat->getName() << LL_ENDL; } } } @@ -2267,7 +2267,7 @@ void LLInventoryModel::buildParentChildMap() LL_INFOS() << "Lost category: " << cat->getUUID() << " - " << cat->getName() << LL_ENDL; ++lost; - lost_cats.put(cat); + lost_cats.push_back(cat); // notifyObservers() has been moved to // llstartup/idle_startup() after this func completes. // Allows some system categories to be created before @@ -2277,7 +2277,7 @@ void LLInventoryModel::buildParentChildMap() if (!gInventory.validate()) { - llwarns << "model failed validity check!" << llendl; + LL_WARNS() << "model failed validity check!" << LL_ENDL; } } @@ -3419,20 +3419,20 @@ bool LLInventoryModel::validate() const if (getRootFolderID().isNull()) { - llwarns << "no root folder id" << llendl; + LL_WARNS() << "no root folder id" << LL_ENDL; valid = false; } if (getLibraryRootFolderID().isNull()) { - llwarns << "no root folder id" << llendl; + LL_WARNS() << "no root folder id" << LL_ENDL; valid = false; } if (mCategoryMap.size() + 1 != mParentChildCategoryTree.size()) { // ParentChild should be one larger because of the special entry for null uuid. - llinfos << "unexpected sizes: cat map size " << mCategoryMap.size() - << " parent/child " << mParentChildCategoryTree.size() << llendl; + LL_INFOS() << "unexpected sizes: cat map size " << mCategoryMap.size() + << " parent/child " << mParentChildCategoryTree.size() << LL_ENDL; valid = false; } S32 cat_lock = 0; @@ -3445,13 +3445,13 @@ bool LLInventoryModel::validate() const const LLViewerInventoryCategory *cat = cit->second; if (!cat) { - llwarns << "invalid cat" << llendl; + LL_WARNS() << "invalid cat" << LL_ENDL; valid = false; continue; } if (cat_id != cat->getUUID()) { - llwarns << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << llendl; + LL_WARNS() << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << LL_ENDL; valid = false; } @@ -3459,9 +3459,9 @@ bool LLInventoryModel::validate() const { if (cat_id != getRootFolderID() && cat_id != getLibraryRootFolderID()) { - llwarns << "cat " << cat_id << " has no parent, but is not root (" + LL_WARNS() << "cat " << cat_id << " has no parent, but is not root (" << getRootFolderID() << ") or library root (" - << getLibraryRootFolderID() << ")" << llendl; + << getLibraryRootFolderID() << ")" << LL_ENDL; } } cat_array_t* cats; @@ -3469,7 +3469,7 @@ bool LLInventoryModel::validate() const getDirectDescendentsOf(cat_id,cats,items); if (!cats || !items) { - llwarns << "invalid direct descendents for " << cat_id << llendl; + LL_WARNS() << "invalid direct descendents for " << cat_id << LL_ENDL; valid = false; continue; } @@ -3479,11 +3479,11 @@ bool LLInventoryModel::validate() const } else if (cats->size() + items->size() != cat->getDescendentCount()) { - llwarns << "invalid desc count for " << cat_id << " name [" << cat->getName() + LL_WARNS() << "invalid desc count for " << cat_id << " name [" << cat->getName() << "] parent " << cat->getParentUUID() << " cached " << cat->getDescendentCount() << " expected " << cats->size() << "+" << items->size() - << "=" << cats->size() +items->size() << llendl; + << "=" << cats->size() +items->size() << LL_ENDL; valid = false; } if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) @@ -3500,11 +3500,11 @@ bool LLInventoryModel::validate() const } for (S32 i = 0; isize(); i++) { - LLViewerInventoryItem *item = items->get(i); + LLViewerInventoryItem *item = items->at(i); if (!item) { - llwarns << "null item at index " << i << " for cat " << cat_id << llendl; + LL_WARNS() << "null item at index " << i << " for cat " << cat_id << LL_ENDL; valid = false; continue; } @@ -3513,9 +3513,9 @@ bool LLInventoryModel::validate() const if (item->getParentUUID() != cat_id) { - llwarns << "wrong parent for " << item_id << " found " + LL_WARNS() << "wrong parent for " << item_id << " found " << item->getParentUUID() << " expected " << cat_id - << llendl; + << LL_ENDL; valid = false; } @@ -3524,8 +3524,8 @@ bool LLInventoryModel::validate() const item_map_t::const_iterator it = mItemMap.find(item_id); if (it == mItemMap.end()) { - llwarns << "item " << item_id << " found as child of " - << cat_id << " but not in top level mItemMap" << llendl; + LL_WARNS() << "item " << item_id << " found as child of " + << cat_id << " but not in top level mItemMap" << LL_ENDL; valid = false; } else @@ -3533,8 +3533,8 @@ bool LLInventoryModel::validate() const LLViewerInventoryItem *top_item = it->second; if (top_item != item) { - llwarns << "item mismatch, item_id " << item_id - << " top level entry is different, uuid " << top_item->getUUID() << llendl; + LL_WARNS() << "item mismatch, item_id " << item_id + << " top level entry is different, uuid " << top_item->getUUID() << LL_ENDL; } } @@ -3543,7 +3543,7 @@ bool LLInventoryModel::validate() const bool found = getObjectTopmostAncestor(item_id, topmost_ancestor_id); if (!found) { - llwarns << "unable to find topmost ancestor for " << item_id << llendl; + LL_WARNS() << "unable to find topmost ancestor for " << item_id << LL_ENDL; valid = false; } else @@ -3551,10 +3551,10 @@ bool LLInventoryModel::validate() const if (topmost_ancestor_id != getRootFolderID() && topmost_ancestor_id != getLibraryRootFolderID()) { - llwarns << "unrecognized top level ancestor for " << item_id + LL_WARNS() << "unrecognized top level ancestor for " << item_id << " got " << topmost_ancestor_id << " expected " << getRootFolderID() - << " or " << getLibraryRootFolderID() << llendl; + << " or " << getLibraryRootFolderID() << LL_ENDL; valid = false; } } @@ -3569,8 +3569,8 @@ bool LLInventoryModel::validate() const getDirectDescendentsOf(parent_id,cats,items); if (!cats) { - llwarns << "cat " << cat_id << " name [" << cat->getName() - << "] orphaned - no child cat array for alleged parent " << parent_id << llendl; + LL_WARNS() << "cat " << cat_id << " name [" << cat->getName() + << "] orphaned - no child cat array for alleged parent " << parent_id << LL_ENDL; valid = false; } else @@ -3578,7 +3578,7 @@ bool LLInventoryModel::validate() const bool found = false; for (S32 i = 0; isize(); i++) { - LLViewerInventoryCategory *kid_cat = cats->get(i); + LLViewerInventoryCategory *kid_cat = cats->at(i); if (kid_cat == cat) { found = true; @@ -3587,8 +3587,8 @@ bool LLInventoryModel::validate() const } if (!found) { - llwarns << "cat " << cat_id << " name [" << cat->getName() - << "] orphaned - not found in child cat array of alleged parent " << parent_id << llendl; + LL_WARNS() << "cat " << cat_id << " name [" << cat->getName() + << "] orphaned - not found in child cat array of alleged parent " << parent_id << LL_ENDL; } } } @@ -3600,14 +3600,14 @@ bool LLInventoryModel::validate() const LLViewerInventoryItem *item = iit->second; if (item->getUUID() != item_id) { - llwarns << "item_id " << item_id << " does not match " << item->getUUID() << llendl; + LL_WARNS() << "item_id " << item_id << " does not match " << item->getUUID() << LL_ENDL; valid = false; } const LLUUID& parent_id = item->getParentUUID(); if (parent_id.isNull()) { - llwarns << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << llendl; + LL_WARNS() << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << LL_ENDL; } else { @@ -3616,15 +3616,15 @@ bool LLInventoryModel::validate() const getDirectDescendentsOf(parent_id,cats,items); if (!items) { - llwarns << "item " << item_id << " name [" << item->getName() - << "] orphaned - alleged parent has no child items list " << parent_id << llendl; + LL_WARNS() << "item " << item_id << " name [" << item->getName() + << "] orphaned - alleged parent has no child items list " << parent_id << LL_ENDL; } else { bool found = false; for (S32 i=0; isize(); ++i) { - if (items->get(i) == item) + if (items->at(i) == item) { found = true; break; @@ -3632,8 +3632,8 @@ bool LLInventoryModel::validate() const } if (!found) { - llwarns << "item " << item_id << " name [" << item->getName() - << "] orphaned - not found as child of alleged parent " << parent_id << llendl; + LL_WARNS() << "item " << item_id << " name [" << item->getName() + << "] orphaned - not found as child of alleged parent " << parent_id << LL_ENDL; } } @@ -3648,30 +3648,30 @@ bool LLInventoryModel::validate() const // Linked-to UUID should have back reference to this link. if (!hasBacklinkInfo(link_id, target_id)) { - llwarns << "link " << item->getUUID() << " type " << item->getActualType() + LL_WARNS() << "link " << item->getUUID() << " type " << item->getActualType() << " missing backlink info at target_id " << target_id - << llendl; + << LL_ENDL; } // Links should have referents. if (item->getActualType() == LLAssetType::AT_LINK && !target_item) { - llwarns << "broken item link " << item->getName() << " id " << item->getUUID() << llendl; + LL_WARNS() << "broken item link " << item->getName() << " id " << item->getUUID() << LL_ENDL; } else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER && !target_cat) { - llwarns << "broken folder link " << item->getName() << " id " << item->getUUID() << llendl; + LL_WARNS() << "broken folder link " << item->getName() << " id " << item->getUUID() << LL_ENDL; } if (target_item && target_item->getIsLinkType()) { - llwarns << "link " << item->getName() << " references a link item " - << target_item->getName() << " " << target_item->getUUID() << llendl; + LL_WARNS() << "link " << item->getName() << " references a link item " + << target_item->getName() << " " << target_item->getUUID() << LL_ENDL; } // Links should not have backlinks. std::pair range = mBacklinkMMap.equal_range(link_id); if (range.first != range.second) { - llwarns << "Link item " << item->getName() << " has backlinks!" << llendl; + LL_WARNS() << "Link item " << item->getName() << " has backlinks!" << LL_ENDL; } } else @@ -3685,7 +3685,7 @@ bool LLInventoryModel::validate() const LLViewerInventoryItem *link_item = getItem(link_id); if (!link_item || !link_item->getIsLinkType()) { - llwarns << "invalid backlink from target " << item->getName() << " to " << link_id << llendl; + LL_WARNS() << "invalid backlink from target " << item->getName() << " to " << link_id << LL_ENDL; } } } @@ -3693,19 +3693,19 @@ bool LLInventoryModel::validate() const if (cat_lock > 0 || item_lock > 0) { - llinfos << "Found locks on some categories: sub-cat arrays " - << cat_lock << ", item arrays " << item_lock << llendl; + LL_INFOS() << "Found locks on some categories: sub-cat arrays " + << cat_lock << ", item arrays " << item_lock << LL_ENDL; } if (desc_unknown_count != 0) { - llinfos << "Found " << desc_unknown_count << " cats with unknown descendent count" << llendl; + LL_INFOS() << "Found " << desc_unknown_count << " cats with unknown descendent count" << LL_ENDL; } if (version_unknown_count != 0) { - llinfos << "Found " << version_unknown_count << " cats with unknown version" << llendl; + LL_INFOS() << "Found " << version_unknown_count << " cats with unknown version" << LL_ENDL; } - llinfos << "Validate done, valid = " << (U32) valid << llendl; + LL_INFOS() << "Validate done, valid = " << (U32) valid << LL_ENDL; return valid; } diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 5f8dc95d8a..2de37b0790 100755 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -172,7 +172,7 @@ void LLInventoryModelBackgroundFetch::setAllFoldersFetched() mRecursiveLibraryFetchStarted) { mAllFoldersFetched = TRUE; - //llinfos << "All folders fetched, validating" << llendl; + //LL_INFOS() << "All folders fetched, validating" << LL_ENDL; //gInventory.validate(); } mFolderFetchActive = false; @@ -544,7 +544,7 @@ void LLInventoryModelFetchDescendentsResponder::httpSuccess() // If we get back an error (not found, etc...), handle it here. void LLInventoryModelFetchDescendentsResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; LLInventoryModelBackgroundFetch *fetcher = LLInventoryModelBackgroundFetch::getInstance(); LL_INFOS() << dumpResponse() << LL_ENDL; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 2df01bb494..2dd8dce42f 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -601,7 +601,7 @@ void LLInventoryCategoriesObserver::changed(U32 mask) LLViewerInventoryCategory* category = gInventory.getCategory(cat_id); if (!category) { - llwarns << "Category : Category id = " << cat_id << " disappeared" << llendl; + LL_WARNS() << "Category : Category id = " << cat_id << " disappeared" << LL_ENDL; cat_data.mCallback(); // Keep track of those deleted categories so we can remove them deleted_categories_ids.push_back(cat_id); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 86b471a284..80a427c0b8 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -31,7 +31,6 @@ #include "apr_dso.h" #include "llhttpconstants.h" #include "llapr.h" -#include "llhttpstatuscodes.h" #include "llmeshrepository.h" #include "llagent.h" diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 0447e66e4a..ac00c5d986 100755 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1095,7 +1095,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as) // Create new link LL_DEBUGS("Avatar") << "link refresh, creating new link to " << link_item->getLinkedUUID() << " removing old link at " << link_item->getUUID() - << " wearable item id " << mWearablePtr->getItemID() << llendl; + << " wearable item id " << mWearablePtr->getItemID() << LL_ENDL; LLInventoryObject::const_object_list_t obj_array; obj_array.push_back(LLConstPointer(link_item)); diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 9534b54dcf..4977a72dc6 100755 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -819,7 +819,7 @@ void NavMeshResponder::httpSuccess() void NavMeshResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; mNavMeshPtr->handleNavMeshError(mNavMeshVersion); } @@ -872,7 +872,7 @@ void NavMeshRebakeResponder::httpSuccess() void NavMeshRebakeResponder::httpFailure() { - LL_WARNS() << dumpResponse() < LL_ENDL; + LL_WARNS() << dumpResponse() << LL_ENDL; mRebakeNavMeshCallback(false); } @@ -907,8 +907,7 @@ void LinksetsResponder::handleObjectLinksetsResult(const LLSD &pContent) void LinksetsResponder::handleObjectLinksetsError() { - LL_WARNS() << "LinksetsResponder object linksets error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << LL_ENDL; + LL_WARNS() << "LinksetsResponder object linksets error" << LL_ENDL; mObjectMessagingState = kReceivedError; if (mTerrainMessagingState != kWaiting) { @@ -929,8 +928,7 @@ void LinksetsResponder::handleTerrainLinksetsResult(const LLSD &pContent) void LinksetsResponder::handleTerrainLinksetsError() { - LL_WARNS() << "LinksetsResponder terrain linksets error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << LL_ENDL; + LL_WARNS() << "LinksetsResponder terrain linksets error" << LL_ENDL; mTerrainMessagingState = kReceivedError; if (mObjectMessagingState != kWaiting) { @@ -981,7 +979,7 @@ void ObjectLinksetsResponder::httpSuccess() void ObjectLinksetsResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; mLinksetsResponsderPtr->handleObjectLinksetsError(); } @@ -1006,7 +1004,7 @@ void TerrainLinksetsResponder::httpSuccess() void TerrainLinksetsResponder::httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; mLinksetsResponsderPtr->handleTerrainLinksetsError(); } diff --git a/indra/newview/llpathfindingnavmesh.cpp b/indra/newview/llpathfindingnavmesh.cpp index e4a696ac7e..0287c07f96 100755 --- a/indra/newview/llpathfindingnavmesh.cpp +++ b/indra/newview/llpathfindingnavmesh.cpp @@ -186,8 +186,6 @@ void LLPathfindingNavMesh::handleNavMeshError() void LLPathfindingNavMesh::handleNavMeshError(U32 pNavMeshVersion) { - LL_WARNS() << "LLPathfindingNavMesh error with request to URL '" << pURL << "' [status:" - << pStatus << "]: " << pContent << LL_ENDL; if (mNavMeshStatus.getVersion() == pNavMeshVersion) { handleNavMeshError(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 5bb67490ac..7b7168d438 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2077,8 +2077,8 @@ bool idle_startup() // the gender chooser. This should occur only in very // unusual circumstances, so set the timeout fairly high // to minimize mistaken hits here. - llwarns << "Wait for valid avatar state exceeded " - << timeout.getElapsedTimeF32() << " will invoke gender chooser" << llendl; + LL_WARNS() << "Wait for valid avatar state exceeded " + << timeout.getElapsedTimeF32() << " will invoke gender chooser" << LL_ENDL; LLStartUp::setStartupState( STATE_WEARABLES_WAIT ); } else @@ -2131,7 +2131,7 @@ bool idle_startup() if (isAgentAvatarValid() && gAgentAvatarp->isFullyLoaded()) { - LL_DEBUGS("Avatar") << "avatar fully loaded" << llendl; + LL_DEBUGS("Avatar") << "avatar fully loaded" << LL_ENDL; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } @@ -2142,7 +2142,7 @@ bool idle_startup() if ( gAgentWearables.areWearablesLoaded() ) { // We have our clothing, proceed. - LL_DEBUGS("Avatar") << "wearables loaded" << llendl; + LL_DEBUGS("Avatar") << "wearables loaded" << LL_ENDL; LLStartUp::setStartupState( STATE_CLEANUP ); return TRUE; } diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index fb4be553c1..14a42dd8dc 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1306,11 +1306,11 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (wait_seconds <= 0.0) { - llinfos << mID << " retrying now" << llendl; + LL_INFOS() << mID << " retrying now" << LL_ENDL; } else { - //llinfos << mID << " waiting to retry for " << wait_seconds << " seconds" << llendl; + //LL_INFOS() << mID << " waiting to retry for " << wait_seconds << " seconds" << LL_ENDL; return false; } } @@ -1333,7 +1333,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (mFTType != FTT_DEFAULT) { - llwarns << "trying to seek a non-default texture on the sim. Bad!" << llendl; + LL_WARNS() << "trying to seek a non-default texture on the sim. Bad!" << LL_ENDL; } setUrl(http_url + "/?texture_id=" + mID.asString().c_str()); mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id. @@ -1570,7 +1570,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (mFTType != FTT_MAP_TILE) { - llwarns << "Texture missing from server (404): " << mUrl << llendl; + LL_WARNS() << "Texture missing from server (404): " << mUrl << LL_ENDL; } if(mWriteToCacheState == NOT_WRITE) //map tiles or server bakes @@ -1579,7 +1579,7 @@ bool LLTextureFetchWorker::doWork(S32 param) releaseHttpSemaphore(); if (mFTType != FTT_MAP_TILE) { - LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; + LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << LL_ENDL; } return true; } @@ -1598,10 +1598,10 @@ bool LLTextureFetchWorker::doWork(S32 param) else if (http_service_unavail == mGetStatus) { LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL; - llinfos << "503: HTTP GET failed for: " << mUrl + LL_INFOS() << "503: HTTP GET failed for: " << mUrl << " Status: " << mGetStatus.toHex() << " Reason: '" << mGetReason << "'" - << llendl; + << LL_ENDL; } else if (http_not_sat == mGetStatus) { @@ -1957,8 +1957,8 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe F32 rate = fake_failure_rate; if (mFTType == FTT_SERVER_BAKE && (fake_failure_rate > 0.0) && (rand_val < fake_failure_rate)) { - llwarns << mID << " for debugging, setting fake failure status for texture " << mID - << " (rand was " << rand_val << "/" << rate << ")" << llendl; + LL_WARNS() << mID << " for debugging, setting fake failure status for texture " << mID + << " (rand was " << rand_val << "/" << rate << ")" << LL_ENDL; response->setStatus(LLCore::HttpStatus(503)); } bool success = true; @@ -1966,13 +1966,13 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe LLCore::HttpStatus status(response->getStatus()); if (!status && (mFTType == FTT_SERVER_BAKE)) { - llinfos << mID << " state " << e_state_name[mState] << llendl; + LL_INFOS() << mID << " state " << e_state_name[mState] << LL_ENDL; mFetchRetryPolicy.onFailure(response); F32 retry_after; if (mFetchRetryPolicy.shouldRetry(retry_after)) { - llinfos << mID << " will retry after " << retry_after << " seconds, resetting state to LOAD_FROM_NETWORK" << llendl; - mFetcher->removeFromHTTPQueue(mID, 0); + LL_INFOS() << mID << " will retry after " << retry_after << " seconds, resetting state to LOAD_FROM_NETWORK" << LL_ENDL; + mFetcher->removeFromHTTPQueue(mID, S32Bytes(0)); std::string reason(status.toString()); setGetStatus(status, reason); releaseHttpSemaphore(); @@ -1981,7 +1981,7 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe } else { - llinfos << mID << " will not retry" << llendl; + LL_INFOS() << mID << " will not retry" << LL_ENDL; } } else @@ -2011,8 +2011,8 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe { std::string reason(status.toString()); setGetStatus(status, reason); - llwarns << "CURL GET FAILED, status: " << status.toTerseString() - << " reason: " << reason << llendl; + LL_WARNS() << "CURL GET FAILED, status: " << status.toTerseString() + << " reason: " << reason << LL_ENDL; } } else @@ -2576,7 +2576,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const if (f_type == FTT_SERVER_BAKE) { - LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << " type " << f_type << llendl; + LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << " type " << f_type << LL_ENDL; } LLTextureFetchWorker* worker = getWorker(id) ; if (worker) @@ -2600,7 +2600,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const llassert(!url.empty() && (!exten.empty() && LLImageBase::getCodecFromExtension(exten) != IMG_CODEC_J2C)); // Do full requests for baked textures to reduce interim blurring. - LL_DEBUGS("Texture") << "full request for " << id << " texture is FTT_SERVER_BAKE" << llendl; + LL_DEBUGS("Texture") << "full request for " << id << " texture is FTT_SERVER_BAKE" << LL_ENDL; desired_size = MAX_IMAGE_DATA_SIZE; desired_discard = 0; } @@ -3354,7 +3354,7 @@ void LLTextureFetchWorker::setState(e_state new_state) // blurry images fairly frequently. Presumably this is an // indication of some subtle timing or locking issue. -// LL_INFOS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; +// LL_INFOS("Texture") << "id: " << mID << " FTType: " << mFTType << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << LL_ENDL; } mState = new_state; } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 3e3e385905..b236bba3b7 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -709,7 +709,7 @@ S32 LLViewerInventoryCategory::getViewerDescendentCount() const S32 descendents_actual = 0; if(cats && items) { - descendents_actual = cats->count() + items->count(); + descendents_actual = cats->size() + items->size(); } return descendents_actual; } @@ -1128,7 +1128,7 @@ void link_inventory_array(const LLUUID& category, const LLInventoryObject* baseobj = *it; if (!baseobj) { - llwarns << "attempt to link to unknown object" << llendl; + LL_WARNS() << "attempt to link to unknown object" << LL_ENDL; continue; } @@ -1137,7 +1137,7 @@ void link_inventory_array(const LLUUID& category, // Fail if item can be found but is of a type that can't be linked. // Arguably should fail if the item can't be found too, but that could // be a larger behavioral change. - llwarns << "attempt to link an unlinkable object, type = " << baseobj->getActualType() << llendl; + LL_WARNS() << "attempt to link an unlinkable object, type = " << baseobj->getActualType() << LL_ENDL; continue; } @@ -1173,7 +1173,7 @@ void link_inventory_array(const LLUUID& category, } else { - llwarns << "could not convert object into an item or category: " << baseobj->getUUID() << llendl; + LL_WARNS() << "could not convert object into an item or category: " << baseobj->getUUID() << LL_ENDL; continue; } } @@ -1281,7 +1281,7 @@ void update_inventory_item( if (!ais_ran) { LLPointer obj = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (update_item ? update_item->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (update_item ? update_item->getName() : "(NOT FOUND)") << LL_ENDL; if(obj) { LLMessageSystem* msg = gMessageSystem; @@ -1323,7 +1323,7 @@ void update_inventory_item( if (!ais_ran) { LLPointer obj = gInventory.getItem(item_id); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL; if(obj) { LLPointer new_item(new LLViewerInventoryItem); @@ -1358,7 +1358,7 @@ void update_inventory_category( LLPointer cb) { LLPointer obj = gInventory.getCategory(cat_id); - LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << llendl; + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] name " << (obj ? obj->getName() : "(NOT FOUND)") << LL_ENDL; if(obj) { if (LLFolderType::lookupIsProtectedType(obj->getPreferredType())) @@ -1421,7 +1421,7 @@ void remove_inventory_item( } else { - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << "(NOT FOUND)" << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << "(NOT FOUND)" << LL_ENDL; } } @@ -1432,7 +1432,7 @@ void remove_inventory_item( if(obj) { const LLUUID item_id(obj->getUUID()); - LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << obj->getName() << llendl; + LL_DEBUGS("Inventory") << "item_id: [" << item_id << "] name " << obj->getName() << LL_ENDL; if (AISCommand::isAPIAvailable()) { LLPointer cmd_ptr = new RemoveItemCommand(item_id, cb); @@ -1461,7 +1461,7 @@ void remove_inventory_item( else { // *TODO: Clean up callback? - llwarns << "remove_inventory_item called for invalid or nonexistent item." << llendl; + LL_WARNS() << "remove_inventory_item called for invalid or nonexistent item." << LL_ENDL; } } @@ -1479,7 +1479,7 @@ public: LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(mID); if(children != LLInventoryModel::CHILDREN_NO) { - llwarns << "remove descendents failed, cannot remove category " << llendl; + LL_WARNS() << "remove descendents failed, cannot remove category " << LL_ENDL; } else { @@ -1495,7 +1495,7 @@ void remove_inventory_category( const LLUUID& cat_id, LLPointer cb) { - LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] " << llendl; + LL_DEBUGS("Inventory") << "cat_id: [" << cat_id << "] " << LL_ENDL; LLPointer obj = gInventory.getCategory(cat_id); if(obj) { @@ -1516,7 +1516,7 @@ void remove_inventory_category( LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(cat_id); if(children != LLInventoryModel::CHILDREN_NO) { - LL_DEBUGS("Inventory") << "Will purge descendents first before deleting category " << cat_id << llendl; + LL_DEBUGS("Inventory") << "Will purge descendents first before deleting category " << cat_id << LL_ENDL; LLPointer wrap_cb = new LLRemoveCategoryOnDestroy(cat_id, cb); purge_descendents_of(cat_id, wrap_cb); return; @@ -1542,7 +1542,7 @@ void remove_inventory_category( } else { - llwarns << "remove_inventory_category called for invalid or nonexistent item " << cat_id << llendl; + LL_WARNS() << "remove_inventory_category called for invalid or nonexistent item " << cat_id << LL_ENDL; } } @@ -1570,7 +1570,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer cb) LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(id); if(children == LLInventoryModel::CHILDREN_NO) { - LL_DEBUGS("Inventory") << "No descendents to purge for " << id << llendl; + LL_DEBUGS("Inventory") << "No descendents to purge for " << id << LL_ENDL; return; } LLPointer cat = gInventory.getCategory(id); @@ -1580,7 +1580,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer cb) { // Something on the clipboard is in "cut mode" and needs to be preserved LL_DEBUGS("Inventory") << "purge_descendents_of clipboard case " << cat->getName() - << " iterate and purge non hidden items" << llendl; + << " iterate and purge non hidden items" << LL_ENDL; LLInventoryModel::cat_array_t* categories; LLInventoryModel::item_array_t* items; // Get the list of direct descendants in tha categoy passed as argument @@ -1615,7 +1615,7 @@ void purge_descendents_of(const LLUUID& id, LLPointer cb) else // no cap { // Fast purge - LL_DEBUGS("Inventory") << "purge_descendents_of fast case " << cat->getName() << llendl; + LL_DEBUGS("Inventory") << "purge_descendents_of fast case " << cat->getName() << LL_ENDL; // send it upstream LLMessageSystem* msg = gMessageSystem; @@ -1744,14 +1744,14 @@ void slam_inventory_folder(const LLUUID& folder_id, if (AISCommand::isAPIAvailable()) { LL_DEBUGS("Avatar") << "using AISv3 to slam folder, id " << folder_id - << " new contents: " << ll_pretty_print_sd(contents) << llendl; + << " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL; LLPointer cmd_ptr = new SlamFolderCommand(folder_id, contents, cb); cmd_ptr->run_command(); } else // no cap { LL_DEBUGS("Avatar") << "using item-by-item calls to slam folder, id " << folder_id - << " new contents: " << ll_pretty_print_sd(contents) << llendl; + << " new contents: " << ll_pretty_print_sd(contents) << LL_ENDL; for (LLSD::array_const_iterator it = contents.beginArray(); it != contents.endArray(); ++it) @@ -1772,9 +1772,9 @@ void remove_folder_contents(const LLUUID& category, bool keep_outfit_links, LLInventoryModel::item_array_t items; gInventory.collectDescendents(category, cats, items, LLInventoryModel::EXCLUDE_TRASH); - for (S32 i = 0; i < items.count(); ++i) + for (S32 i = 0; i < items.size(); ++i) { - LLViewerInventoryItem *item = items.get(i); + LLViewerInventoryItem *item = items.at(i); if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER)) continue; if (item->getIsLinkType()) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index a5cfff177e..44ac93d3de 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -182,14 +182,14 @@ private: { if (!isGoodStatus()) { - llwarns << dumpResponse() - << " [headers:" << getResponseHeaders() << "]" << llendl; + LL_WARNS() << dumpResponse() + << " [headers:" << getResponseHeaders() << "]" << LL_ENDL; } const std::string& media_type = getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE); std::string::size_type idx1 = media_type.find_first_of(";"); std::string mime_type = media_type.substr(0, idx1); - LL_DEBUGS << "status is " << getStatus() << ", media type \"" << media_type << "\"" << LL_ENDL; + LL_DEBUGS() << "status is " << getStatus() << ", media type \"" << media_type << "\"" << LL_ENDL; // 2xx status codes indicate success. // Most 4xx status codes are successful enough for our purposes. @@ -218,7 +218,7 @@ private: } //else //{ - // llwarns << "responder failed with status " << dumpResponse() << llendl; + // LL_WARNS() << "responder failed with status " << dumpResponse() << LL_ENDL; // // if(mMediaImpl) // { diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 7e22b65d4c..fd5df9b774 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -250,7 +250,7 @@ public: private: /* virtual */void httpFailure() { - LL_WARNS2("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; + LL_WARNS("AppInit", "Capabilities") << dumpResponse() << LL_ENDL; LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { @@ -326,7 +326,7 @@ public: private: /* virtual */ void httpFailure() { - llwarns << dumpResponse() << llendl; + LL_WARNS() << dumpResponse() << LL_ENDL; } /* virtual */ void httpSuccess() @@ -334,7 +334,7 @@ private: LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if( !regionp ) { - LL_WARNS2("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; + LL_WARNS("AppInit", "Capabilities") << "Received results for region that no longer exists!" << LL_ENDL; return ; } @@ -353,18 +353,18 @@ private: if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() ) { - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Sim sent duplicate base caps that differ in size from what we initially received - most likely content. " << "mCapabilities == " << regionp->getRegionImpl()->mCapabilities.size() << " mSecondCapabilitiesTracker == " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() << LL_ENDL; #ifdef DEBUG_CAPS_GRANTS - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Initial Base capabilities: " << LL_ENDL; log_capabilities(regionp->getRegionImpl()->mCapabilities); - LL_WARNS2("AppInit", "Capabilities") + LL_WARNS("AppInit", "Capabilities") << "Latest base capabilities: " << LL_ENDL; log_capabilities(regionp->getRegionImpl()->mSecondCapabilitiesTracker); @@ -2809,14 +2809,13 @@ class SimulatorFeaturesReceived : public LLHTTPClient::Responder LOG_CLASS(SimulatorFeaturesReceived); public: SimulatorFeaturesReceived(const std::string& retry_url, U64 region_handle, - S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) -<<<<<<< local + S32 attempt = 0, S32 max_attempts = MAX_CAP_REQUEST_ATTEMPTS) : mRetryURL(retry_url), mRegionHandle(region_handle), mAttempt(attempt), mMaxAttempts(max_attempts) { } /* virtual */ void httpFailure() { - LL_WARNS2("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; + LL_WARNS("AppInit", "SimulatorFeatures") << dumpResponse() << LL_ENDL; retry(); } @@ -2922,7 +2921,7 @@ bool LLViewerRegion::isCapabilityAvailable(const std::string& name) const { if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia"))) { - llwarns << "isCapabilityAvailable called before caps received for " << name << llendl; + LL_WARNS() << "isCapabilityAvailable called before caps received for " << name << LL_ENDL; } CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); @@ -3063,10 +3062,10 @@ void log_capabilities(const CapabilityMap &capmap) { if (!iter->second.empty()) { - llinfos << "log_capabilities: " << iter->first << " URL is " << iter->second << llendl; + LL_INFOS() << "log_capabilities: " << iter->first << " URL is " << iter->second << LL_ENDL; } } - llinfos << "log_capabilities: Dumped " << count << " entries." << llendl; + LL_INFOS() << "log_capabilities: Dumped " << count << " entries." << LL_ENDL; } void LLViewerRegion::resetMaterialsCapThrottle() { diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index fd2fb3695f..f60829e9e8 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -639,7 +639,7 @@ void LLViewerStats::PhaseMap::startPhase(const std::string& phase_name) { LLTimer& timer = getPhaseTimer(phase_name); timer.start(); - //LL_DEBUGS("Avatar") << "startPhase " << phase_name << llendl; + //LL_DEBUGS("Avatar") << "startPhase " << phase_name << LL_ENDL; } void LLViewerStats::PhaseMap::clearPhases() @@ -711,11 +711,11 @@ bool LLViewerStats::PhaseMap::getPhaseValues(const std::string& phase_name, F32& found = true; elapsed = iter->second.getElapsedTimeF32(); completed = !iter->second.getStarted(); - //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << llendl; + //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " elapsed " << elapsed << " completed " << completed << " timer addr " << (S32)(&iter->second) << LL_ENDL; } else { - //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << llendl; + //LL_DEBUGS("Avatar") << " phase_name " << phase_name << " NOT FOUND" << LL_ENDL; } return found; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 28b07feef7..ba89aafc84 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -994,7 +994,7 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { - llwarns << "Unsupported fetch type " << mFTType << llendl; + LL_WARNS() << "Unsupported fetch type " << mFTType << LL_ENDL; } generateGLTexture(); } @@ -1930,19 +1930,19 @@ bool LLViewerFetchedTexture::updateFetch() { if (getFTType() != FTT_MAP_TILE) { - llwarns << mID + LL_WARNS() << mID << " Fetch failure, setting as missing, decode_priority " << decode_priority << " mRawDiscardLevel " << mRawDiscardLevel << " current_discard " << current_discard << " stats " << mLastHttpGetStatus.toHex() - << llendl; + << LL_ENDL; } setIsMissingAsset(); desired_discard = -1; } else { - //llwarns << mID << ": Setting min discard to " << current_discard << llendl; + //LL_WARNS() << mID << ": Setting min discard to " << current_discard << LL_ENDL; if(current_discard >= 0) { mMinDiscardLevel = current_discard; @@ -2134,7 +2134,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) { if (mUrl.empty()) { - llwarns << mID << ": Marking image as missing" << llendl; + LL_WARNS() << mID << ": Marking image as missing" << LL_ENDL; } else { @@ -2143,7 +2143,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) // server bake texture. if (getFTType() != FTT_MAP_TILE) { - llwarns << mUrl << ": Marking image as missing" << llendl; + LL_WARNS() << mUrl << ": Marking image as missing" << LL_ENDL; } } if (mHasFetcher) @@ -2158,7 +2158,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) } else { - llinfos << mID << ": un-flagging missing asset" << llendl; + LL_INFOS() << mID << ": un-flagging missing asset" << LL_ENDL; } mIsMissingAsset = is_missing; } @@ -2211,7 +2211,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call else { // We need aux data, but we've already loaded the image, and it didn't have any - llwarns << "No aux data available for callback for image:" << getID() << llendl; + LL_WARNS() << "No aux data available for callback for image:" << getID() << LL_ENDL; } } mLastCallBackActiveTime = sCurrentTime ; @@ -2385,10 +2385,10 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mFTType == FTT_SERVER_BAKE) { //output some debug info - llinfos << "baked texture: " << mID << "clears all call backs due to inactivity." << llendl; - llinfos << mUrl << llendl; - llinfos << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << - " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << llendl; + LL_INFOS() << "baked texture: " << mID << "clears all call backs due to inactivity." << LL_ENDL; + LL_INFOS() << mUrl << LL_ENDL; + LL_INFOS() << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << + " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << LL_ENDL; } clearCallbackEntryList() ; //remove all callbacks. @@ -2402,8 +2402,8 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mFTType == FTT_SERVER_BAKE) { //output some debug info - llinfos << "baked texture: " << mID << "is missing." << llendl; - llinfos << mUrl << llendl; + LL_INFOS() << "baked texture: " << mID << "is missing." << LL_ENDL; + LL_INFOS() << mUrl << LL_ENDL; } for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f5538efc24..9f42776d78 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1996,10 +1996,10 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU if (url.empty()) { - llwarns << "unable to determine URL for te " << te << " uuid " << uuid << llendl; + LL_WARNS() << "unable to determine URL for te " << te << " uuid " << uuid << LL_ENDL; return NULL; } - LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << llendl; + LL_DEBUGS("Avatar") << avString() << "get server-bake image from URL " << url << LL_ENDL; result = LLViewerTextureManager::getFetchedTextureFromUrl( url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); if (result->isMissingAsset()) @@ -4665,7 +4665,7 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) if (appearance_service_url.empty()) { // Probably a server-side issue if we get here: - llwarns << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << llendl; + LL_WARNS() << "AgentAppearanceServiceURL not set - Baked texture requests will fail" << LL_ENDL; return url; } @@ -4673,7 +4673,7 @@ const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid) if (texture_entry != NULL) { url = appearance_service_url + "texture/" + getID().asString() + "/" + texture_entry->mDefaultImageName + "/" + uuid.asString(); - //llinfos << "baked texture url: " << url << llendl; + //LL_INFOS() << "baked texture url: " << url << LL_ENDL; } return url; } @@ -6055,7 +6055,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color) } else if (global_color == mTexEyeColor) { -// llinfos << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << llendl; +// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL; invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet); } updateMeshTextures(); @@ -6151,7 +6151,7 @@ void LLVOAvatar::startPhase(const std::string& phase_name) bool completed = false; bool found = getPhases().getPhaseValues(phase_name, elapsed, completed); //LL_DEBUGS("Avatar") << avString() << " phase state " << phase_name - // << " found " << found << " elapsed " << elapsed << " completed " << completed << llendl; + // << " found " << found << " elapsed " << elapsed << " completed " << completed << LL_ENDL; if (found) { if (!completed) @@ -7146,7 +7146,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) llassert(appearance_version > 0); if (appearance_version > 1) { - llwarns << "unsupported appearance version " << appearance_version << ", discarding appearance message" << llendl; + LL_WARNS() << "unsupported appearance version " << appearance_version << ", discarding appearance message" << LL_ENDL; return; } @@ -7157,7 +7157,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) { LL_DEBUGS("Avatar") << "this_update_cof_version " << this_update_cof_version << " last_update_request_cof_version " << last_update_request_cof_version - << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << llendl; + << " my_cof_version " << LLAppearanceMgr::instance().getCOFVersion() << LL_ENDL; } else { @@ -7208,14 +7208,14 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) && mBakedTextureDatas[baked_index].mLastTextureID != IMG_DEFAULT && baked_index != BAKED_SKIRT) { - LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << llendl; + LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using mLastTextureID " << mBakedTextureDatas[baked_index].mLastTextureID << LL_ENDL; setTEImage(mBakedTextureDatas[baked_index].mTextureIndex, LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[baked_index].mLastTextureID, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); } else { LL_DEBUGS("Avatar") << avString() << " baked_index " << (S32) baked_index << " using texture id " - << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << llendl; + << getTE(mBakedTextureDatas[baked_index].mTextureIndex)->getID() << LL_ENDL; } } @@ -7256,7 +7256,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) if(is_first_appearance_message) { - //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << llendl; + //LL_DEBUGS("Avatar") << "param slam " << i << " " << newWeight << LL_ENDL; param->setWeight(newWeight); } else @@ -7273,7 +7273,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LL_DEBUGS("Avatar") << "Number of params in AvatarAppearance msg (" << num_params << ") does not match number of tweakable params in avatar xml file (" << expected_tweakable_count << "). Processing what we can. object: " << getID() << LL_ENDL; } - LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << llendl; + LL_DEBUGS("Avatar") << "Changed " << params_changed_count << " params" << LL_ENDL; if (params_changed) { if (interp_params) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 20ef72708c..84e5567d37 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -232,13 +232,13 @@ bool LLVOAvatarSelf::checkStuckAppearance() if (gAgentWearables.isCOFChangeInProgress()) { - LL_DEBUGS("Avatar") << "checking for stuck appearance" << llendl; + LL_DEBUGS("Avatar") << "checking for stuck appearance" << LL_ENDL; F32 change_time = gAgentWearables.getCOFChangeTime(); - LL_DEBUGS("Avatar") << "change in progress for " << change_time << " seconds" << llendl; + LL_DEBUGS("Avatar") << "change in progress for " << change_time << " seconds" << LL_ENDL; S32 active_hp = LLAppearanceMgr::instance().countActiveHoldingPatterns(); - LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << llendl; + LL_DEBUGS("Avatar") << "active holding patterns " << active_hp << " seconds" << LL_ENDL; S32 active_copies = LLAppearanceMgr::instance().getActiveCopyOperations(); - LL_DEBUGS("Avatar") << "active copy operations " << active_copies << llendl; + LL_DEBUGS("Avatar") << "active copy operations " << active_copies << LL_ENDL; if ((change_time > CONDITIONAL_UNSTICK_INTERVAL && active_copies == 0) || (change_time > UNCONDITIONAL_UNSTICK_INTERVAL)) @@ -2526,7 +2526,6 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) } invalidateComposite(layer_set); - LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } else { diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 7f08d42e8b..b61fbbd073 100755 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -81,7 +81,7 @@ void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& weara LLViewerWearable* instance = get_if_there(mList, assetID, (LLViewerWearable*)NULL ); if( instance ) { - LL_DEBUGS("Avatar") << "wearable " << assetID << " found in LLWearableList" << llendl; + LL_DEBUGS("Avatar") << "wearable " << assetID << " found in LLWearableList" << LL_ENDL; asset_arrived_callback( instance, userdata ); } else diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 6ee42d2274..ddb7f7bfce 100755 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -168,13 +168,13 @@ public: const std::string& redir_url = getResponseHeader(HTTP_IN_HEADER_LOCATION); if (redir_url.empty()) { - llwarns << "Received empty redirection URL " << dumpResponse() << llendl; + LL_WARNS() << "Received empty redirection URL " << dumpResponse() << LL_ENDL; LL_DEBUGS("Snapshots") << "[headers:" << getResponseHeaders() << "]" << LL_ENDL; LLWebProfile::reportImageUploadStatus(false); } else { - LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << llendl; + LL_DEBUGS("Snapshots") << "Got redirection URL: " << redir_url << LL_ENDL; LLHTTPClient::get(redir_url, new LLWebProfileResponders::PostImageRedirectResponder, headers); } } diff --git a/indra/newview/llwebsharing.cpp b/indra/newview/llwebsharing.cpp index 7036162014..82615e55fc 100755 --- a/indra/newview/llwebsharing.cpp +++ b/indra/newview/llwebsharing.cpp @@ -82,9 +82,9 @@ public: // Only emit a warning if we failed to parse when 'content-type' == 'application/json' if (!parsed && (HTTP_CONTENT_JSON == getResponseHeader(HTTP_IN_HEADER_CONTENT_TYPE))) { - llwarns << "Failed to deserialize LLSD from JSON response. " << getURL() + LL_WARNS() << "Failed to deserialize LLSD from JSON response. " << getURL() << " [status:" << mStatus << "] " - << "(" << mReason << ") body: " << debug_body << llendl; + << "(" << mReason << ") body: " << debug_body << LL_ENDL; } if (!parsed) -- cgit v1.3