Merge remote-tracking branch 'aleric/master'
This commit is contained in:
@@ -390,11 +390,6 @@ bool LLCrashLogger::init()
|
||||
// Start state machine thread.
|
||||
startEngineThread();
|
||||
|
||||
// Start curl thread.
|
||||
AICurlInterface::startCurlThread(64, // CurlMaxTotalConcurrentConnections
|
||||
8, // CurlConcurrentConnectionsPerService
|
||||
true); // NoVerifySSLCert
|
||||
|
||||
// We assume that all the logs we're looking for reside on the current drive
|
||||
gDirUtilp->initAppDirs("SecondLife");
|
||||
|
||||
@@ -414,6 +409,9 @@ bool LLCrashLogger::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
// Start curl thread.
|
||||
AICurlInterface::startCurlThread(&mCrashSettings);
|
||||
|
||||
gServicePump = new LLPumpIO;
|
||||
|
||||
//If we've opened the crash logger, assume we can delete the marker file if it exists
|
||||
|
||||
@@ -961,7 +961,7 @@ CurlEasyRequest::~CurlEasyRequest()
|
||||
revokeCallbacks();
|
||||
if (mPerServicePtr)
|
||||
{
|
||||
AIPerServiceRequestQueue::release(mPerServicePtr);
|
||||
AIPerService::release(mPerServicePtr);
|
||||
}
|
||||
// This wasn't freed yet if the request never finished.
|
||||
curl_slist_free_all(mHeaders);
|
||||
@@ -1114,7 +1114,7 @@ void CurlEasyRequest::finalizeRequest(std::string const& url, AIHTTPTimeoutPolic
|
||||
setopt(CURLOPT_HTTPHEADER, mHeaders);
|
||||
setoptString(CURLOPT_URL, url);
|
||||
llassert(!mPerServicePtr);
|
||||
mLowercaseServicename = AIPerServiceRequestQueue::extract_canonical_servicename(url);
|
||||
mLowercaseServicename = AIPerService::extract_canonical_servicename(url);
|
||||
mTimeoutPolicy = &policy;
|
||||
state_machine->setTotalDelayTimeout(policy.getTotalDelay());
|
||||
// The following line is a bit tricky: we store a pointer to the object without increasing its reference count.
|
||||
@@ -1236,14 +1236,14 @@ void CurlEasyRequest::queued_for_removal(AICurlEasyRequest_wat& curl_easy_reques
|
||||
}
|
||||
#endif
|
||||
|
||||
AIPerServiceRequestQueuePtr CurlEasyRequest::getPerServicePtr(void)
|
||||
AIPerServicePtr CurlEasyRequest::getPerServicePtr(void)
|
||||
{
|
||||
if (!mPerServicePtr)
|
||||
{
|
||||
// mPerServicePtr is really just a speed-up cache.
|
||||
// The reason we can cache it is because mLowercaseServicename is only set
|
||||
// in finalizeRequest which may only be called once: it never changes.
|
||||
mPerServicePtr = AIPerServiceRequestQueue::instance(mLowercaseServicename);
|
||||
mPerServicePtr = AIPerService::instance(mLowercaseServicename);
|
||||
}
|
||||
return mPerServicePtr;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "stdtypes.h" // U16, S32, U32, F64
|
||||
#include "llatomic.h" // LLAtomicU32
|
||||
#include "aithreadsafe.h"
|
||||
#include "aicurlperservice.h" // AIPerServiceRequestQueuePtr
|
||||
#include "aicurlperservice.h" // AIPerServicePtr
|
||||
|
||||
// Debug Settings.
|
||||
extern bool gNoVerifySSLCert;
|
||||
@@ -61,6 +61,7 @@ class LLSD;
|
||||
class LLBufferArray;
|
||||
class LLChannelDescriptors;
|
||||
class AIHTTPTimeoutPolicy;
|
||||
class LLControlGroup;
|
||||
|
||||
// Some pretty printing for curl easy handle related things:
|
||||
// Print the lock object related to the current easy handle in every debug output.
|
||||
@@ -163,7 +164,7 @@ bool handleNoVerifySSLCert(LLSD const& newvalue);
|
||||
void initCurl(void);
|
||||
|
||||
// Called once at start of application (from LLAppViewer::initThreads), starts AICurlThread.
|
||||
void startCurlThread(U32 CurlMaxTotalConcurrentConnections, U32 CurlConcurrentConnectionsPerService, bool NoVerifySSLCert);
|
||||
void startCurlThread(LLControlGroup* control_group);
|
||||
|
||||
// Called once at the end of application before terminating other threads (most notably the texture thread workers)
|
||||
// with the purpose to stop the curl thread from doing any call backs to running responders: the responders sometimes
|
||||
@@ -200,6 +201,9 @@ U32 getNumHTTPAdded(void);
|
||||
// Returns the number of active curl easy handles (that are actually attempting to download something).
|
||||
U32 getNumHTTPRunning(void);
|
||||
|
||||
// Cache for gSavedSettings so we have access from llmessage.
|
||||
extern LLControlGroup* sConfigGroup;
|
||||
|
||||
} // namespace AICurlInterface
|
||||
|
||||
// Forward declaration (see aicurlprivate.h).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file aiperservice.cpp
|
||||
* @brief Implementation of AIPerServiceRequestQueue
|
||||
* @brief Implementation of AIPerService
|
||||
*
|
||||
* Copyright (c) 2012, 2013, Aleric Inglewood.
|
||||
*
|
||||
@@ -39,18 +39,20 @@
|
||||
#include "sys.h"
|
||||
#include "aicurlperservice.h"
|
||||
#include "aicurlthread.h"
|
||||
#include "llcontrol.h"
|
||||
|
||||
AIPerServiceRequestQueue::threadsafe_instance_map_type AIPerServiceRequestQueue::sInstanceMap;
|
||||
LLAtomicS32 AIPerServiceRequestQueue::sTotalQueued;
|
||||
bool AIPerServiceRequestQueue::sQueueEmpty;
|
||||
bool AIPerServiceRequestQueue::sQueueFull;
|
||||
bool AIPerServiceRequestQueue::sRequestStarvation;
|
||||
AIPerService::threadsafe_instance_map_type AIPerService::sInstanceMap;
|
||||
LLAtomicS32 AIPerService::sTotalQueued;
|
||||
bool AIPerService::sQueueEmpty;
|
||||
bool AIPerService::sQueueFull;
|
||||
bool AIPerService::sRequestStarvation;
|
||||
|
||||
#undef AICurlPrivate
|
||||
|
||||
namespace AICurlPrivate {
|
||||
|
||||
U32 curl_concurrent_connections_per_service;
|
||||
// Cached value of CurlConcurrentConnectionsPerService.
|
||||
U32 CurlConcurrentConnectionsPerService;
|
||||
|
||||
// Friend functions of RefCountedThreadSafePerServiceRequestQueue
|
||||
|
||||
@@ -71,6 +73,14 @@ void intrusive_ptr_release(RefCountedThreadSafePerServiceRequestQueue* per_servi
|
||||
|
||||
using namespace AICurlPrivate;
|
||||
|
||||
AIPerService::AIPerService(void) :
|
||||
mQueuedCommands(0), mAdded(0), mQueueEmpty(false),
|
||||
mQueueFull(false), mRequestStarvation(false), mHTTPBandwidth(25), // 25 = 1000 ms / 40 ms.
|
||||
mConcurrectConnections(CurlConcurrentConnectionsPerService),
|
||||
mMaxPipelinedRequests(CurlConcurrentConnectionsPerService)
|
||||
{
|
||||
}
|
||||
|
||||
// url must be of the form
|
||||
// (see http://www.ietf.org/rfc/rfc3986.txt Appendix A for definitions not given here):
|
||||
//
|
||||
@@ -96,7 +106,7 @@ using namespace AICurlPrivate;
|
||||
// - port does not contain a ':', and if it exists is always prepended by a ':'.
|
||||
//
|
||||
//static
|
||||
std::string AIPerServiceRequestQueue::extract_canonical_servicename(std::string const& url)
|
||||
std::string AIPerService::extract_canonical_servicename(std::string const& url)
|
||||
{
|
||||
char const* p = url.data();
|
||||
char const* const end = p + url.size();
|
||||
@@ -168,21 +178,21 @@ std::string AIPerServiceRequestQueue::extract_canonical_servicename(std::string
|
||||
}
|
||||
|
||||
//static
|
||||
AIPerServiceRequestQueuePtr AIPerServiceRequestQueue::instance(std::string const& servicename)
|
||||
AIPerServicePtr AIPerService::instance(std::string const& servicename)
|
||||
{
|
||||
llassert(!servicename.empty());
|
||||
instance_map_wat instance_map_w(sInstanceMap);
|
||||
AIPerServiceRequestQueue::iterator iter = instance_map_w->find(servicename);
|
||||
AIPerService::iterator iter = instance_map_w->find(servicename);
|
||||
if (iter == instance_map_w->end())
|
||||
{
|
||||
iter = instance_map_w->insert(instance_map_type::value_type(servicename, new RefCountedThreadSafePerServiceRequestQueue)).first;
|
||||
}
|
||||
// Note: the creation of AIPerServiceRequestQueuePtr MUST be protected by the lock on sInstanceMap (see release()).
|
||||
// Note: the creation of AIPerServicePtr MUST be protected by the lock on sInstanceMap (see release()).
|
||||
return iter->second;
|
||||
}
|
||||
|
||||
//static
|
||||
void AIPerServiceRequestQueue::release(AIPerServiceRequestQueuePtr& instance)
|
||||
void AIPerService::release(AIPerServicePtr& instance)
|
||||
{
|
||||
if (instance->exactly_two_left()) // Being 'instance' and the one in sInstanceMap.
|
||||
{
|
||||
@@ -218,31 +228,29 @@ void AIPerServiceRequestQueue::release(AIPerServiceRequestQueuePtr& instance)
|
||||
instance.reset();
|
||||
}
|
||||
|
||||
bool AIPerServiceRequestQueue::throttled() const
|
||||
bool AIPerService::throttled() const
|
||||
{
|
||||
llassert(mAdded <= int(curl_concurrent_connections_per_service));
|
||||
return mAdded == int(curl_concurrent_connections_per_service);
|
||||
return mAdded >= mConcurrectConnections;
|
||||
}
|
||||
|
||||
void AIPerServiceRequestQueue::added_to_multi_handle(void)
|
||||
void AIPerService::added_to_multi_handle(void)
|
||||
{
|
||||
llassert(mAdded < int(curl_concurrent_connections_per_service));
|
||||
++mAdded;
|
||||
}
|
||||
|
||||
void AIPerServiceRequestQueue::removed_from_multi_handle(void)
|
||||
void AIPerService::removed_from_multi_handle(void)
|
||||
{
|
||||
--mAdded;
|
||||
llassert(mAdded >= 0);
|
||||
}
|
||||
|
||||
void AIPerServiceRequestQueue::queue(AICurlEasyRequest const& easy_request)
|
||||
void AIPerService::queue(AICurlEasyRequest const& easy_request)
|
||||
{
|
||||
mQueuedRequests.push_back(easy_request.get_ptr());
|
||||
sTotalQueued++;
|
||||
}
|
||||
|
||||
bool AIPerServiceRequestQueue::cancel(AICurlEasyRequest const& easy_request)
|
||||
bool AIPerService::cancel(AICurlEasyRequest const& easy_request)
|
||||
{
|
||||
queued_request_type::iterator const end = mQueuedRequests.end();
|
||||
queued_request_type::iterator cur = std::find(mQueuedRequests.begin(), end, easy_request.get_ptr());
|
||||
@@ -255,7 +263,7 @@ bool AIPerServiceRequestQueue::cancel(AICurlEasyRequest const& easy_request)
|
||||
// the back with swap (could just swap with the end immediately, but I don't
|
||||
// want to break the order in which requests where added). Swap is also not
|
||||
// thread-safe, but OK here because it only touches the objects in the deque,
|
||||
// and the deque is protected by the lock on the AIPerServiceRequestQueue object.
|
||||
// and the deque is protected by the lock on the AIPerService object.
|
||||
queued_request_type::iterator prev = cur;
|
||||
while (++cur != end)
|
||||
{
|
||||
@@ -268,7 +276,7 @@ bool AIPerServiceRequestQueue::cancel(AICurlEasyRequest const& easy_request)
|
||||
return true;
|
||||
}
|
||||
|
||||
void AIPerServiceRequestQueue::add_queued_to(curlthread::MultiHandle* multi_handle)
|
||||
void AIPerService::add_queued_to(curlthread::MultiHandle* multi_handle)
|
||||
{
|
||||
if (!mQueuedRequests.empty())
|
||||
{
|
||||
@@ -309,7 +317,7 @@ void AIPerServiceRequestQueue::add_queued_to(curlthread::MultiHandle* multi_hand
|
||||
}
|
||||
|
||||
//static
|
||||
void AIPerServiceRequestQueue::purge(void)
|
||||
void AIPerService::purge(void)
|
||||
{
|
||||
instance_map_wat instance_map_w(sInstanceMap);
|
||||
for (iterator host = instance_map_w->begin(); host != instance_map_w->end(); ++host)
|
||||
@@ -323,3 +331,17 @@ void AIPerServiceRequestQueue::purge(void)
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void AIPerService::adjust_concurrent_connections(int increment)
|
||||
{
|
||||
instance_map_wat instance_map_w(sInstanceMap);
|
||||
for (AIPerService::iterator iter = instance_map_w->begin(); iter != instance_map_w->end(); ++iter)
|
||||
{
|
||||
PerServiceRequestQueue_wat per_service_w(*iter->second);
|
||||
U32 old_concurrent_connections = per_service_w->mConcurrectConnections;
|
||||
per_service_w->mConcurrectConnections = llclamp(old_concurrent_connections + increment, (U32)1, CurlConcurrentConnectionsPerService);
|
||||
increment = per_service_w->mConcurrectConnections - old_concurrent_connections;
|
||||
per_service_w->mMaxPipelinedRequests = llmax(per_service_w->mMaxPipelinedRequests + increment, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @file aicurlperservice.h
|
||||
* @brief Definition of class AIPerServiceRequestQueue
|
||||
* @brief Definition of class AIPerService
|
||||
*
|
||||
* Copyright (c) 2012, 2013, Aleric Inglewood.
|
||||
*
|
||||
@@ -48,7 +48,7 @@
|
||||
#include "aiaverage.h"
|
||||
|
||||
class AICurlEasyRequest;
|
||||
class AIPerServiceRequestQueue;
|
||||
class AIPerService;
|
||||
|
||||
namespace AICurlPrivate {
|
||||
namespace curlthread { class MultiHandle; }
|
||||
@@ -59,38 +59,38 @@ class ThreadSafeBufferedCurlEasyRequest;
|
||||
// Forward declaration of BufferedCurlEasyRequestPtr (see aicurlprivate.h).
|
||||
typedef boost::intrusive_ptr<ThreadSafeBufferedCurlEasyRequest> BufferedCurlEasyRequestPtr;
|
||||
|
||||
// AIPerServiceRequestQueue objects are created by the curl thread and destructed by the main thread.
|
||||
// AIPerService objects are created by the curl thread and destructed by the main thread.
|
||||
// We need locking.
|
||||
typedef AIThreadSafeSimpleDC<AIPerServiceRequestQueue> threadsafe_PerServiceRequestQueue;
|
||||
typedef AIAccessConst<AIPerServiceRequestQueue> PerServiceRequestQueue_crat;
|
||||
typedef AIAccess<AIPerServiceRequestQueue> PerServiceRequestQueue_rat;
|
||||
typedef AIAccess<AIPerServiceRequestQueue> PerServiceRequestQueue_wat;
|
||||
typedef AIThreadSafeSimpleDC<AIPerService> threadsafe_PerServiceRequestQueue;
|
||||
typedef AIAccessConst<AIPerService> PerServiceRequestQueue_crat;
|
||||
typedef AIAccess<AIPerService> PerServiceRequestQueue_rat;
|
||||
typedef AIAccess<AIPerService> PerServiceRequestQueue_wat;
|
||||
|
||||
} // namespace AICurlPrivate
|
||||
|
||||
// We can't put threadsafe_PerServiceRequestQueue in a std::map because you can't copy a mutex.
|
||||
// Therefore, use an intrusive pointer for the threadsafe type.
|
||||
typedef boost::intrusive_ptr<AICurlPrivate::RefCountedThreadSafePerServiceRequestQueue> AIPerServiceRequestQueuePtr;
|
||||
typedef boost::intrusive_ptr<AICurlPrivate::RefCountedThreadSafePerServiceRequestQueue> AIPerServicePtr;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// AIPerServiceRequestQueue
|
||||
// AIPerService
|
||||
|
||||
// This class provides a static interface to create and maintain instances
|
||||
// of AIPerServiceRequestQueue objects, so that at any moment there is at most
|
||||
// of AIPerService objects, so that at any moment there is at most
|
||||
// one instance per hostname:port. Those instances then are used to queue curl
|
||||
// requests when the maximum number of connections for that host already
|
||||
// have been reached.
|
||||
class AIPerServiceRequestQueue {
|
||||
class AIPerService {
|
||||
private:
|
||||
typedef std::map<std::string, AIPerServiceRequestQueuePtr> instance_map_type;
|
||||
typedef std::map<std::string, AIPerServicePtr> instance_map_type;
|
||||
typedef AIThreadSafeSimpleDC<instance_map_type> threadsafe_instance_map_type;
|
||||
typedef AIAccess<instance_map_type> instance_map_rat;
|
||||
typedef AIAccess<instance_map_type> instance_map_wat;
|
||||
|
||||
static threadsafe_instance_map_type sInstanceMap; // Map of AIPerServiceRequestQueue instances with the hostname as key.
|
||||
static threadsafe_instance_map_type sInstanceMap; // Map of AIPerService instances with the hostname as key.
|
||||
|
||||
friend class AIThreadSafeSimpleDC<AIPerServiceRequestQueue>; //threadsafe_PerServiceRequestQueue
|
||||
AIPerServiceRequestQueue(void) : mQueuedCommands(0), mAdded(0), mQueueEmpty(false), mQueueFull(false), mRequestStarvation(false), mHTTPBandwidth(25) { } // 25 = 1000 ms / 40 ms.
|
||||
friend class AIThreadSafeSimpleDC<AIPerService>; //threadsafe_PerServiceRequestQueue
|
||||
AIPerService(void);
|
||||
|
||||
public:
|
||||
typedef instance_map_type::iterator iterator;
|
||||
@@ -100,10 +100,10 @@ class AIPerServiceRequestQueue {
|
||||
static std::string extract_canonical_servicename(std::string const& url);
|
||||
|
||||
// Return (possibly create) a unique instance for the given hostname.
|
||||
static AIPerServiceRequestQueuePtr instance(std::string const& servicename);
|
||||
static AIPerServicePtr instance(std::string const& servicename);
|
||||
|
||||
// Release instance (object will be deleted if this was the last instance).
|
||||
static void release(AIPerServiceRequestQueuePtr& instance);
|
||||
static void release(AIPerServicePtr& instance);
|
||||
|
||||
// Remove everything. Called upon viewer exit.
|
||||
static void purge(void);
|
||||
@@ -115,7 +115,7 @@ class AIPerServiceRequestQueue {
|
||||
int mAdded; // Number of active easy handles with this host.
|
||||
queued_request_type mQueuedRequests; // Waiting (throttled) requests.
|
||||
|
||||
static LLAtomicS32 sTotalQueued; // The sum of mQueuedRequests.size() of all AIPerServiceRequestQueue objects together.
|
||||
static LLAtomicS32 sTotalQueued; // The sum of mQueuedRequests.size() of all AIPerService objects together.
|
||||
|
||||
bool mQueueEmpty; // Set to true when the queue becomes precisely empty.
|
||||
bool mQueueFull; // Set to true when the queue is popped and then still isn't empty;
|
||||
@@ -125,7 +125,9 @@ class AIPerServiceRequestQueue {
|
||||
static bool sQueueFull; // Set to true when sTotalQueued is still larger than zero after popping any queue.
|
||||
static bool sRequestStarvation; // Set to true when any queue was about to be popped when sTotalQueued was already zero.
|
||||
|
||||
AIAverage mHTTPBandwidth; // Keeps track on number of bytes received for this service in the past second.
|
||||
AIAverage mHTTPBandwidth; // Keeps track on number of bytes received for this service in the past second.
|
||||
int mConcurrectConnections; // The maximum number of allowed concurrent connections to this service.
|
||||
int mMaxPipelinedRequests; // The maximum number of accepted requests that didn't finish yet.
|
||||
|
||||
public:
|
||||
void added_to_command_queue(void) { ++mQueuedCommands; }
|
||||
@@ -147,14 +149,17 @@ class AIPerServiceRequestQueue {
|
||||
AIAverage& bandwidth(void) { return mHTTPBandwidth; }
|
||||
AIAverage const& bandwidth(void) const { return mHTTPBandwidth; }
|
||||
|
||||
// Called when CurlConcurrentConnectionsPerService changes.
|
||||
static void adjust_concurrent_connections(int increment);
|
||||
|
||||
// Returns true if curl can handle another request for this host.
|
||||
// Should return false if the maximum allowed HTTP bandwidth is reached, or when
|
||||
// the latency between request and actual delivery becomes too large.
|
||||
static bool wantsMoreHTTPRequestsFor(AIPerServiceRequestQueuePtr const& per_service, F32 max_kbps, bool no_bandwidth_throttling);
|
||||
static bool wantsMoreHTTPRequestsFor(AIPerServicePtr const& per_service, F32 max_kbps, bool no_bandwidth_throttling);
|
||||
|
||||
private:
|
||||
// Disallow copying.
|
||||
AIPerServiceRequestQueue(AIPerServiceRequestQueue const&) : mHTTPBandwidth(0) { }
|
||||
AIPerService(AIPerService const&) : mHTTPBandwidth(0) { }
|
||||
};
|
||||
|
||||
namespace AICurlPrivate {
|
||||
@@ -165,14 +170,14 @@ class RefCountedThreadSafePerServiceRequestQueue : public threadsafe_PerServiceR
|
||||
bool exactly_two_left(void) const { return mReferenceCount == 2; }
|
||||
|
||||
private:
|
||||
// Used by AIPerServiceRequestQueuePtr. Object is deleted when reference count reaches zero.
|
||||
// Used by AIPerServicePtr. Object is deleted when reference count reaches zero.
|
||||
LLAtomicU32 mReferenceCount;
|
||||
|
||||
friend void intrusive_ptr_add_ref(RefCountedThreadSafePerServiceRequestQueue* p);
|
||||
friend void intrusive_ptr_release(RefCountedThreadSafePerServiceRequestQueue* p);
|
||||
};
|
||||
|
||||
extern U32 curl_concurrent_connections_per_service;
|
||||
extern U32 CurlConcurrentConnectionsPerService;
|
||||
|
||||
} // namespace AICurlPrivate
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ class CurlEasyRequest : public CurlEasyHandle {
|
||||
|
||||
AIHTTPTimeoutPolicy const* mTimeoutPolicy;
|
||||
std::string mLowercaseServicename; // Lowercase hostname:port (canonicalized) extracted from the url.
|
||||
AIPerServiceRequestQueuePtr mPerServicePtr; // Pointer to the corresponding AIPerServiceRequestQueue.
|
||||
AIPerServicePtr mPerServicePtr; // Pointer to the corresponding AIPerService.
|
||||
LLPointer<curlthread::HTTPTimeout> mTimeout;// Timeout administration object associated with last created CurlSocketInfo.
|
||||
bool mTimeoutIsOrphan; // Set to true when mTimeout is not (yet) associated with a CurlSocketInfo.
|
||||
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
|
||||
@@ -349,8 +349,8 @@ class CurlEasyRequest : public CurlEasyHandle {
|
||||
inline ThreadSafeBufferedCurlEasyRequest const* get_lockobj(void) const;
|
||||
|
||||
// PerService API.
|
||||
AIPerServiceRequestQueuePtr getPerServicePtr(void); // (Optionally create and) return a pointer to the unique
|
||||
// AIPerServiceRequestQueue corresponding to mLowercaseServicename.
|
||||
AIPerServicePtr getPerServicePtr(void); // (Optionally create and) return a pointer to the unique
|
||||
// AIPerService corresponding to mLowercaseServicename.
|
||||
bool removeFromPerServiceQueue(AICurlEasyRequest const&) const; // Remove this request from the per-host queue, if queued at all.
|
||||
// Returns true if it was queued.
|
||||
protected:
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "lltimer.h" // ms_sleep, get_clock_count
|
||||
#include "llhttpstatuscodes.h"
|
||||
#include "llbuffer.h"
|
||||
#include "llcontrol.h"
|
||||
#include <sys/types.h>
|
||||
#if !LL_WINDOWS
|
||||
#include <sys/select.h>
|
||||
@@ -206,7 +207,6 @@ int ioctlsocket(int fd, int, unsigned long* nonblocking_enable)
|
||||
namespace AICurlPrivate {
|
||||
|
||||
LLAtomicS32 max_pipelined_requests(32);
|
||||
LLAtomicS32 max_pipelined_requests_per_service(8);
|
||||
|
||||
enum command_st {
|
||||
cmd_none,
|
||||
@@ -1579,7 +1579,7 @@ void AICurlThread::run(void)
|
||||
multi_handle_w->check_msg_queue();
|
||||
}
|
||||
// Clear the queued requests.
|
||||
AIPerServiceRequestQueue::purge();
|
||||
AIPerService::purge();
|
||||
}
|
||||
AICurlMultiHandle::destroyInstance();
|
||||
}
|
||||
@@ -1706,7 +1706,7 @@ static U32 curl_max_total_concurrent_connections = 32; // Initialized on st
|
||||
void MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request)
|
||||
{
|
||||
bool throttled = true; // Default.
|
||||
AIPerServiceRequestQueuePtr per_service;
|
||||
AIPerServicePtr per_service;
|
||||
{
|
||||
AICurlEasyRequest_wat curl_easy_request_w(*easy_request);
|
||||
per_service = curl_easy_request_w->getPerServicePtr();
|
||||
@@ -1765,7 +1765,7 @@ CURLMcode MultiHandle::remove_easy_request(AICurlEasyRequest const& easy_request
|
||||
CURLMcode MultiHandle::remove_easy_request(addedEasyRequests_type::iterator const& iter, bool as_per_command)
|
||||
{
|
||||
CURLMcode res;
|
||||
AIPerServiceRequestQueuePtr per_service;
|
||||
AIPerServicePtr per_service;
|
||||
{
|
||||
AICurlEasyRequest_wat curl_easy_request_w(**iter);
|
||||
res = curl_easy_request_w->remove_handle_from_multi(curl_easy_request_w, mMultiHandle);
|
||||
@@ -2497,7 +2497,9 @@ void AICurlEasyRequest::removeRequest(void)
|
||||
|
||||
namespace AICurlInterface {
|
||||
|
||||
void startCurlThread(U32 CurlMaxTotalConcurrentConnections, U32 CurlConcurrentConnectionsPerService, bool NoVerifySSLCert)
|
||||
LLControlGroup* sConfigGroup;
|
||||
|
||||
void startCurlThread(LLControlGroup* control_group)
|
||||
{
|
||||
using namespace AICurlPrivate;
|
||||
using namespace AICurlPrivate::curlthread;
|
||||
@@ -2505,11 +2507,11 @@ void startCurlThread(U32 CurlMaxTotalConcurrentConnections, U32 CurlConcurrentCo
|
||||
llassert(is_main_thread());
|
||||
|
||||
// Cache Debug Settings.
|
||||
curl_max_total_concurrent_connections = CurlMaxTotalConcurrentConnections;
|
||||
curl_concurrent_connections_per_service = CurlConcurrentConnectionsPerService;
|
||||
gNoVerifySSLCert = NoVerifySSLCert;
|
||||
sConfigGroup = control_group;
|
||||
curl_max_total_concurrent_connections = sConfigGroup->getU32("CurlMaxTotalConcurrentConnections");
|
||||
CurlConcurrentConnectionsPerService = sConfigGroup->getU32("CurlConcurrentConnectionsPerService");
|
||||
gNoVerifySSLCert = sConfigGroup->getBOOL("NoVerifySSLCert");
|
||||
max_pipelined_requests = curl_max_total_concurrent_connections;
|
||||
max_pipelined_requests_per_service = curl_concurrent_connections_per_service;
|
||||
|
||||
AICurlThread::sInstance = new AICurlThread;
|
||||
AICurlThread::sInstance->start();
|
||||
@@ -2531,10 +2533,10 @@ bool handleCurlConcurrentConnectionsPerService(LLSD const& newvalue)
|
||||
{
|
||||
using namespace AICurlPrivate;
|
||||
|
||||
U32 old = curl_concurrent_connections_per_service;
|
||||
curl_concurrent_connections_per_service = newvalue.asInteger();
|
||||
max_pipelined_requests_per_service += curl_concurrent_connections_per_service - old;
|
||||
llinfos << "CurlConcurrentConnectionsPerService set to " << curl_concurrent_connections_per_service << llendl;
|
||||
U32 new_concurrent_connections = newvalue.asInteger();
|
||||
AIPerService::adjust_concurrent_connections(new_concurrent_connections - CurlConcurrentConnectionsPerService);
|
||||
CurlConcurrentConnectionsPerService = new_concurrent_connections;
|
||||
llinfos << "CurlConcurrentConnectionsPerService set to " << CurlConcurrentConnectionsPerService << llendl;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2554,7 +2556,7 @@ U32 getNumHTTPCommands(void)
|
||||
|
||||
U32 getNumHTTPQueued(void)
|
||||
{
|
||||
return AIPerServiceRequestQueue::total_queued_size();
|
||||
return AIPerService::total_queued_size();
|
||||
}
|
||||
|
||||
U32 getNumHTTPAdded(void)
|
||||
@@ -2588,16 +2590,16 @@ size_t getHTTPBandwidth(void)
|
||||
// causes it to go through the states bs_reset, bs_initialize and then bs_multiplex with
|
||||
// run state AICurlEasyRequestStateMachine_addRequest. Finally, in this state, multiplex
|
||||
// calls AICurlEasyRequestStateMachine::multiplex_impl which then calls AICurlEasyRequest::addRequest
|
||||
// which causes an increment of command_queue_w->size and AIPerServiceRequestQueue::mQueuedCommands.
|
||||
// which causes an increment of command_queue_w->size and AIPerService::mQueuedCommands.
|
||||
//
|
||||
// It is therefore guaranteed that in one loop of LLTextureFetchWorker::doWork,
|
||||
// this size is incremented; stopping this function from returning true once we reached the
|
||||
// threshold of "pipelines" requests (the sum of requests in the command queue, the ones
|
||||
// throttled and queued in AIPerServiceRequestQueue::mQueuedRequests and the already
|
||||
// throttled and queued in AIPerService::mQueuedRequests and the already
|
||||
// running requests (in MultiHandle::mAddedEasyRequests)).
|
||||
//
|
||||
//static
|
||||
bool AIPerServiceRequestQueue::wantsMoreHTTPRequestsFor(AIPerServiceRequestQueuePtr const& per_service, F32 max_kbps, bool no_bandwidth_throttling)
|
||||
bool AIPerService::wantsMoreHTTPRequestsFor(AIPerServicePtr const& per_service, F32 max_kbps, bool no_bandwidth_throttling)
|
||||
{
|
||||
using namespace AICurlPrivate;
|
||||
using namespace AICurlPrivate::curlthread;
|
||||
@@ -2626,34 +2628,32 @@ bool AIPerServiceRequestQueue::wantsMoreHTTPRequestsFor(AIPerServiceRequestQueue
|
||||
|
||||
AIAverage* http_bandwidth_ptr;
|
||||
|
||||
// Atomic read max_pipelined_requests_per_service for the below calculations.
|
||||
S32 const max_pipelined_requests_per_service_cache = max_pipelined_requests_per_service;
|
||||
{
|
||||
PerServiceRequestQueue_wat per_service_w(*per_service);
|
||||
S32 const pipelined_requests_per_service = per_service_w->pipelined_requests();
|
||||
reject = pipelined_requests_per_service >= max_pipelined_requests_per_service_cache;
|
||||
equal = pipelined_requests_per_service == max_pipelined_requests_per_service_cache;
|
||||
reject = pipelined_requests_per_service >= per_service_w->mMaxPipelinedRequests;
|
||||
equal = pipelined_requests_per_service == per_service_w->mMaxPipelinedRequests;
|
||||
increment_threshold = per_service_w->mRequestStarvation;
|
||||
decrement_threshold = per_service_w->mQueueFull && !per_service_w->mQueueEmpty;
|
||||
// Reset flags.
|
||||
per_service_w->mQueueFull = per_service_w->mQueueEmpty = per_service_w->mRequestStarvation = false;
|
||||
// Grab per service bandwidth object.
|
||||
http_bandwidth_ptr = &per_service_w->bandwidth();
|
||||
}
|
||||
if (decrement_threshold)
|
||||
{
|
||||
if (max_pipelined_requests_per_service_cache > (S32)curl_concurrent_connections_per_service)
|
||||
if (decrement_threshold)
|
||||
{
|
||||
--max_pipelined_requests_per_service;
|
||||
if (per_service_w->mMaxPipelinedRequests > per_service_w->mConcurrectConnections)
|
||||
{
|
||||
per_service_w->mMaxPipelinedRequests--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (increment_threshold && reject)
|
||||
{
|
||||
if (max_pipelined_requests_per_service_cache < 2 * (S32)curl_concurrent_connections_per_service)
|
||||
else if (increment_threshold && reject)
|
||||
{
|
||||
max_pipelined_requests_per_service++;
|
||||
// Immediately take the new threshold into account.
|
||||
reject = !equal;
|
||||
if (per_service_w->mMaxPipelinedRequests < 2 * per_service_w->mConcurrectConnections)
|
||||
{
|
||||
per_service_w->mMaxPipelinedRequests++;
|
||||
// Immediately take the new threshold into account.
|
||||
reject = !equal;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (reject)
|
||||
@@ -2740,7 +2740,7 @@ bool AIPerServiceRequestQueue::wantsMoreHTTPRequestsFor(AIPerServiceRequestQueue
|
||||
// here instead.
|
||||
|
||||
// The maximum number of requests that may be queued in command_queue is equal to the total number of requests
|
||||
// that may exist in the pipeline minus the number of requests queued in AIPerServiceRequestQueue objects, minus
|
||||
// that may exist in the pipeline minus the number of requests queued in AIPerService objects, minus
|
||||
// the number of already running requests.
|
||||
reject = pipelined_requests >= max_pipelined_requests_cache;
|
||||
equal = pipelined_requests == max_pipelined_requests_cache;
|
||||
|
||||
@@ -81,7 +81,7 @@ class MultiHandle : public CurlMultiHandle
|
||||
// Store result and trigger events for easy request.
|
||||
void finish_easy_request(AICurlEasyRequest const& easy_request, CURLcode result);
|
||||
// Remove easy request at iter (must exist).
|
||||
// Note that it's possible that a new request from a AIPerServiceRequestQueue::mQueuedRequests is inserted before iter.
|
||||
// Note that it's possible that a new request from a AIPerService::mQueuedRequests is inserted before iter.
|
||||
CURLMcode remove_easy_request(addedEasyRequests_type::iterator const& iter, bool as_per_command);
|
||||
|
||||
static int socket_callback(CURL* easy, curl_socket_t s, int action, void* userp, void* socketp);
|
||||
|
||||
@@ -185,6 +185,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloaterbuycontents.cpp
|
||||
llfloaterbuycurrency.cpp
|
||||
llfloaterbuyland.cpp
|
||||
llfloaterbvhpreview.cpp
|
||||
llfloatercamera.cpp
|
||||
llfloaterchat.cpp
|
||||
llfloaterchatterbox.cpp
|
||||
@@ -688,6 +689,7 @@ set(viewer_HEADER_FILES
|
||||
llfloaterbuycontents.h
|
||||
llfloaterbuycurrency.h
|
||||
llfloaterbuyland.h
|
||||
llfloaterbvhpreview.h
|
||||
llfloatercamera.h
|
||||
llfloaterchat.h
|
||||
llfloaterchatterbox.h
|
||||
|
||||
@@ -1,15 +1,48 @@
|
||||
<llsd>
|
||||
<map>
|
||||
<map>
|
||||
<key>CrashSubmitBehavior</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)</string>
|
||||
<key>Persist</key>
|
||||
<integer>2</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)</string>
|
||||
<key>Persist</key>
|
||||
<integer>2</integer>
|
||||
<key>Type</key>
|
||||
<string>S32</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
<key>CurlMaxTotalConcurrentConnections</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum total number of simultaneous curl connections</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>64</integer>
|
||||
</map>
|
||||
<key>CurlConcurrentConnectionsPerService</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Maximum number of simultaneous curl connections per host:port service</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>U32</string>
|
||||
<key>Value</key>
|
||||
<integer>16</integer>
|
||||
</map>
|
||||
<key>NoVerifySSLCert</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Do not verify SSL certificates.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
</map>
|
||||
</llsd>
|
||||
|
||||
@@ -1895,9 +1895,7 @@ bool LLAppViewer::initThreads()
|
||||
// State machine thread.
|
||||
startEngineThread();
|
||||
|
||||
AICurlInterface::startCurlThread(gSavedSettings.getU32("CurlMaxTotalConcurrentConnections"),
|
||||
gSavedSettings.getU32("CurlConcurrentConnectionsPerService"),
|
||||
gSavedSettings.getBOOL("NoVerifySSLCert"));
|
||||
AICurlInterface::startCurlThread(&gSavedSettings);
|
||||
|
||||
LLImage::initClass();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,7 @@
|
||||
* @file llfloateranimpreview.h
|
||||
* @brief LLFloaterAnimPreview class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
* Copyright (c) 2012, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
@@ -34,112 +32,11 @@
|
||||
#define LL_LLFLOATERANIMPREVIEW_H
|
||||
|
||||
#include "llfloaternamedesc.h"
|
||||
#include "lldynamictexture.h"
|
||||
#include "llcharacter.h"
|
||||
#include "llquaternion.h"
|
||||
|
||||
class LLVOAvatar;
|
||||
class LLViewerJointMesh;
|
||||
|
||||
class LLPreviewAnimation : public LLViewerDynamicTexture
|
||||
{
|
||||
protected:
|
||||
virtual ~LLPreviewAnimation();
|
||||
|
||||
public:
|
||||
LLPreviewAnimation(S32 width, S32 height);
|
||||
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
BOOL render();
|
||||
void requestUpdate();
|
||||
void rotate(F32 yaw_radians, F32 pitch_radians);
|
||||
void zoom(F32 zoom_delta);
|
||||
void setZoom(F32 zoom_amt);
|
||||
void pan(F32 right, F32 up);
|
||||
virtual BOOL needsUpdate() { return mNeedsUpdate; }
|
||||
|
||||
LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
|
||||
|
||||
protected:
|
||||
BOOL mNeedsUpdate;
|
||||
F32 mCameraDistance;
|
||||
F32 mCameraYaw;
|
||||
F32 mCameraPitch;
|
||||
F32 mCameraZoom;
|
||||
LLVector3 mCameraOffset;
|
||||
LLVector3 mCameraRelPos;
|
||||
LLPointer<LLVOAvatar> mDummyAvatar;
|
||||
};
|
||||
|
||||
class LLFloaterAnimPreview : public LLFloaterNameDesc
|
||||
{
|
||||
public:
|
||||
//<edit>
|
||||
LLFloaterAnimPreview(const std::string& filename, void* item = NULL);
|
||||
//<edit>
|
||||
virtual ~LLFloaterAnimPreview();
|
||||
|
||||
BOOL postBuild();
|
||||
|
||||
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
void onMouseCaptureLost();
|
||||
|
||||
void refresh();
|
||||
|
||||
static void onBtnPlay(void*);
|
||||
static void onBtnStop(void*);
|
||||
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
|
||||
static void onSliderMove(LLUICtrl*, void*);
|
||||
static void onCommitBaseAnim(LLUICtrl*, void*);
|
||||
static void onCommitLoop(LLUICtrl*, void*);
|
||||
static void onCommitLoopIn(LLUICtrl*, void*);
|
||||
static void onCommitLoopOut(LLUICtrl*, void*);
|
||||
static BOOL validateLoopIn(LLUICtrl*, void*);
|
||||
static BOOL validateLoopOut(LLUICtrl*, void*);
|
||||
static void onCommitName(LLUICtrl*, void*);
|
||||
static void onCommitHandPose(LLUICtrl*, void*);
|
||||
static void onCommitEmote(LLUICtrl*, void*);
|
||||
static void onCommitPriority(LLUICtrl*, void*);
|
||||
static void onCommitEaseIn(LLUICtrl*, void*);
|
||||
static void onCommitEaseOut(LLUICtrl*, void*);
|
||||
static BOOL validateEaseIn(LLUICtrl*, void*);
|
||||
static BOOL validateEaseOut(LLUICtrl*, void*);
|
||||
static void onBtnOK(void*);
|
||||
static void onSaveComplete(const LLUUID& asset_uuid,
|
||||
LLAssetType::EType type,
|
||||
void* user_data,
|
||||
S32 status, LLExtStat ext_status);
|
||||
private:
|
||||
void setAnimCallbacks() ;
|
||||
|
||||
protected:
|
||||
void draw();
|
||||
void resetMotion();
|
||||
|
||||
LLPointer< LLPreviewAnimation> mAnimPreview;
|
||||
S32 mLastMouseX;
|
||||
S32 mLastMouseY;
|
||||
LLButton* mPlayButton;
|
||||
LLButton* mStopButton;
|
||||
LLRect mPreviewRect;
|
||||
LLRectf mPreviewImageRect;
|
||||
LLAssetID mMotionID;
|
||||
LLTransactionID mTransactionID;
|
||||
BOOL mEnabled;
|
||||
BOOL mInWorld;
|
||||
LLAnimPauseRequest mPauseRequest;
|
||||
|
||||
std::map<std::string, LLUUID> mIDList;
|
||||
|
||||
static S32 sUploadAmount;
|
||||
|
||||
//<edit>
|
||||
void* mItem;
|
||||
//</edit>
|
||||
class LLFloaterAnimPreview : public LLFloaterNameDesc {
|
||||
public:
|
||||
LLFloaterAnimPreview(LLSD const& filename);
|
||||
virtual BOOL postBuild(void);
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERANIMPREVIEW_H
|
||||
|
||||
1630
indra/newview/llfloaterbvhpreview.cpp
Normal file
1630
indra/newview/llfloaterbvhpreview.cpp
Normal file
File diff suppressed because it is too large
Load Diff
145
indra/newview/llfloaterbvhpreview.h
Normal file
145
indra/newview/llfloaterbvhpreview.h
Normal file
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* @file llfloaterbvhpreview.h
|
||||
* @brief LLFloaterBvhPreview class definition
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERBVHPREVIEW_H
|
||||
#define LL_LLFLOATERBVHPREVIEW_H
|
||||
|
||||
#include "llfloaternamedesc.h"
|
||||
#include "lldynamictexture.h"
|
||||
#include "llcharacter.h"
|
||||
#include "llquaternion.h"
|
||||
|
||||
class LLVOAvatar;
|
||||
class LLViewerJointMesh;
|
||||
|
||||
class LLPreviewAnimation : public LLViewerDynamicTexture
|
||||
{
|
||||
protected:
|
||||
virtual ~LLPreviewAnimation();
|
||||
|
||||
public:
|
||||
LLPreviewAnimation(S32 width, S32 height);
|
||||
|
||||
/*virtual*/ S8 getType() const ;
|
||||
|
||||
BOOL render();
|
||||
void requestUpdate();
|
||||
void rotate(F32 yaw_radians, F32 pitch_radians);
|
||||
void zoom(F32 zoom_delta);
|
||||
void setZoom(F32 zoom_amt);
|
||||
void pan(F32 right, F32 up);
|
||||
virtual BOOL needsUpdate() { return mNeedsUpdate; }
|
||||
|
||||
LLVOAvatar* getDummyAvatar() { return mDummyAvatar; }
|
||||
|
||||
protected:
|
||||
BOOL mNeedsUpdate;
|
||||
F32 mCameraDistance;
|
||||
F32 mCameraYaw;
|
||||
F32 mCameraPitch;
|
||||
F32 mCameraZoom;
|
||||
LLVector3 mCameraOffset;
|
||||
LLVector3 mCameraRelPos;
|
||||
LLPointer<LLVOAvatar> mDummyAvatar;
|
||||
};
|
||||
|
||||
class LLFloaterBvhPreview : public LLFloaterNameDesc
|
||||
{
|
||||
public:
|
||||
//<edit>
|
||||
LLFloaterBvhPreview(const std::string& filename, void* item = NULL);
|
||||
//<edit>
|
||||
virtual ~LLFloaterBvhPreview();
|
||||
|
||||
BOOL postBuild();
|
||||
|
||||
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
|
||||
BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
void onMouseCaptureLost();
|
||||
|
||||
void refresh();
|
||||
|
||||
static void onBtnPlay(void*);
|
||||
static void onBtnStop(void*);
|
||||
static void setUploadAmount(S32 amount) { sUploadAmount = amount; }
|
||||
static void onSliderMove(LLUICtrl*, void*);
|
||||
static void onCommitBaseAnim(LLUICtrl*, void*);
|
||||
static void onCommitLoop(LLUICtrl*, void*);
|
||||
static void onCommitLoopIn(LLUICtrl*, void*);
|
||||
static void onCommitLoopOut(LLUICtrl*, void*);
|
||||
static BOOL validateLoopIn(LLUICtrl*, void*);
|
||||
static BOOL validateLoopOut(LLUICtrl*, void*);
|
||||
static void onCommitName(LLUICtrl*, void*);
|
||||
static void onCommitHandPose(LLUICtrl*, void*);
|
||||
static void onCommitEmote(LLUICtrl*, void*);
|
||||
static void onCommitPriority(LLUICtrl*, void*);
|
||||
static void onCommitEaseIn(LLUICtrl*, void*);
|
||||
static void onCommitEaseOut(LLUICtrl*, void*);
|
||||
static BOOL validateEaseIn(LLUICtrl*, void*);
|
||||
static BOOL validateEaseOut(LLUICtrl*, void*);
|
||||
static void onBtnOK(void*);
|
||||
static void onSaveComplete(const LLUUID& asset_uuid,
|
||||
LLAssetType::EType type,
|
||||
void* user_data,
|
||||
S32 status, LLExtStat ext_status);
|
||||
private:
|
||||
void setAnimCallbacks() ;
|
||||
|
||||
protected:
|
||||
void draw();
|
||||
void resetMotion();
|
||||
|
||||
LLPointer< LLPreviewAnimation> mAnimPreview;
|
||||
S32 mLastMouseX;
|
||||
S32 mLastMouseY;
|
||||
LLButton* mPlayButton;
|
||||
LLButton* mStopButton;
|
||||
LLRect mPreviewRect;
|
||||
LLRectf mPreviewImageRect;
|
||||
LLAssetID mMotionID;
|
||||
LLTransactionID mTransactionID;
|
||||
BOOL mEnabled;
|
||||
BOOL mInWorld;
|
||||
LLAnimPauseRequest mPauseRequest;
|
||||
|
||||
std::map<std::string, LLUUID> mIDList;
|
||||
|
||||
static S32 sUploadAmount;
|
||||
|
||||
//<edit>
|
||||
void* mItem;
|
||||
//</edit>
|
||||
};
|
||||
|
||||
#endif // LL_LLFLOATERBVHPREVIEW_H
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "llfloaterexploreanimations.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llvoavatar.h"
|
||||
#include "lllocalinventory.h"
|
||||
#include "llviewercamera.h"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define LL_LLFLOATEREXPLOREANIMATIONS_H
|
||||
|
||||
#include "llfloater.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llviewerwindow.h" // gViewerWindow
|
||||
|
||||
class LLAnimHistoryItem
|
||||
|
||||
@@ -254,7 +254,7 @@ private:
|
||||
LLUUID mID;
|
||||
LLHost mHost;
|
||||
std::string mUrl;
|
||||
AIPerServiceRequestQueuePtr mPerServicePtr; // Pointer to the AIPerServiceRequestQueue corresponding to the host of mUrl.
|
||||
AIPerServicePtr mPerServicePtr; // Pointer to the AIPerService corresponding to the host of mUrl.
|
||||
U8 mType;
|
||||
F32 mImagePriority;
|
||||
U32 mWorkPriority;
|
||||
@@ -800,11 +800,11 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
|
||||
if (!mCanUseNET)
|
||||
{
|
||||
// Probably a file://, but well; in that case servicename will be empty.
|
||||
std::string servicename = AIPerServiceRequestQueue::extract_canonical_servicename(mUrl);
|
||||
std::string servicename = AIPerService::extract_canonical_servicename(mUrl);
|
||||
if (!servicename.empty())
|
||||
{
|
||||
// Make sure mPerServicePtr is up to date with mUrl.
|
||||
mPerServicePtr = AIPerServiceRequestQueue::instance(servicename);
|
||||
mPerServicePtr = AIPerService::instance(servicename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1163,7 +1163,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
{
|
||||
mUrl = http_url + "/?texture_id=" + mID.asString().c_str();
|
||||
mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id.
|
||||
mPerServicePtr = AIPerServiceRequestQueue::instance(AIPerServiceRequestQueue::extract_canonical_servicename(http_url));
|
||||
mPerServicePtr = AIPerService::instance(AIPerService::extract_canonical_servicename(http_url));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1274,7 +1274,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
// Let AICurl decide if we can process more HTTP requests at the moment or not.
|
||||
static const LLCachedControl<F32> throttle_bandwidth("HTTPThrottleBandwidth", 2000);
|
||||
bool const no_bandwidth_throttling = gHippoGridManager->getConnectedGrid()->isAvination();
|
||||
if (!AIPerServiceRequestQueue::wantsMoreHTTPRequestsFor(mPerServicePtr, throttle_bandwidth, no_bandwidth_throttling))
|
||||
if (!AIPerService::wantsMoreHTTPRequestsFor(mPerServicePtr, throttle_bandwidth, no_bandwidth_throttling))
|
||||
{
|
||||
return false ; //wait.
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloaterabout.h"
|
||||
#include "llfloateractivespeakers.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llfloateravatarinfo.h"
|
||||
#include "llfloateravatarlist.h"
|
||||
#include "llfloateravatartextures.h"
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "llagentcamera.h"
|
||||
#include "statemachine/aifilepicker.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llfloaterimagepreview.h"
|
||||
#include "llfloatermodelpreview.h"
|
||||
#include "llfloaternamedesc.h"
|
||||
@@ -348,8 +349,17 @@ class LLFileUploadAnim : public view_listener_t, public AIFileUpload
|
||||
// Inherited from AIFileUpload.
|
||||
/*virtual*/ void handle_event(std::string const& filename)
|
||||
{
|
||||
LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename);
|
||||
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_preview.xml");
|
||||
int len = filename.size();
|
||||
if (len >= 5 && filename.substr(len - 5, 5) == ".anim")
|
||||
{
|
||||
LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename);
|
||||
LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_anim_preview.xml");
|
||||
floaterp->childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(new LLFloaterBvhPreview(filename), "floater_animation_bvh_preview.xml");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -871,8 +881,8 @@ void upload_new_resource(const std::string& src_filename, std::string name,
|
||||
}
|
||||
else if (exten == "bvh")
|
||||
{
|
||||
error_message = llformat("We do not currently support bulk upload of animation files\n");
|
||||
upload_error(error_message, "DoNotSupportBulkAnimationUpload", filename, args);
|
||||
error_message = llformat("We do not currently support bulk upload of BVH animation files\n");
|
||||
upload_error(error_message, "DoNotSupportBulkBVHAnimationUpload", filename, args);
|
||||
return;
|
||||
}
|
||||
// <edit>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include "llagentcamera.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llfloaterbump.h"
|
||||
#include "llfloaterbuycurrency.h"
|
||||
#include "llfloaterbuyland.h"
|
||||
@@ -6550,7 +6550,7 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
|
||||
LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << upload_cost << LL_ENDL;
|
||||
|
||||
LLFloaterImagePreview::setUploadAmount(upload_cost);
|
||||
LLFloaterAnimPreview::setUploadAmount(upload_cost);
|
||||
LLFloaterBvhPreview::setUploadAmount(upload_cost);
|
||||
|
||||
std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee();
|
||||
gMenuHolder->childSetLabelArg("Upload Image", "[UPLOADFEE]", fee);
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include "llappviewer.h"
|
||||
#include "llassetuploadresponders.h"
|
||||
#include "statemachine/aifilepicker.h"
|
||||
#include "llfloateranimpreview.h"
|
||||
#include "llfloaterbvhpreview.h"
|
||||
#include "llfloaterbuycurrency.h"
|
||||
#include "llfloaterimagepreview.h"
|
||||
#include "llfloaternamedesc.h"
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
legacy_header_height="18"
|
||||
height="190"
|
||||
layout="topleft"
|
||||
name="Anim Preview"
|
||||
help_topic="animation_anim_preview"
|
||||
title="ANIMATION.ANIM"
|
||||
width="300">
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="15"
|
||||
layout="topleft"
|
||||
left="10"
|
||||
mouse_opaque="false"
|
||||
name="name_label"
|
||||
top="20"
|
||||
width="275">
|
||||
Name:
|
||||
</text>
|
||||
<line_editor
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top|right"
|
||||
height="19"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
max_length_bytes="63"
|
||||
name="name_form"
|
||||
top_pad="0"
|
||||
width="280" />
|
||||
<text
|
||||
type="string"
|
||||
length="1"
|
||||
follows="left|top"
|
||||
height="15"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
mouse_opaque="false"
|
||||
name="description_label"
|
||||
top_pad="10"
|
||||
width="270">
|
||||
Description:
|
||||
</text>
|
||||
<line_editor
|
||||
border_style="line"
|
||||
border_thickness="1"
|
||||
follows="left|top|right"
|
||||
height="19"
|
||||
layout="topleft"
|
||||
left_delta="0"
|
||||
max_length_bytes="127"
|
||||
name="description_form"
|
||||
top_pad="0"
|
||||
width="280" />
|
||||
<button
|
||||
follows="left|bottom"
|
||||
height="22"
|
||||
label="Upload ([AMOUNT])"
|
||||
layout="topleft"
|
||||
left="45"
|
||||
name="ok_btn"
|
||||
top_pad="60"
|
||||
width="150" />
|
||||
<button
|
||||
follows="right|bottom"
|
||||
height="22"
|
||||
label="Cancel"
|
||||
label_selected="Cancel"
|
||||
layout="topleft"
|
||||
name="cancel_btn"
|
||||
left_pad="5"
|
||||
width="90" />
|
||||
</floater>
|
||||
|
||||
@@ -1735,9 +1735,9 @@ Unable to create output file: [FILE]
|
||||
|
||||
<notification
|
||||
icon="alertmodal.tga"
|
||||
name="DoNotSupportBulkAnimationUpload"
|
||||
name="DoNotSupportBulkBVHAnimationUpload"
|
||||
type="alertmodal">
|
||||
We do not currently support bulk upload of animation files.
|
||||
We do not currently support bulk upload of BVH animation files.
|
||||
</notification>
|
||||
|
||||
<notification
|
||||
|
||||
@@ -968,8 +968,8 @@ Podría ser [VALIDS]
|
||||
No se ha podido crear el archivo de salida: [FILE]
|
||||
</notification>
|
||||
|
||||
<notification name="DoNotSupportBulkAnimationUpload">
|
||||
Actualmente, no ofrecemos la posibilidad de subida masiva de archivos de animación.
|
||||
<notification name="DoNotSupportBulkBVHAnimationUpload">
|
||||
Actualmente, no ofrecemos la posibilidad de subida masiva de archivos de BVH animación.
|
||||
</notification>
|
||||
|
||||
<notification name="CannotUploadReason">
|
||||
|
||||
@@ -696,8 +696,8 @@ Assurez-vous que le fichier a l'extension correcte.
|
||||
<notification name="UnableToCreateOutputFile">
|
||||
Impossible de créer le fichier de sortie : [FILE]
|
||||
</notification>
|
||||
<notification name="DoNotSupportBulkAnimationUpload">
|
||||
Nous ne prenons pas en charge le chargement de lots de fichiers d'animation. (Chaque animation ayant ses propres réglages)
|
||||
<notification name="DoNotSupportBulkBVHAnimationUpload">
|
||||
Nous ne prenons pas en charge le chargement de lots de fichiers d'BVH animation. (Chaque animation ayant ses propres réglages)
|
||||
</notification>
|
||||
<notification name="CannotUploadReason">
|
||||
Impossible de charger [FILE] suite au problème suivant : [REASON]
|
||||
|
||||
@@ -773,8 +773,8 @@ Esperada [VALIDS]
|
||||
Incapaz de criar arquivo de saída: [FILE]
|
||||
</notification>
|
||||
|
||||
<notification name="DoNotSupportBulkAnimationUpload">
|
||||
Atualmente, não suportamos o envio de arquivos de animação em massa.
|
||||
<notification name="DoNotSupportBulkBVHAnimationUpload">
|
||||
Atualmente, não suportamos o envio de arquivos de BVH animação em massa.
|
||||
</notification>
|
||||
|
||||
<notification name="CannotUploadReason">
|
||||
|
||||
@@ -49,7 +49,7 @@ LLFilePicker LLFilePicker::sInstance;
|
||||
#define AO_FILTER L"Animation Override (*.ao)\0*.ao\0"
|
||||
#define BLACKLIST_FILTER L"Asset Blacklist (*.blacklist)\0*.blacklist\0"
|
||||
// </edit>
|
||||
#define ANIM_FILTER L"Animations (*.bvh)\0*.bvh\0"
|
||||
#define ANIM_FILTER L"Animations (*.bvh; *.anim)\0*.bvh\0*.anim\0"
|
||||
#define COLLADA_FILTER L"Scene (*.dae)\0*.dae\0"
|
||||
#ifdef _CORY_TESTING
|
||||
#define GEOMETRY_FILTER L"SL Geometry (*.slg)\0*.slg\0"
|
||||
@@ -773,9 +773,9 @@ Boolean LLFilePickerBase::navOpenFilterProc(AEDesc *theItem, void *info, void *c
|
||||
}
|
||||
else if (filter == FFLOAD_ANIM)
|
||||
{
|
||||
if (fileInfo.filetype != 'BVH ' &&
|
||||
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
|
||||
)
|
||||
if (fileInfo.filetype != 'BVH ' && fileInfo.filetype != 'ANIM' &&
|
||||
(fileInfo.extension && (CFStringCompare(fileInfo.extension, CFSTR("bvh"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) &&
|
||||
CFStringCompare(fileInfo.extension, CFSTR("anim"), kCFCompareCaseInsensitive) != kCFCompareEqualTo))
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
@@ -1388,10 +1388,14 @@ static std::string add_wav_filter_to_gtkchooser(GtkWindow *picker)
|
||||
LLTrans::getString("sound_files") + " (*.wav)");
|
||||
}
|
||||
|
||||
static std::string add_bvh_filter_to_gtkchooser(GtkWindow *picker)
|
||||
static std::string add_anim_filter_to_gtkchooser(GtkWindow *picker)
|
||||
{
|
||||
return add_simple_pattern_filter_to_gtkchooser(picker, "*.bvh",
|
||||
LLTrans::getString("animation_files") + " (*.bvh)");
|
||||
GtkFileFilter *gfilter = gtk_file_filter_new();
|
||||
gtk_file_filter_add_pattern(gfilter, "*.bvh");
|
||||
gtk_file_filter_add_pattern(gfilter, "*.anim");
|
||||
std::string filtername = LLTrans::getString("animation_files") + " (*.bvh; *.anim)";
|
||||
add_common_filters_to_gtkchooser(gfilter, picker, filtername);
|
||||
return filtername;
|
||||
}
|
||||
|
||||
static std::string add_xml_filter_to_gtkchooser(GtkWindow *picker)
|
||||
@@ -1545,7 +1549,7 @@ bool LLFilePickerBase::getLoadFile(ELoadFilter filter, std::string const& folder
|
||||
filtername = add_wav_filter_to_gtkchooser(picker);
|
||||
break;
|
||||
case FFLOAD_ANIM:
|
||||
filtername = add_bvh_filter_to_gtkchooser(picker);
|
||||
filtername = add_anim_filter_to_gtkchooser(picker);
|
||||
break;
|
||||
case FFLOAD_COLLADA:
|
||||
filtername = add_collada_filter_to_gtkchooser(picker);
|
||||
|
||||
Reference in New Issue
Block a user