Misc little tidbits from V3.
This commit is contained in:
@@ -1454,12 +1454,9 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
|
||||
}
|
||||
|
||||
case LLSD::TypeUUID:
|
||||
{
|
||||
ostr.put('u');
|
||||
LLUUID d = data.asUUID();
|
||||
ostr.write((const char*)(&(d.mData)), UUID_BYTES);
|
||||
ostr.write((const char*)(&(data.asUUID().mData)), UUID_BYTES);
|
||||
break;
|
||||
}
|
||||
|
||||
case LLSD::TypeString:
|
||||
ostr.put('s');
|
||||
@@ -1512,7 +1509,7 @@ void LLSDBinaryFormatter::formatString(
|
||||
*/
|
||||
int deserialize_string(std::istream& istr, std::string& value, S32 max_bytes)
|
||||
{
|
||||
char c = istr.get();
|
||||
int c = istr.get();
|
||||
if(istr.fail())
|
||||
{
|
||||
// No data in stream, bail out but mention the character we
|
||||
@@ -1554,7 +1551,7 @@ int deserialize_string_delim(
|
||||
|
||||
while (true)
|
||||
{
|
||||
char next_char = istr.get();
|
||||
int next_byte = istr.get();
|
||||
++count;
|
||||
|
||||
if(istr.fail())
|
||||
@@ -1563,6 +1560,8 @@ int deserialize_string_delim(
|
||||
value = write_buffer.str();
|
||||
return LLSDParser::PARSE_FAILURE;
|
||||
}
|
||||
|
||||
char next_char = (char)next_byte; // Now that we know it's not EOF
|
||||
|
||||
if(found_escape)
|
||||
{
|
||||
@@ -1651,7 +1650,7 @@ int deserialize_string_raw(
|
||||
char buf[BUF_LEN]; /* Flawfinder: ignore */
|
||||
istr.get(buf, BUF_LEN - 1, ')');
|
||||
count += istr.gcount();
|
||||
char c = istr.get();
|
||||
int c = istr.get();
|
||||
c = istr.get();
|
||||
count += 2;
|
||||
if(((c == '"') || (c == '\'')) && (buf[0] == '('))
|
||||
|
||||
@@ -957,13 +957,18 @@ LLStringUtil::size_type LLStringUtil::getSubstitution(const std::string& instr,
|
||||
{
|
||||
const std::string delims (",");
|
||||
|
||||
// Find the first ]
|
||||
size_type pos2 = instr.find(']', start);
|
||||
// Find the first [
|
||||
size_type pos1 = instr.find('[', start);
|
||||
if (pos1 == std::string::npos)
|
||||
return std::string::npos;
|
||||
|
||||
//Find the first ] after the initial [
|
||||
size_type pos2 = instr.find(']', pos1);
|
||||
if (pos2 == std::string::npos)
|
||||
return std::string::npos;
|
||||
|
||||
// Find the last [ before ]
|
||||
size_type pos1 = instr.find_last_of('[', pos2-1);
|
||||
// Find the last [ before ] in case of nested [[]]
|
||||
pos1 = instr.find_last_of('[', pos2-1);
|
||||
if (pos1 == std::string::npos || pos1 < start)
|
||||
return std::string::npos;
|
||||
|
||||
|
||||
@@ -202,9 +202,9 @@ void LLWorkerThread::WorkRequest::finishRequest(bool completed)
|
||||
|
||||
LLWorkerClass::LLWorkerClass(LLWorkerThread* workerthread, const std::string& name)
|
||||
: mWorkerThread(workerthread),
|
||||
mRequestPriority(LLWorkerThread::PRIORITY_NORMAL),
|
||||
mWorkerClassName(name),
|
||||
mRequestHandle(LLWorkerThread::nullHandle()),
|
||||
mRequestPriority(LLWorkerThread::PRIORITY_NORMAL),
|
||||
mWorkFlags(0)
|
||||
{
|
||||
if (!mWorkerThread)
|
||||
|
||||
@@ -109,6 +109,7 @@ const U64 GP_LAND_ALLOW_FLY = 0x1 << 24; // Bypass Fly Restriction
|
||||
const U64 GP_LAND_ALLOW_CREATE = 0x1 << 25; // Bypass Create/Edit Objects Restriction
|
||||
const U64 GP_LAND_ALLOW_LANDMARK = 0x1 << 26; // Bypass Landmark Restriction
|
||||
const U64 GP_LAND_ALLOW_SET_HOME = 0x1 << 28; // Bypass Set Home Point Restriction
|
||||
const U64 GP_LAND_ALLOW_HOLD_EVENT = 0x1LL << 41; // Allowed to hold events on group-owned land
|
||||
|
||||
// Parcel Access
|
||||
const U64 GP_LAND_MANAGE_ALLOWED = 0x1 << 29; // Manage Allowed List
|
||||
|
||||
@@ -495,7 +495,8 @@ bool LLTextureCacheRemoteWorker::doRead()
|
||||
mReadData = data;
|
||||
|
||||
// Read the data at last
|
||||
S32 bytes_read = LLAPRFile::readEx(filename, mReadData + data_offset,
|
||||
S32 bytes_read = LLAPRFile::readEx(filename,
|
||||
mReadData + data_offset,
|
||||
file_offset, file_size);
|
||||
if (bytes_read != file_size)
|
||||
{
|
||||
@@ -646,7 +647,9 @@ bool LLTextureCacheRemoteWorker::doWrite()
|
||||
// build the cache file name from the UUID
|
||||
std::string filename = mCache->getTextureFileName(mID);
|
||||
// llinfos << "Writing Body: " << filename << " Bytes: " << file_offset+file_size << llendl;
|
||||
S32 bytes_written = LLAPRFile::writeEx(filename, mWriteData + TEXTURE_CACHE_ENTRY_SIZE, 0, file_size);
|
||||
S32 bytes_written = LLAPRFile::writeEx( filename,
|
||||
mWriteData + TEXTURE_CACHE_ENTRY_SIZE,
|
||||
0, file_size);
|
||||
if (bytes_written <= 0)
|
||||
{
|
||||
llwarns << "LLTextureCacheWorker: " << mID
|
||||
|
||||
@@ -59,7 +59,12 @@ private:
|
||||
};
|
||||
struct Entry
|
||||
{
|
||||
Entry() : mBodySize(0), mImageSize(0), mTime(0) { }
|
||||
Entry() :
|
||||
mBodySize(0),
|
||||
mImageSize(0),
|
||||
mTime(0)
|
||||
{
|
||||
}
|
||||
Entry(const LLUUID& id, S32 imagesize, S32 bodysize, U32 time) :
|
||||
mID(id), mImageSize(imagesize), mBodySize(bodysize), mTime(time) {}
|
||||
void init(const LLUUID& id, U32 time) { mID = id, mImageSize = 0; mBodySize = 0; mTime = time; }
|
||||
|
||||
@@ -625,16 +625,20 @@ void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
|
||||
S32 num_entries;
|
||||
success = check_read(&apr_file, &num_entries, sizeof(S32)) ;
|
||||
|
||||
for (S32 i = 0; success && i < num_entries; i++)
|
||||
if(success)
|
||||
{
|
||||
LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file);
|
||||
if (!entry->getLocalID())
|
||||
for (S32 i = 0; i < num_entries; i++)
|
||||
{
|
||||
llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl;
|
||||
delete entry ;
|
||||
success = false ;
|
||||
LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file);
|
||||
if (!entry->getLocalID())
|
||||
{
|
||||
llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl;
|
||||
delete entry ;
|
||||
success = false ;
|
||||
break ;
|
||||
}
|
||||
cache_entry_map[entry->getLocalID()] = entry;
|
||||
}
|
||||
cache_entry_map[entry->getLocalID()] = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user