From ac50379957b3f8bf03f0604dc3319c14e73ce657 Mon Sep 17 00:00:00 2001
From: callum <none@none>
Date: Thu, 12 Apr 2012 11:55:37 -0700
Subject: [PATCH] SH-3065 FIX Investigate fixes for out-of-order operations on
 startup Reviewed by Simon

---
 indra/newview/llavatarpropertiesprocessor.cpp | 9 +++++++++
 indra/newview/lltexturefetch.cpp              | 9 ++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp
index b1cd83a1fba..706bc42ea07 100644
--- a/indra/newview/llavatarpropertiesprocessor.cpp
+++ b/indra/newview/llavatarpropertiesprocessor.cpp
@@ -33,6 +33,7 @@
 #include "llagentpicksinfo.h"
 #include "lldateutil.h"
 #include "llviewergenericmessage.h"
+#include "llstartup.h"
 
 // Linden library includes
 #include "llavatarconstants.h"	// AVATAR_TRANSACTED, etc.
@@ -113,6 +114,14 @@ void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, EA
 
 void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequest(const LLUUID& avatar_id)
 {
+	// this is the startup state when send_complete_agent_movement() message is sent.
+	// Before this, the AvatarPropertiesRequest message  
+	// won't work so don't bother trying
+	if (LLStartUp::getStartupState() <= STATE_AGENT_SEND)
+	{
+		return;
+	}
+
 	if (isPendingRequest(avatar_id, APT_PROPERTIES))
 	{
 		// waiting for a response, don't re-request
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index e27ebf90188..5cc8de3d916 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -53,6 +53,7 @@
 #include "llviewerassetstats.h"
 #include "llworld.h"
 #include "llsdutil.h"
+#include "llstartup.h"
 
 LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128);
 LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128);
@@ -2238,7 +2239,13 @@ S32 LLTextureFetch::update(F32 max_time_ms)
 	
 	if (!mDebugPause)
 	{
-		sendRequestListToSimulators();
+		// this is the startup state when send_complete_agent_movement() message is sent.
+		// Before this, the RequestImages message sent by sendRequestListToSimulators 
+		// won't work so don't bother trying
+		if (LLStartUp::getStartupState() > STATE_AGENT_SEND)
+		{
+			sendRequestListToSimulators();
+		}
 	}
 
 	if (!mThreaded)
-- 
GitLab