Commit Graph

25 Commits (master)

Author SHA1 Message Date
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Callum Prentice 547c0665ea DRTVWR-489-emoji: As part of the work to get macOS version of the Viewer working, the flag was introduced to warn (and therefore error out) when a virtual override was not marked with the 'override' keyword. Fixing this up involved a large number of changes and this commit represents just those changes - nothing specially from the DRTVWR-489 viewer
(Cherry pick of 3 commits from Callum to declutter the emoji PR: 3185bdea27,
923733e591 and 6f31fabbc2)
2023-02-14 17:01:22 +01:00
Andrey Lihatskiy ae48c7c8b3 Merge branch 'master' into DRTVWR-513-maint
# Conflicts:
#	indra/llcommon/llerror.cpp
#	indra/newview/llappviewerwin32.cpp
#	indra/newview/llimprocessing.cpp
#	indra/newview/llviewerjoystick.cpp
2020-07-21 11:54:11 +03:00
Andrey Kleshchev 71f6b139f8 SL-13348 Thread crashing singleton #1 2020-05-29 20:10:55 +03:00
Nat Goodspeed 5e7df752a6 DRTVWR-494: Use std:🧵:id for LLThread::currentID().
LLThread::currentID() used to return a U32, a distinct unsigned value
incremented by explicitly constructing LLThread or by calling LLThread::
registerThreadID() early in a thread launched by other means. The latter
imposed an unobvious requirement on new code based on std::thread. Using
std:🧵:id instead delegates to the compiler/library the problem of
distinguishing threads launched by any means.

Change lots of explicit U32 declarations. Introduce LLThread::id_t typedef to
avoid having to run around fixing uses again if we later revisit this decision.

LLMutex, which stores an LLThread::id_t, wants a distinguished value meaning
NO_THREAD, and had an enum with that name. But as std:🧵:id promises
that the default-constructed value is distinct from every valid value,
NO_THREAD becomes unnecessary and goes away.

Because LLMutex now stores LLThread::id_t instead of U32, make llmutex.h
#include "llthread.h" instead of the other way around. This makes LLMutex an
incomplete type within llthread.h, so move LLThread::lockData() and
unlockData() to the .cpp file. Similarly, remove llrefcount.h's #include
"llmutex.h" to break circularity; instead forward-declare LLMutex.

It turns out that a number of source files assumed that #include "llthread.h"
would get the definition for LLMutex. Sprinkle #include "llmutex.h" as needed.

In the SAFE_SSL code in llcorehttp/httpcommon.cpp, there's an ssl_thread_id()
callback that returns an unsigned long to the SSL library. When LLThread::
currentID() was U32, we could simply return that. But std:🧵:id is very
deliberately opaque, and can't be reinterpret_cast to unsigned long.
Fortunately it can be hashed because std::hash is specialized with that type.
2020-03-25 15:28:17 -04:00
andreykproductengine fa15830e02 SL-10291 Replace apr_atomic with standard C++11 functionality 2019-01-15 18:31:17 +02:00
Nat Goodspeed d2c3c2f9fe MAINT-5232: Normalize LLSingleton subclasses.
A shocking number of LLSingleton subclasses had public constructors -- and in
several instances, were being explicitly instantiated independently of the
LLSingleton machinery. This breaks the new LLSingleton dependency-tracking
machinery. It seems only fair that if you say you want an LLSingleton, there
should only be ONE INSTANCE!

Introduce LLSINGLETON() and LLSINGLETON_EMPTY_CTOR() macros. These handle the
friend class LLSingleton<whatevah>;
and explicitly declare a private nullary constructor.

To try to enforce the LLSINGLETON() convention, introduce a new pure virtual
LLSingleton method you_must_use_LLSINGLETON_macro() which is, as you might
suspect, defined by the macro. If you declare an LLSingleton subclass without
using LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() in the class body, you can't
instantiate the subclass for lack of a you_must_use_LLSINGLETON_macro()
implementation -- which will hopefully remind the coder.

Trawl through ALL LLSingleton subclass definitions, sprinkling in
LLSINGLETON() or LLSINGLETON_EMPTY_CTOR() as appropriate. Remove all explicit
constructor declarations, public or private, along with relevant 'friend class
LLSingleton<myself>' declarations. Where destructors are declared, move them
into private section as well. Where the constructor was inline but nontrivial,
move out of class body.

Fix several LLSingleton abuses revealed by making ctors/dtors private:

LLGlobalEconomy was both an LLSingleton and the base class for
LLRegionEconomy, a non-LLSingleton. (Therefore every LLRegionEconomy instance
contained another instance of the LLGlobalEconomy "singleton.") Extract
LLBaseEconomy; LLGlobalEconomy is now a trivial subclass of that.
LLRegionEconomy, as you might suspect, now derives from LLBaseEconomy.

LLToolGrab, an LLSingleton, was also explicitly instantiated by
LLToolCompGun's constructor. Extract LLToolGrabBase, explicitly instantiated,
with trivial subclass LLToolGrab, the LLSingleton instance.

