Commit bf0491ff authored by Kitty Barnett's avatar Kitty Barnett
Browse files

Merged with default tip (Revision 241a5b4e3503)

--HG--
branch : Viewer-Build
parents 490bfd2b 71b199bd
529a80ebe5bef90841727e65eb2dd5e9875ab23a
\ No newline at end of file
241a5b4e35031f0e73033ae57b1b294a47733888
\ No newline at end of file
......@@ -537,6 +537,7 @@ ad0e15543836d64d6399d28b32852510435e344a 5.1.0-release
7c00e5b6cb3d95712e9d8e29277c805bca2bda90 5.1.3-release
7b6b020fd5ad9a8dc3670c5c92d1ca92e55fc485 5.1.4-release
2ea47f358b171178eb9a95503a1670d519c2886f 5.1.5-release
04538b8157c1f5cdacd9403f0a395452d4a93689 5.1.6-release
0000000000000000000000000000000000000000 v2start
0000000000000000000000000000000000000000 alpha-3
0000000000000000000000000000000000000000 fork to viewer-2-0
......@@ -1077,6 +1078,7 @@ ad0e15543836d64d6399d28b32852510435e344a 5.1.0-release
0000000000000000000000000000000000000000 5.1.3-release
0000000000000000000000000000000000000000 5.1.4-release
0000000000000000000000000000000000000000 5.1.5-release
0000000000000000000000000000000000000000 5.1.6-release
4f777ffb99fefdc6497c61385c22688ff149c659 SL-2.0.0
668851b2ef0f8cf8df07a0fba429e4a6c1e70abb SL-2.0.1
b03065d018b8a2e28b7de85b293a4c992cb4c12d SL-2.1.0
......@@ -1203,3 +1205,4 @@ ad0e15543836d64d6399d28b32852510435e344a SL-5.1.0
7c00e5b6cb3d95712e9d8e29277c805bca2bda90 SL-5.1.3
7b6b020fd5ad9a8dc3670c5c92d1ca92e55fc485 SL-5.1.4
2ea47f358b171178eb9a95503a1670d519c2886f SL-5.1.5
04538b8157c1f5cdacd9403f0a395452d4a93689 SL-5.1.6
......@@ -3260,9 +3260,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>4aefe12a3825d1b4b8370986d84792a2</string>
<string>86f6708f393c162cd4f92426b0a3cde7</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/15295/98583/viewer_manager-1.0.513540-darwin64-513540.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/15341/99062/viewer_manager-1.0.513570-darwin64-513570.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
......@@ -3284,9 +3284,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>db96bc8a83e6577d31657586100bfc35</string>
<string>c4dec51062ad78c09b11f7432aff4d1d</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/15298/98589/viewer_manager-1.0.513540-windows-513540.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/17857/121832/viewer_manager-1.0.515286-windows-515286.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
......@@ -3297,7 +3297,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>source_type</key>
<string>hg</string>
<key>version</key>
<string>1.0.513540</string>
<string>1.0.515286</string>
</map>
<key>vlc-bin</key>
<map>
......
......@@ -220,6 +220,7 @@ Ansariel Hiller
STORM-2151
MAINT-6917
MAINT-8085
STORM-2122
Aralara Rajal
Arare Chantilly
CHUIBUG-191
......
......@@ -184,7 +184,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
{
LLTexLayerSet *layer_set = NULL;
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te);
if (texture_dict->mIsUsedByBakedTexture)
if (texture_dict && texture_dict->mIsUsedByBakedTexture)
{
const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
......@@ -197,7 +197,7 @@ void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
}
else
{
LL_ERRS() << "could not find layerset for LTO in wearable!" << LL_ENDL;
LL_WARNS() << "could not find layerset for LTO in wearable!" << LL_ENDL;
}
}
......@@ -437,7 +437,13 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
LL_WARNS() << "Bad Wearable asset: bad texture, #" << i << LL_ENDL;
return LLWearable::FAILURE;
}
if (te >= ETextureIndex::TEX_NUM_INDICES) //createLayers() converts to ETextureIndex
{
LL_WARNS() << "Bad Wearable asset: bad texture index: " << te << LL_ENDL;
return LLWearable::FAILURE;
}
if( !LLUUID::validate( uuid_buffer ) )
{
LL_WARNS() << "Bad Wearable asset: bad texture uuid: "
......
......@@ -258,7 +258,7 @@ int LLFile::remove(const std::string& filename, int supress_error)
return warnif("remove", filename, rc, supress_error);
}
int LLFile::rename(const std::string& filename, const std::string& newname)
int LLFile::rename(const std::string& filename, const std::string& newname, int supress_error)
{
#if LL_WINDOWS
std::string utf8filename = filename;
......@@ -269,7 +269,7 @@ int LLFile::rename(const std::string& filename, const std::string& newname)
#else
int rc = ::rename(filename.c_str(),newname.c_str());
#endif
return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc);
return warnif(STRINGIZE("rename to '" << newname << "' from"), filename, rc, supress_error);
}
bool LLFile::copy(const std::string from, const std::string to)
......
......@@ -74,7 +74,7 @@ public:
static int rmdir(const std::string& filename);
static int remove(const std::string& filename, int supress_error = 0);
static int rename(const std::string& filename,const std::string& newname);
static int rename(const std::string& filename,const std::string& newname, int supress_error = 0);
static bool copy(const std::string from, const std::string to);
static int stat(const std::string& filename,llstat* file_status);
......
......@@ -513,19 +513,20 @@ namespace tut
const std::string& msg,
const std::string& in,
const LLSD& expected_value,
S32 expected_count)
S32 expected_count,
S32 depth_limit = -1)
{
std::stringstream input;
input.str(in);
LLSD parsed_result;
mParser->reset(); // reset() call is needed since test code re-uses mParser
S32 parsed_count = mParser->parse(input, parsed_result, in.size());
S32 parsed_count = mParser->parse(input, parsed_result, in.size(), depth_limit);
ensure_equals(msg.c_str(), parsed_result, expected_value);
// This count check is really only useful for expected
// parse failures, since the ensures equal will already
// require eqality.
// require equality.
std::string count_msg(msg);
count_msg += " (count)";
ensure_equals(count_msg, parsed_count, expected_count);
......@@ -714,6 +715,43 @@ namespace tut
expected,
1);
}
template<> template<>
void TestLLSDXMLParsingObject::test<5>()
{
// test deeper nested levels
LLSD level_5 = LLSD::emptyMap(); level_5["level_5"] = 42.f;
LLSD level_4 = LLSD::emptyMap(); level_4["level_4"] = level_5;
LLSD level_3 = LLSD::emptyMap(); level_3["level_3"] = level_4;
LLSD level_2 = LLSD::emptyMap(); level_2["level_2"] = level_3;
LLSD level_1 = LLSD::emptyMap(); level_1["level_1"] = level_2;
LLSD level_0 = LLSD::emptyMap(); level_0["level_0"] = level_1;
LLSD v;
v["deep"] = level_0;
ensureParse(
"deep llsd xml map",
"<llsd><map>"
"<key>deep</key><map>"
"<key>level_0</key><map>"
"<key>level_1</key><map>"
"<key>level_2</key><map>"
"<key>level_3</key><map>"
"<key>level_4</key><map>"
"<key>level_5</key><real>42.0</real>"
"</map>"
"</map>"
"</map>"
"</map>"
"</map>"
"</map>"
"</map></llsd>",
v,
8);
}
/*
TODO:
test XML parsing
......@@ -975,6 +1013,146 @@ namespace tut
LLSDParser::PARSE_FAILURE);
}
template<> template<>
void TestLLSDNotationParsingObject::test<18>()
{
LLSD level_1 = LLSD::emptyMap(); level_1["level_2"] = 99;
LLSD level_0 = LLSD::emptyMap(); level_0["level_1"] = level_1;
LLSD deep = LLSD::emptyMap();
deep["level_0"] = level_0;
LLSD root = LLSD::emptyMap();
root["deep"] = deep;
ensureParse(
"nested notation 3 deep",
"{'deep' : {'level_0':{'level_1':{'level_2': i99} } } }",
root,
5,
5); // 4 '{' plus i99 also counts as llsd, so real depth is 5
}
template<> template<>
void TestLLSDNotationParsingObject::test<19>()
{
LLSD level_9 = LLSD::emptyMap(); level_9["level_9"] = (S32)99;
LLSD level_8 = LLSD::emptyMap(); level_8["level_8"] = level_9;
LLSD level_7 = LLSD::emptyMap(); level_7["level_7"] = level_8;
LLSD level_6 = LLSD::emptyMap(); level_6["level_6"] = level_7;
LLSD level_5 = LLSD::emptyMap(); level_5["level_5"] = level_6;
LLSD level_4 = LLSD::emptyMap(); level_4["level_4"] = level_5;
LLSD level_3 = LLSD::emptyMap(); level_3["level_3"] = level_4;
LLSD level_2 = LLSD::emptyMap(); level_2["level_2"] = level_3;
LLSD level_1 = LLSD::emptyMap(); level_1["level_1"] = level_2;
LLSD level_0 = LLSD::emptyMap(); level_0["level_0"] = level_1;
LLSD deep = LLSD::emptyMap();
deep["deep"] = level_0;
ensureParse(
"nested notation 10 deep",
"{'deep' : {'level_0':{'level_1':{'level_2':{'level_3':{'level_4':{'level_5':{'level_6':{'level_7':{'level_8':{'level_9':i99}"
"} } } } } } } } } }",
deep,
12,
15);
}
template<> template<>
void TestLLSDNotationParsingObject::test<20>()
{
LLSD end = LLSD::emptyMap(); end["end"] = (S32)99;
LLSD level_49 = LLSD::emptyMap(); level_49["level_49"] = end;
LLSD level_48 = LLSD::emptyMap(); level_48["level_48"] = level_49;
LLSD level_47 = LLSD::emptyMap(); level_47["level_47"] = level_48;
LLSD level_46 = LLSD::emptyMap(); level_46["level_46"] = level_47;
LLSD level_45 = LLSD::emptyMap(); level_45["level_45"] = level_46;
LLSD level_44 = LLSD::emptyMap(); level_44["level_44"] = level_45;
LLSD level_43 = LLSD::emptyMap(); level_43["level_43"] = level_44;
LLSD level_42 = LLSD::emptyMap(); level_42["level_42"] = level_43;
LLSD level_41 = LLSD::emptyMap(); level_41["level_41"] = level_42;
LLSD level_40 = LLSD::emptyMap(); level_40["level_40"] = level_41;
LLSD level_39 = LLSD::emptyMap(); level_39["level_39"] = level_40;
LLSD level_38 = LLSD::emptyMap(); level_38["level_38"] = level_39;
LLSD level_37 = LLSD::emptyMap(); level_37["level_37"] = level_38;
LLSD level_36 = LLSD::emptyMap(); level_36["level_36"] = level_37;
LLSD level_35 = LLSD::emptyMap(); level_35["level_35"] = level_36;
LLSD level_34 = LLSD::emptyMap(); level_34["level_34"] = level_35;
LLSD level_33 = LLSD::emptyMap(); level_33["level_33"] = level_34;
LLSD level_32 = LLSD::emptyMap(); level_32["level_32"] = level_33;
LLSD level_31 = LLSD::emptyMap(); level_31["level_31"] = level_32;
LLSD level_30 = LLSD::emptyMap(); level_30["level_30"] = level_31;
LLSD level_29 = LLSD::emptyMap(); level_29["level_29"] = level_30;
LLSD level_28 = LLSD::emptyMap(); level_28["level_28"] = level_29;
LLSD level_27 = LLSD::emptyMap(); level_27["level_27"] = level_28;
LLSD level_26 = LLSD::emptyMap(); level_26["level_26"] = level_27;
LLSD level_25 = LLSD::emptyMap(); level_25["level_25"] = level_26;
LLSD level_24 = LLSD::emptyMap(); level_24["level_24"] = level_25;
LLSD level_23 = LLSD::emptyMap(); level_23["level_23"] = level_24;
LLSD level_22 = LLSD::emptyMap(); level_22["level_22"] = level_23;
LLSD level_21 = LLSD::emptyMap(); level_21["level_21"] = level_22;
LLSD level_20 = LLSD::emptyMap(); level_20["level_20"] = level_21;
LLSD level_19 = LLSD::emptyMap(); level_19["level_19"] = level_20;
LLSD level_18 = LLSD::emptyMap(); level_18["level_18"] = level_19;
LLSD level_17 = LLSD::emptyMap(); level_17["level_17"] = level_18;
LLSD level_16 = LLSD::emptyMap(); level_16["level_16"] = level_17;
LLSD level_15 = LLSD::emptyMap(); level_15["level_15"] = level_16;
LLSD level_14 = LLSD::emptyMap(); level_14["level_14"] = level_15;
LLSD level_13 = LLSD::emptyMap(); level_13["level_13"] = level_14;
LLSD level_12 = LLSD::emptyMap(); level_12["level_12"] = level_13;
LLSD level_11 = LLSD::emptyMap(); level_11["level_11"] = level_12;
LLSD level_10 = LLSD::emptyMap(); level_10["level_10"] = level_11;
LLSD level_9 = LLSD::emptyMap(); level_9["level_9"] = level_10;
LLSD level_8 = LLSD::emptyMap(); level_8["level_8"] = level_9;
LLSD level_7 = LLSD::emptyMap(); level_7["level_7"] = level_8;
LLSD level_6 = LLSD::emptyMap(); level_6["level_6"] = level_7;
LLSD level_5 = LLSD::emptyMap(); level_5["level_5"] = level_6;
LLSD level_4 = LLSD::emptyMap(); level_4["level_4"] = level_5;
LLSD level_3 = LLSD::emptyMap(); level_3["level_3"] = level_4;
LLSD level_2 = LLSD::emptyMap(); level_2["level_2"] = level_3;
LLSD level_1 = LLSD::emptyMap(); level_1["level_1"] = level_2;
LLSD level_0 = LLSD::emptyMap(); level_0["level_0"] = level_1;
LLSD deep = LLSD::emptyMap();
deep["deep"] = level_0;
ensureParse(
"nested notation deep",
"{'deep':"
"{'level_0' :{'level_1' :{'level_2' :{'level_3' :{'level_4' :{'level_5' :{'level_6' :{'level_7' :{'level_8' :{'level_9' :"
"{'level_10':{'level_11':{'level_12':{'level_13':{'level_14':{'level_15':{'level_16':{'level_17':{'level_18':{'level_19':"
"{'level_20':{'level_21':{'level_22':{'level_23':{'level_24':{'level_25':{'level_26':{'level_27':{'level_28':{'level_29':"
"{'level_30':{'level_31':{'level_32':{'level_33':{'level_34':{'level_35':{'level_36':{'level_37':{'level_38':{'level_39':"
"{'level_40':{'level_41':{'level_42':{'level_43':{'level_44':{'level_45':{'level_46':{'level_47':{'level_48':{'level_49':"
"{'end':i99}"
"} } } } } } } } } }"
"} } } } } } } } } }"
"} } } } } } } } } }"
"} } } } } } } } } }"
"} } } } } } } } } }"
"}",
deep,
53);
}
template<> template<>
void TestLLSDNotationParsingObject::test<21>()
{
ensureParse(
"nested notation 10 deep",
"{'deep' : {'level_0':{'level_1':{'level_2':{'level_3':{'level_4':{'level_5':{'level_6':{'level_7':{'level_8':{'level_9':i99}"
"} } } } } } } } } }",
LLSD(),
LLSDParser::PARSE_FAILURE,
9);
}
/**
* @class TestLLSDBinaryParsing
* @brief Concrete instance of a parse tester.
......
......@@ -51,98 +51,6 @@ const std::string INTERACTIVE_SYSTEM_FROM("F387446C-37C4-45f2-A438-D99CBDBB563B"
const S32 IM_TTL = 1;
/**
* LLIMInfo
*/
LLIMInfo::LLIMInfo() :
mFromGroup(FALSE),
mParentEstateID(0),
mOffline(0),
mViewerThinksToIsOnline(false),
mIMType(IM_NOTHING_SPECIAL),
mTimeStamp(0),
mTTL(IM_TTL)
{
}
LLIMInfo::LLIMInfo(
const LLUUID& from_id,
BOOL from_group,
const LLUUID& to_id,
EInstantMessage im_type,
const std::string& name,
const std::string& message,
const LLUUID& id,
U32 parent_estate_id,
const LLUUID& region_id,
const LLVector3& position,
LLSD data,
U8 offline,
U32 timestamp,
S32 ttl) :
mFromID(from_id),
mFromGroup(from_group),
mToID(to_id),
mParentEstateID(0),
mRegionID(region_id),
mPosition(position),
mOffline(offline),
mViewerThinksToIsOnline(false),
mIMType(im_type),
mID(id),
mTimeStamp(timestamp),
mName(name),
mMessage(message),
mData(data),
mTTL(ttl)
{
}
LLIMInfo::LLIMInfo(LLMessageSystem* msg, S32 ttl) :
mViewerThinksToIsOnline(false),
mTTL(ttl)
{
unpackMessageBlock(msg);
}
LLIMInfo::~LLIMInfo()
{
}
void LLIMInfo::packInstantMessage(LLMessageSystem* msg) const
{
LL_DEBUGS() << "LLIMInfo::packInstantMessage()" << LL_ENDL;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
packMessageBlock(msg);
}
void LLIMInfo::packMessageBlock(LLMessageSystem* msg) const
{
// Construct binary bucket
std::vector<U8> bucket;
if (mData.has("binary_bucket"))
{
bucket = mData["binary_bucket"].asBinary();
}
pack_instant_message_block(
msg,
mFromID,
mFromGroup,
LLUUID::null,
mToID,
mName,
mMessage,
mOffline,
mIMType,
mID,
mParentEstateID,
mRegionID,
mPosition,
mTimeStamp,
&bucket[0],
bucket.size());
}
void pack_instant_message(
LLMessageSystem* msg,
const LLUUID& from_id,
......@@ -253,120 +161,4 @@ void pack_instant_message_block(
msg->addBinaryDataFast(_PREHASH_BinaryBucket, bb, binary_bucket_size);
}
void LLIMInfo::unpackMessageBlock(LLMessageSystem* msg)
{
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, mFromID);
msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, mFromGroup);
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ToAgentID, mToID);
msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_ParentEstateID, mParentEstateID);
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_RegionID, mRegionID);
msg->getVector3Fast(_PREHASH_MessageBlock, _PREHASH_Position, mPosition);
msg->getU8Fast(_PREHASH_MessageBlock, _PREHASH_Offline, mOffline);
U8 dialog;
msg->getU8Fast(_PREHASH_MessageBlock, _PREHASH_Dialog, dialog);
mIMType = (EInstantMessage) dialog;
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID);
msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp);
msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, mName);
msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, mMessage);
S32 binary_bucket_size = llmin(
MTUBYTES,
msg->getSizeFast(
_PREHASH_MessageBlock,
_PREHASH_BinaryBucket));
if(binary_bucket_size > 0)
{
std::vector<U8> bucket;
bucket.resize(binary_bucket_size);
msg->getBinaryDataFast(
_PREHASH_MessageBlock,
_PREHASH_BinaryBucket,
&bucket[0],
0,
0,
binary_bucket_size);
mData["binary_bucket"] = bucket;
}
else
{
mData.clear();
}
}
LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info)
{
LLSD param_version;
param_version["version"] = 1;
LLSD param_message;
param_message["from_id"] = im_info->mFromID;
param_message["from_group"] = im_info->mFromGroup;
param_message["to_id"] = im_info->mToID;
param_message["from_name"] = im_info->mName;
param_message["message"] = im_info->mMessage;
param_message["type"] = (S32)im_info->mIMType;
param_message["id"] = im_info->mID;
param_message["timestamp"] = (S32)im_info->mTimeStamp;
param_message["offline"] = (S32)im_info->mOffline;
param_message["parent_estate_id"] = (S32)im_info->mParentEstateID;
param_message["region_id"] = im_info->mRegionID;
param_message["position"] = ll_sd_from_vector3(im_info->mPosition);
param_message["data"] = im_info->mData;
param_message["ttl"] = im_info->mTTL;
LLSD param_agent;
param_agent["agent_id"] = im_info->mFromID;
LLSD params;
params["version_params"] = param_version;
params["message_params"] = param_message;
params["agent_params"] = param_agent;
return params;
}
LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd)
{
LLSD param_message = im_info_sd["message_params"];
LLSD param_agent = im_info_sd["agent_params"];
LLPointer<LLIMInfo> im_info = new LLIMInfo(
param_message["from_id"].asUUID(),
param_message["from_group"].asBoolean(),
param_message["to_id"].asUUID(),
(EInstantMessage) param_message["type"].asInteger(),
param_message["from_name"].asString(),
param_message["message"].asString(),
param_message["id"].asUUID(),
(U32) param_message["parent_estate_id"].asInteger(),
param_message["region_id"].asUUID(),
ll_vector3_from_sd(param_message["position"]),
param_message["data"],
(U8) param_message["offline"].asInteger(),
(U32) param_message["timestamp"].asInteger(),
param_message["ttl"].asInteger());
return im_info;
}
LLPointer<LLIMInfo> LLIMInfo::clone()
{
return new LLIMInfo(
mFromID,
mFromGroup,
mToID,
mIMType,
mName,
mMessage,
mID,
mParentEstateID,
mRegionID,
mPosition,
mData,
mOffline,
mTimeStamp,
mTTL);
}
......@@ -177,59 +177,6 @@ extern const std::string INTERACTIVE_SYSTEM_FROM;
// Number of retry attempts on sending the im.
extern const S32 IM_TTL;
class LLIMInfo : public LLRefCount
{
protected:
LLIMInfo();
~LLIMInfo();
public:
LLIMInfo(LLMessageSystem* msg,
S32 ttl = IM_TTL);
LLIMInfo(
const LLUUID& from_id,
BOOL from_group,
const LLUUID& to_id,
EInstantMessage im_type,
const std::string& name,
const std::string& message,
const LLUUID& id,
U32 parent_estate_id,
const LLUUID& region_id,
const LLVector3& position,
LLSD data,
U8 offline,
U32 timestamp,
S32 ttl = IM_TTL);