MAINT-4653 WIP, DRTVWR-397 WIP - log output to file now includes tags. Request max 5 attachments per idle loop to reduce sim-side failures seen when requesting large numbers.

master
Brad Payne (Vir Linden) 2015-04-22 16:09:02 -04:00
parent d516a8729e
commit 4d689fc515
4 changed files with 42 additions and 36 deletions

View File

@ -119,6 +119,7 @@ namespace {
LL_INFOS() << "Error setting log file to " << filename << LL_ENDL;
}
mWantsTime = true;
mWantsTags = true;
}
~RecordToFile()
@ -558,7 +559,7 @@ namespace LLError
mFunctionString += std::string(mFunction) + ":";
for (size_t i = 0; i < mTagCount; i++)
{
mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : " ");
mTagString += std::string("#") + mTags[i] + ((i == mTagCount - 1) ? "" : ",");
}
}
@ -931,14 +932,19 @@ namespace
}
if (show_level && r->wantsLevel())
{
message_stream << site.mLevelString << " ";
}
{
message_stream << site.mLevelString;
}
if (show_tags && r->wantsTags())
{
message_stream << site.mTagString << " ";
message_stream << site.mTagString;
}
if ((show_level && r->wantsLevel())||
(show_tags && r->wantsTags()))
{
message_stream << " ";
}
if (show_function && r->wantsFunctionName())
{

View File

@ -117,7 +117,6 @@ void LLAttachmentsMgr::requestPendingAttachments()
if (mPendingAttachments.size())
{
requestAttachments(mPendingAttachments);
mPendingAttachments.clear();
}
}
@ -125,7 +124,7 @@ void LLAttachmentsMgr::requestPendingAttachments()
// request at most 40 attachments and the rest will be
// ignored. Currently the max attachments per avatar is 38, so the 40
// limit should not be hit in practice.
void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_requests)
void LLAttachmentsMgr::requestAttachments(attachments_vec_t& attachment_requests)
{
// Make sure we got a region before trying anything else
if( !gAgent.getRegion() )
@ -133,7 +132,8 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re
return;
}
S32 obj_count = attachment_requests.size();
const S32 max_objects_per_request = 5;
S32 obj_count = llmin((S32)attachment_requests.size(),max_objects_per_request);
if (obj_count == 0)
{
return;
@ -145,7 +145,7 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re
const S32 MAX_OBJECTS_TO_SEND = MAX_PACKETS_TO_SEND * OBJECTS_PER_PACKET;
if( obj_count > MAX_OBJECTS_TO_SEND )
{
LL_WARNS() << "ATT Too many attachments requested: " << attachment_requests.size()
LL_WARNS() << "ATT Too many attachments requested: " << obj_count
<< " exceeds limit of " << MAX_OBJECTS_TO_SEND << LL_ENDL;
LL_WARNS() << "ATT Excess requests will be ignored" << LL_ENDL;
@ -159,12 +159,10 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re
compound_msg_id.generate();
LLMessageSystem* msg = gMessageSystem;
S32 i = 0;
for (attachments_vec_t::const_iterator iter = attachment_requests.begin();
iter != attachment_requests.end();
++iter)
{
// by construction, obj_count <= attachment_requests.size(), so no
// check against empty() is needed here.
for (S32 i=0; i<obj_count; i++)
{
if( 0 == (i % OBJECTS_PER_PACKET) )
{
// Start a new message chunk
@ -178,33 +176,35 @@ void LLAttachmentsMgr::requestAttachments(const attachments_vec_t& attachment_re
msg->addBOOLFast(_PREHASH_FirstDetachAll, false );
}
const AttachmentsInfo &attachment = (*iter);
const AttachmentsInfo& attachment = attachment_requests.front();
LLViewerInventoryItem* item = gInventory.getItem(attachment.mItemID);
if (!item)
if (item)
{
LL_DEBUGS("Avatar") << "ATT requesting from attachment_requests " << item->getName()
<< " " << item->getLinkedUUID() << LL_ENDL;
S32 attachment_pt = attachment.mAttachmentPt;
if (attachment.mAdd)
attachment_pt |= ATTACHMENT_ADD;
msg->nextBlockFast(_PREHASH_ObjectData );
msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner());
msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt);
pack_permissions_slam(msg, item->getFlags(), item->getPermissions());
msg->addStringFast(_PREHASH_Name, item->getName());
msg->addStringFast(_PREHASH_Description, item->getDescription());
}
else
{
LL_INFOS() << "Attempted to add non-existent item ID:" << attachment.mItemID << LL_ENDL;
continue;
LL_INFOS("Avatar") << "ATT Attempted to add non-existent item ID:" << attachment.mItemID << LL_ENDL;
}
LL_DEBUGS("Avatar") << "ATT requesting from attachment_requests " << item->getName()
<< " " << item->getLinkedUUID() << LL_ENDL;
S32 attachment_pt = attachment.mAttachmentPt;
if (attachment.mAdd)
attachment_pt |= ATTACHMENT_ADD;
msg->nextBlockFast(_PREHASH_ObjectData );
msg->addUUIDFast(_PREHASH_ItemID, item->getLinkedUUID());
msg->addUUIDFast(_PREHASH_OwnerID, item->getPermissions().getOwner());
msg->addU8Fast(_PREHASH_AttachmentPt, attachment_pt);
pack_permissions_slam(msg, item->getFlags(), item->getPermissions());
msg->addStringFast(_PREHASH_Name, item->getName());
msg->addStringFast(_PREHASH_Description, item->getDescription());
if( (i+1 == obj_count) || ((OBJECTS_PER_PACKET-1) == (i % OBJECTS_PER_PACKET)) )
{
// End of message chunk
msg->sendReliable( gAgent.getRegion()->getHost() );
}
i++;
attachment_requests.pop_front();
}
}

View File

@ -70,7 +70,7 @@ public:
U8 mAttachmentPt;
BOOL mAdd;
};
typedef std::vector<AttachmentsInfo> attachments_vec_t;
typedef std::deque<AttachmentsInfo> attachments_vec_t;
LLAttachmentsMgr();
virtual ~LLAttachmentsMgr();
@ -79,7 +79,7 @@ public:
const U8 attachment_pt,
const BOOL add);
void onAttachmentRequested(const LLUUID& item_id);
void requestAttachments(const attachments_vec_t& attachment_requests);
void requestAttachments(attachments_vec_t& attachment_requests);
static void onIdle(void *);
void onAttachmentArrived(const LLUUID& inv_item_id);

View File

@ -732,7 +732,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job
mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim );
LL_DEBUGS("Avatar") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL;
LL_DEBUGS("Avatar","Message") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL;
mPelvisp = NULL;