(WARNING: LLToolGrabBase methods have an unnerving tendency to go after
LLToolGrab::getInstance(). I DO NOT KNOW what should be the relationship
between the instance in LLToolCompGun and the LLToolGrab singleton instance.)

LLGridManager declared a variant constructor accepting (const std::string&),
with the comment:
// initialize with an explicity grid file for testing.
As there is no evidence of this being called from anywhere, delete it.

LLChicletBar's constructor accepted an optional (const LLSD&). As the LLSD
parameter wasn't used, and as there is no evidence of it being passed from
anywhere, delete the parameter.

LLViewerWindow::shutdownViews() was checking LLNavigationBar::
instanceExists(), then deleting its getInstance() pointer -- leaving a
dangling LLSingleton instance pointer, a land mine if any subsequent code
should attempt to reference it. Use deleteSingleton() instead.

~LLAppViewer() was calling LLViewerEventRecorder::instance() and then
explicitly calling ~LLViewerEventRecorder() on that instance -- leaving the
LLSingleton instance pointer pointing to an allocated-but-destroyed instance.
Use deleteSingleton() instead.
2016-09-15 20:18:12 -04:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Rider Linden 907efc9cc9 MAINT-5507: Remove llcurl, move constant values and untilities to llcorehttp lib 2015-09-15 17:01:26 -07:00
Rider Linden 196caf21a8 MAINT-5507: Removal of sdrpc client/server
MAINT-5507: removal of LLCurl::Easy, LLCurl::Multi LLCurl::Responder
2015-09-14 16:10:20 -07:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Logan Dethrow a8d49f7cf5 LLProxy code review fixes.
* Removed check_curl_code and check_curl_multi_code from the global namespace.
 * Added comments documenting which thread the public methods of LLProxy should be called from.
 * Corrected grammar in LLSingleton.h
 * Fixed a buffer scope problem in llpacketring.cpp.
2011-09-06 16:54:53 -04:00
Logan Dethrow 6ab0bc8789 LLProxy start of code review cleanup. 2011-09-01 16:44:04 -04:00
Logan Dethrow 5915da89f0 LLProxy cleanup.
Made the socks proxy start first in llstartup.cpp
Moved initialization of the proxy to before the HTTP table fetch
Added Doxygen comments to LLProxy methods.
Removed call to applyProxySettings in llxmlrpctransaction.cpp since the ctor of LLCurlEasyRequest will apply the proxy settings.
2011-08-08 15:53:06 -04:00
Logan Dethrow 37f8847085 LLProxy: Added another attempt to download gpu and feature tables after successfully setting up a proxy.
Other minor changes:
Clarified why we are using SOCKS5 as the "grid" argument to store proxy credentials.
Added class wide logging to the LLProxy class.
2011-08-04 11:17:03 -04:00
Logan Dethrow d3b4cc34a8 LLProxy cleanup.
* Removed early returns in LLStartup::handleSocksProxy
* Corrected some cases that would result in handleSocksProxy not being called again during login if settings changed
* Allowed for short replies in tcp_handshake in LLProxy.cpp
* Renamed LLProxy::isEnabled() to LLProxy::isSocksProxyEnabled() to clarify its use.
2011-08-02 17:18:54 -04:00
Logan Dethrow 97bedac2a1 Proxy: Improved mutex usage in LLProxy. Introduced an LLAtomic member to track the status of the http proxy that can be checked without locking a mutex. 2011-08-02 11:08:07 -04:00
Logan Dethrow d2c72cb7e9 STORM-1112 Input sanitization of proxy options. 2011-07-29 15:38:20 -04:00
Logan Dethrow 859dc52c30 STORM-1112 Protected LLProxy members during cross-thread calls to LLProxy::applyProxySettings() 2011-07-21 15:16:54 -04:00
Logan Dethrow 792667ff8e STORM-1112 Added LLProxy::applyProxySettings() to apply proxy settings to curl handles.
Added call to that function everywhere curl handles are created in the viewer.
2011-07-19 14:20:21 -04:00
Logan Dethrow cb24dff9e3 Code cleanup for the SOCKS 5 proxy viewer. 2011-07-13 16:46:36 -04:00
Logan Dethrow cfce3686de STORM-1112 Fixed network buffers that need to have space for the SOCKS proxy header. 2011-07-13 11:40:50 -04:00
Logan Dethrow 975975029d STORM-1112 Fixed crash on quit. Other minor fixes:
* Reordered HTTP proxy choices in settings dialog
* Now using setBlocking and setNonBlocking LLSocket methods during TCP handshakes.
* Made those LLSocket methods available outside the class.
2011-07-05 16:55:43 -04:00
Logan Dethrow 7717b6f647 STORM-1112 More cleanup of SOCKS 5 proxy code.
Renamed llsocks5.cpp to llproxy.cpp.
2011-06-28 19:54:53 -04:00