master
Beq 2017-11-28 18:35:01 +00:00
commit bf4e92ffc3
4 changed files with 40 additions and 23 deletions

View File

@ -2,7 +2,7 @@
include(Prebuilt)
set(JSONCPP_FIND_QUIETLY ON)
set(JSONCPP_FIND_QUIETLY OFF)
set(JSONCPP_FIND_REQUIRED ON)
if (USESYSTEMLIBS)

View File

@ -61,19 +61,19 @@ public:
/// Pipelined: no
AP_DEFAULT,
// <FS:Beq> Avoid stall in texture fetch due to asset fetching. [Drake]
/// Asset fetching policy class. Used to
/// download assets via capability.
/// Deep queueing of requests.
/// Do not share. GET requests only.
///
/// Destination: cdn:80
/// Protocol: http:
/// Transfer size: KB-MB
/// Long poll: no
/// Concurrency: high
/// Request rate: high
/// Pipelined: yes
// <FS:Beq> Avoid stall in texture fetch due to asset fetching. [Drake]
/// Asset fetching policy class. Used to
/// download assets via capability.
/// Deep queueing of requests.
/// Do not share. GET requests only.
///
/// Destination: cdn:80
/// Protocol: http:
/// Transfer size: KB-MB
/// Long poll: no
/// Concurrency: high
/// Request rate: high
/// Pipelined: yes
AP_ASSET,
// </FS:Beq>

View File

@ -1018,7 +1018,11 @@ void LLFloaterModelPreview::onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata)
}
S32 file_mode = iface->getItemCount() - 1;
if (which_mode < file_mode)
//<FS:Beq> Add box physics support
// Ugh, the code assumes the last entry is "load from file", we are going to have to be the next to last.
S32 box_mode = file_mode - 1;
// if (which_mode < file_mode)
if (which_mode < box_mode)
{
S32 which_lod = num_lods - which_mode;
sInstance->mModelPreview->setPhysicsFromLOD(which_lod);

View File

@ -3011,9 +3011,12 @@ void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespo
// handler, optional first that takes a body, fallback second
// that requires a temporary allocation and data copy.
body_offset = mOffset - offset;
data = new U8[data_size - body_offset];
body->read(body_offset, (char *) data, data_size - body_offset);
LLMeshRepository::sBytesReceived += data_size;
data = new(std::nothrow) U8[data_size - body_offset];
if (data)
{
body->read(body_offset, (char *) data, data_size - body_offset);
LLMeshRepository::sBytesReceived += data_size;
}
}
processData(body, body_offset, data, data_size - body_offset);
@ -3062,7 +3065,9 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b
U8 * data, S32 data_size)
{
LLUUID mesh_id = mMeshParams.getSculptID();
bool success = (! MESH_HEADER_PROCESS_FAILED) && gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size);
bool success = (! MESH_HEADER_PROCESS_FAILED)
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size);
llassert(success);
if (! success)
{
@ -3189,7 +3194,9 @@ void LLMeshLODHandler::processFailure(LLCore::HttpStatus status)
void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
U8 * data, S32 data_size)
{
if ((! MESH_LOD_PROCESS_FAILED) && gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size))
if ((!MESH_LOD_PROCESS_FAILED)
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size))
{
// good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE);
@ -3237,7 +3244,9 @@ void LLMeshSkinInfoHandler::processFailure(LLCore::HttpStatus status)
void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
U8 * data, S32 data_size)
{
if ((! MESH_SKIN_INFO_PROCESS_FAILED) && gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size))
if ((!MESH_SKIN_INFO_PROCESS_FAILED)
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size))
{
// good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
@ -3283,7 +3292,9 @@ void LLMeshDecompositionHandler::processFailure(LLCore::HttpStatus status)
void LLMeshDecompositionHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
U8 * data, S32 data_size)
{
if ((! MESH_DECOMP_PROCESS_FAILED) && gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size))
if ((!MESH_DECOMP_PROCESS_FAILED)
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size))
{
// good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);
@ -3328,7 +3339,9 @@ void LLMeshPhysicsShapeHandler::processFailure(LLCore::HttpStatus status)
void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,
U8 * data, S32 data_size)
{
if ((! MESH_PHYS_SHAPE_PROCESS_FAILED) && gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size))
if ((!MESH_PHYS_SHAPE_PROCESS_FAILED)
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size))
{
// good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE);