This commit is contained in:
Shyotl
2014-08-31 00:05:11 -05:00
19 changed files with 61 additions and 138 deletions

View File

@@ -407,7 +407,7 @@ void AIEngine::setMaxCount(F32 StateMachineMaxTime)
sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000;
}
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
char const* AIStateMachine::event_str(event_type event)
{
switch(event)

View File

@@ -330,7 +330,7 @@ public:
bool mDebugAdvanceStatePending; // True while advance_state() was called by not handled yet.
bool mDebugRefCalled; // True when ref() is called (or will be called within the critial area of mMultiplexMutex).
#endif
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
protected:
bool mSMDebug; // Print debug output only when true.
#endif
@@ -343,7 +343,7 @@ public:
mThreadId(AIThreadID::none), mDebugLastState(bs_killed), mDebugShouldRun(false), mDebugAborted(false), mDebugContPending(false),
mDebugSetStatePending(false), mDebugAdvanceStatePending(false), mDebugRefCalled(false),
#endif
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
mSMDebug(debug),
#endif
mRuntime(0)
@@ -428,7 +428,7 @@ public:
// Return stringified state, for debugging purposes.
char const* state_str(base_state_type state);
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
char const* event_str(event_type event);
#endif

View File

@@ -182,7 +182,7 @@ class AIStateMachineThreadBase : public AIStateMachine {
protected:
AIStateMachineThreadBase(CWD_ONLY(bool debug))
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
: AIStateMachine(debug)
#endif
{ }
@@ -222,7 +222,7 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
public:
// Constructor.
AIStateMachineThread(CWD_ONLY(bool debug))
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
: AIStateMachineThreadBase(debug)
#endif
{

View File

@@ -77,7 +77,7 @@ class AITimer : public AIStateMachine {
public:
AITimer(CWD_ONLY(bool debug = false)) :
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
AIStateMachine(debug),
#endif
mInterval(0) { DoutEntering(dc::statemachine(mSMDebug), "AITimer(void) [" << (void*)this << "]"); }

View File

@@ -28,97 +28,16 @@
#ifndef CWDEBUG
#ifdef DEBUG_CURLIO
// If CWDEBUG is not defined, but DEBUG_CURLIO is, then replace
// some of the cwd macro's with something that generates viewer
// specific debug output. Note that this generates a LOT of
// output and should not normally be defined.
#include <string>
#include "llpreprocessor.h"
namespace debug {
namespace libcwd {
struct buf2str {
buf2str(char const* buf, int size) : mBuf(buf), mSize(size) { }
char const* mBuf;
int mSize;
};
struct libcwd_do_type {
void on() const { }
};
extern LL_COMMON_API libcwd_do_type const libcw_do;
} // namespace libcwd
enum print_thread_id_t { print_thread_id };
inline void init() { }
struct Indent {
int M_indent;
static ll_thread_local int S_indentation;
enum LL_COMMON_API print_nt { print };
LL_COMMON_API Indent(int indent);
LL_COMMON_API ~Indent();
};
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, libcwd::buf2str const& b2s);
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, Indent::print_nt);
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, print_thread_id_t);
namespace dc {
struct fake_channel {
int mOn;
char const* mLabel;
fake_channel(int on, char const* label) : mOn(on), mLabel(label) { }
fake_channel(void) : mOn(0) { }
fake_channel& operator()(bool) { return *this; }
fake_channel const& operator()(bool) const { return *this; }
bool is_on() const { return !!mOn; }
bool is_off() const { return !mOn; }
void on() const { }
void off() const { }
};
extern LL_COMMON_API fake_channel const warning;
extern LL_COMMON_API fake_channel const curl;
extern LL_COMMON_API fake_channel const curlio;
extern LL_COMMON_API fake_channel const curltr;
extern LL_COMMON_API fake_channel const statemachine;
extern LL_COMMON_API fake_channel const notice;
extern LL_COMMON_API fake_channel const snapshot;
} // namespace dc
} // namespace debug
#define LIBCWD_DEBUG_CHANNELS debug
#define LibcwDoutScopeBegin(a, b, c) do { using namespace debug; using namespace debug::libcwd; llinfos_nf << print_thread_id << (c).mLabel << ": " << Indent::print;
#define LibcwDoutStream llcont
#define LibcwDoutScopeEnd llcont << llendl; } while(0)
#define Debug(x) do { using namespace debug; using namespace debug::libcwd; x; } while(0)
#define Dout(a, b) do { using namespace debug; using namespace debug::libcwd; if ((a).mOn) { llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << b << llendl; } } while(0)
#define DoutEntering(a, b) \
int __slviewer_debug_indentation = 2; \
{ \
using namespace debug; \
using namespace debug::libcwd; \
if ((a).mOn) \
llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << "Entering " << b << llendl; \
else \
__slviewer_debug_indentation = 0; \
} \
debug::Indent __slviewer_debug_indent(__slviewer_debug_indentation);
#else // !DEBUG_CURLIO
#error DEBUG_CURLIO is not supported without libcwd.
// In order to use DEBUG_CURLIO you must install and use libcwd.
// Download libcwd:
// git clone https://github.com/CarloWood/libcwd.git
#endif
#define Debug(x)
#define Dout(a, b)
#define DoutEntering(a, b)
#endif // !DEBUG_CURLIO
#ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info.
#include <iostream>

View File

@@ -366,7 +366,7 @@ void initCurl(void)
if (ssl_version.find("OpenSSL") != std::string::npos)
gSSLlib = ssl_openssl; // See http://www.openssl.org/docs/crypto/threads.html#DESCRIPTION
else if (ssl_version.find("GnuTLS") != std::string::npos)
gSSLlib = ssl_gnutls; // See http://www.gnu.org/software/gnutls/manual/html_node/Thread-safety.html
gSSLlib = ssl_gnutls; // See http://www.gnutls.org/manual/html_node/Thread-safety.html#Thread-safety
else if (ssl_version.find("NSS") != std::string::npos)
gSSLlib = ssl_nss; // Supposedly thread-safe without any requirements.
@@ -387,10 +387,10 @@ void initCurl(void)
}
case ssl_gnutls:
{
// I don't think we ever get here, do we? --Aleric
llassert_always(gSSLlib != ssl_gnutls);
// If we do, then didn't curl_global_init already call gnutls_global_init?
// It seems there is nothing to do for us here.
// Prior to GnuTLS version 3.3.0 mutex locks are setup by calling gnutls_global_init,
// however curl_global_init already called that for us.
// There is nothing to do for us here.
break;
}
case ssl_nss:
{
@@ -527,7 +527,7 @@ namespace AICurlPrivate {
using AICurlInterface::Stats;
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
// CURLOPT_DEBUGFUNCTION function.
extern int debug_callback(CURL*, curl_infotype infotype, char* buf, size_t size, void* user_ptr);
#endif
@@ -1087,7 +1087,10 @@ void CurlEasyRequest::applyDefaultOptions(void)
{
CertificateAuthority_rat CertificateAuthority_r(gCertificateAuthority);
setoptString(CURLOPT_CAINFO, CertificateAuthority_r->file);
setSSLCtxCallback(&curlCtxCallback, NULL);
if (gSSLlib == ssl_openssl)
{
setSSLCtxCallback(&curlCtxCallback, NULL);
}
setopt(CURLOPT_NOSIGNAL, 1);
// Cache DNS look ups an hour. If we set it smaller we risk frequent connect timeouts in cases where DNS look ups are slow.
setopt(CURLOPT_DNS_CACHE_TIMEOUT, 3600);
@@ -1181,7 +1184,7 @@ void CurlEasyRequest::set_timeout_opts(void)
void CurlEasyRequest::create_timeout_object(void)
{
ThreadSafeBufferedCurlEasyRequest* lockobj = NULL;
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
lockobj = static_cast<BufferedCurlEasyRequest*>(this)->get_lockobj();
#endif
mTimeout = new curlthread::HTTPTimeout(mTimeoutPolicy, lockobj);
@@ -1352,7 +1355,7 @@ void BufferedCurlEasyRequest::aborted(U32 http_status, std::string const& reason
}
}
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
static AIPerServicePtr sConnections[64];
void BufferedCurlEasyRequest::connection_established(int connectionnr)

View File

@@ -250,7 +250,7 @@ void AICurlEasyRequestStateMachine::finish_impl(void)
}
AICurlEasyRequestStateMachine::AICurlEasyRequestStateMachine(CWD_ONLY(bool debug)) :
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
AIStateMachine(debug),
#endif
mTotalDelayTimeout(AIHTTPTimeoutPolicy::getDebugSettingsCurlTimeout().getTotalDelay())

View File

@@ -320,7 +320,7 @@ class CurlEasyRequest : public CurlEasyHandle {
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.
bool mIsHttps; // Set if the url starts with "https:".
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
public:
bool mDebugIsHeadOrGetMethod;
#endif
@@ -342,7 +342,7 @@ class CurlEasyRequest : public CurlEasyHandle {
// This class may only be created as base class of BufferedCurlEasyRequest.
// Throws AICurlNoEasyHandle.
CurlEasyRequest(void) : mHeaders(NULL), mHandleEventsTarget(NULL), mContentLength(0), mResult(CURLE_FAILED_INIT), mTimeoutPolicy(NULL), mTimeoutIsOrphan(false)
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
, mDebugIsHeadOrGetMethod(false)
#endif
{ applyDefaultOptions(); }
@@ -475,7 +475,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest {
// Return true if any data was received.
bool received_data(void) const { return mTotalRawBytes > 0; }
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
// Connection accounting for debug purposes.
void connection_established(int connectionnr);
void connection_closed(int connectionnr);

View File

@@ -730,7 +730,7 @@ bool MergeIterator::next(curl_socket_t& fd_out, int& ev_bitmask_out)
//-----------------------------------------------------------------------------
// CurlSocketInfo
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
#undef AI_CASE_RETURN
#define AI_CASE_RETURN(x) case x: return #x;
static char const* action_str(int action)
@@ -2373,7 +2373,7 @@ int BufferedCurlEasyRequest::curlProgressCallback(void* user_data, double dltota
return 0;
}
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size, void* user_ptr)
{
BufferedCurlEasyRequest* request = (BufferedCurlEasyRequest*)user_ptr;
@@ -2441,7 +2441,6 @@ int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size,
}
#endif
#ifdef CWDEBUG
using namespace ::libcwd;
std::ostringstream marker;
marker << (void*)request->get_lockobj() << ' ';
@@ -2450,14 +2449,6 @@ int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size,
if (!debug::channels::dc::curlio.is_on())
debug::channels::dc::curlio.on();
LibcwDoutScopeBegin(LIBCWD_DEBUGCHANNELS, libcw_do, dc::curlio|cond_nonewline_cf(infotype == CURLINFO_TEXT))
#else
if (infotype == CURLINFO_TEXT)
{
while (size > 0 && (buf[size - 1] == '\r' || buf[size - 1] == '\n'))
--size;
}
LibcwDoutScopeBegin(LIBCWD_DEBUGCHANNELS, libcw_do, dc::curlio)
#endif
switch (infotype)
{
case CURLINFO_TEXT:
@@ -2535,12 +2526,10 @@ int debug_callback(CURL* handle, curl_infotype infotype, char* buf, size_t size,
else
LibcwDoutStream << size << " bytes";
LibcwDoutScopeEnd;
#ifdef CWDEBUG
libcw_do.pop_marker();
#endif
return 0;
}
#endif // defined(CWDEBUG) || defined(DEBUG_CURLIO)
#endif // CWDEBUG
} // namespace AICurlPrivate

View File

@@ -86,7 +86,7 @@ public:
#include "aihttptimeout.h"
// If this is set, treat dc::curlio as off in the assertion below.
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
bool gCurlIo;
#endif
@@ -180,7 +180,7 @@ void HTTPTimeout::upload_finished(void)
// ^ ^ ^ ^ ^ ^ ^ ^
// | | | | | | | |
bool HTTPTimeout::data_received(size_t n/*,*/
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
ASSERT_ONLY_COMMA(bool upload_error_status)
#else
ASSERT_ONLY_COMMA(bool)

View File

@@ -91,14 +91,14 @@ class HTTPTimeout : public LLRefCount {
static F64 const sClockWidth_10ms; // Time between two clock ticks in 10 ms units.
static F64 const sClockWidth_40ms; // Time between two clock ticks in 40 ms units.
static U64 sTime_10ms; // Time since the epoch in 10 ms units.
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
ThreadSafeBufferedCurlEasyRequest* mLockObj;
#endif
public:
HTTPTimeout(AIHTTPTimeoutPolicy const* policy, ThreadSafeBufferedCurlEasyRequest* lock_obj) :
mPolicy(policy), mNothingReceivedYet(true), mLowSpeedOn(false), mLastBytesSent(false), mBeingRedirected(false), mUploadFinished(false), mStalled((U64)-1)
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
, mLockObj(lock_obj)
#endif
{ }
@@ -127,7 +127,7 @@ class HTTPTimeout : public LLRefCount {
// Called from BufferedCurlEasyRequest::processOutput if a timeout occurred.
void print_diagnostics(CurlEasyRequest const* curl_easy_request, char const* eff_url);
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
void* get_lockobj(void) const { return mLockObj; }
#endif
@@ -146,7 +146,7 @@ class HTTPTimeout : public LLRefCount {
} // namespace curlthread
} // namespace AICurlPrivate
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
extern bool gCurlIo;
#endif

View File

@@ -149,7 +149,7 @@ void AIServiceBar::draw()
start += LLFontGL::getFontMonospace()->getWidth(text);
}
start = mHTTPView->updateColumn(mc_col, start);
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
text = llformat(" | %d,%d,%d/%d", total_added, event_polls, established_connections, concurrent_connections);
#else
text = llformat(" | %d/%d", total_added, concurrent_connections);

View File

@@ -742,6 +742,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>LiruHighlightNewInventory</key>
<map>
<key>Comment</key>
<string>When false, new inventory items will not be highlighted upon being accepted.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>1</boolean>
</map>
<key>LiruLegacyDisplayMuteds</key>
<map>
<key>Comment</key>

View File

@@ -1303,7 +1303,7 @@ void LLMeshUploadThread::preStart()
AIMeshUpload::AIMeshUpload(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, std::string const& upload_url, bool do_upload,
LLHandle<LLWholeModelFeeObserver> const& fee_observer, LLHandle<LLWholeModelUploadObserver> const& upload_observer) :
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
AIStateMachine(false),
#endif
mMeshUpload(new AIStateMachineThread<LLMeshUploadThread>(CWD_ONLY(false))), mWholeModelUploadURL(upload_url)

View File

@@ -1261,6 +1261,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
LLInventoryView::showAgentInventory(TRUE);
}
if (!gSavedSettings.getBOOL("LiruHighlightNewInventory")) return;
////////////////////////////////////////////////////////////////////////////////
// Highlight item
LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL;

View File

@@ -48,7 +48,7 @@
#include "lluuid.h"
#include "llweb.h"
#include "llcapabilityprovider.h"
#include "m4math.h" // LLMatrix4
#include "llmatrix4a.h" // LLMatrix4a
#include "llhttpclient.h"
// Surface id's

View File

@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="object_weights" title="Avanc<EFBFBD><EFBFBD>">
<floater name="object_weights" title="Mode Avancé">
<floater.string name="nothing_selected" value="--"/>
<text name="selected_text" value="SÉLECTION"/>
<text name="objects" value="--"/>
<text name="objects_label" value="Objets"/>
<text name="objects_label" value="Objet(s)"/>
<text name="prims" value="--"/>
<text name="prims_label" value="Prims"/>
<text name="prims_label" value="Prim(s)"/>
<text name="weights_of_selected_text" value="POIDS DE LA SÉLECTION"/>
<text name="download" value="--"/>
<text name="download_label" value="Téléchargement"/>
<text name="download_label" value="Chargement"/>
<text name="physics" value="--"/>
<text name="physics_label" value="Physique"/>
<text name="server" value="--"/>
<text name="server_label" value="Serveur"/>
<text name="display" value="--"/>
<text name="display_label" value="Affichage"/>
<text name="land_impacts_text" value="IMPACTS SUR LE TERRAIN"/>
<text name="land_impacts_text" value="IMPACT SUR LE TERRAIN"/>
<text name="selected" value="--"/>
<text name="selected_label" value="Sélection"/>
<text name="selected_label" value="Sélectionné(s)"/>
<text name="rezzed_on_land" value="--"/>
<text name="rezzed_on_land_label" value="Rezzés sur le terrain"/>
<text name="rezzed_on_land_label" value="Posés sur le terrain"/>
<text name="remaining_capacity" value="--"/>
<text name="remaining_capacity_label" value="Capacité restante"/>
<text name="total_capacity" value="--"/>

View File

@@ -59,7 +59,7 @@ class AIFetchInventoryFolder : public AIStateMachine {
public:
AIFetchInventoryFolder(CWD_ONLY(bool debug = false)) :
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
AIStateMachine(debug),
#endif
mCreate(false), mFetchContents(false), mExists(false), mCreated(false)

View File

@@ -61,7 +61,7 @@ char const* AIFilePicker::state_str_impl(state_type run_state) const
}
AIFilePicker::AIFilePicker(CWD_ONLY(bool debug)) :
#if defined(CWDEBUG) || defined(DEBUG_CURLIO)
#ifdef CWDEBUG
AIStateMachine(debug),
#endif
mPluginManager(NULL), mCanceled(false)