Commit Graph

40159 Commits (5da30ce4a492c913bc4e187a0cc60ebe4b3f503b)

Author SHA1 Message Date
Nat Goodspeed 5da30ce4a4 DRTVWR-476: Kill LLEventQueue, per-frame LLEventPump::flush() calls.
No one uses LLEventQueue to defer posted events until the next mainloop tick
-- and with LLCoros moving to Boost.Fiber, cross-coroutine event posting works
that way anyway, making LLEventQueue pretty unnecessary.

The static RegisterFlush instance in llevents.cpp was used to call
LLEventPumps::flush() once per mainloop tick, which in turn called flush() on
every registered LLEventPump. But the only reason for that mechanism was to
support LLEventQueue. In fact, when LLEventMailDrop overrode its flush()
method for something quite different, it was startling to find that the new
flush() override was being called once per frame -- which caused at least one
fairly mysterious bug. Remove RegisterFlush. Both LLEventPumps::flush() and
LLEventPump::flush() remain for now, though intended usage is unclear.

Eliminating LLEventQueue means we must at least repurpose
LLEventPumps::mQueueNames, a map intended to make LLEventPumps::obtain()
instantiate an LLEventQueue rather than the default LLEventPump. Replace it
with mFactories, a map from desired instance name to a callable returning
LLEventPump*. New map initialization syntax plus lambda support allows us to
populate that map at compile time with little lambdas returning the correct
subclass instance.

Similarly, LLLeapListener::newpump() used to check the ["type"] entry in the
LLSD request specifically for "LLEventQueue". Introduce another such map in
llleaplistener.cpp for potential future extensibility.

Eliminate the LLEventQueue-specific test.
2019-10-17 13:26:51 -04:00
Nat Goodspeed 7acc7a5b3c DRTVWR-476: Introduce LLEventMailDrop::discard() (instead of flush()).
Overriding virtual LLEventPump::flush() for the semantic of discarding
LLEventMailDrop's queued events turns out not to be such a great idea, because
LLEventPumps::flush(), which calls every registered LLEventPump's flush()
method, is called every mainloop tick. The first time we hit a use case in
which we expected LLEventMailDrop to hold queued events across a mainloop tick,
we were baffled that they were never delivered.

Moving that logic to a separate method specific to LLEventMailDrop resolves
that problem. Naming it discard() clarifies its intended functionality.
2019-10-17 12:04:02 -04:00
Nat Goodspeed 7ccd902b89 DRTVWR-476: Directly reference LLVivoxVoiceClient::mVivoxPump.
The LLEventMailDrop used to communicate with the Vivox coroutine is a member
of LLVivoxVoiceClient. We don't need to keep looking it up by its string name
in LLEventPumps.
2019-10-16 11:19:29 -04:00
Nat Goodspeed 97f834df22 DRTVWR-476: Add LLEventLogProxy, LLEventLogProxyFor<T>.
LLEventLogProxy can be introduced to serve as a logging proxy for an existing
LLEventPump subclass instance. Access through the LLEventLogProxy will be
logged; access directly to the underlying LLEventPump will not.

LLEventLogProxyFor<LLEventPumpSubclass> functions as a drop-in replacement for
the original LLEventPumpSubclass instance. It internally instantiates
LLEventPumpSubclass and serves as a proxy for that instance.

Add unit tests for LLEventMailDrop and LLEventLogProxyFor<LLEventMailDrop>,
both "plain" (events only) and via lleventcoro.h synchronization.
2019-10-16 09:15:47 -04:00
Nat Goodspeed d57186d84f DRTVWR-476: Validate LLEventPumpOrPumpName replyPump
passed to postAndSuspendsetup().

The requestPump is optional, and the function varies its behavior depending on
whether that parameter is empty or meaningful. But it unconditionally uses the
replyPump. Passing an empty LLEventPumpOrPumpName caused mysterious crashes.
Add llassert_always_msg() to make the coding error explicit in such a case.

Also streamline access to meaningful requestPump and replyPump by temporarily
caching the bound LLEventPump reference.
2019-10-16 08:52:51 -04:00
Nat Goodspeed 94a50320fb DRTVWR-476: Remove special case for listen(boost::bind(weak_ptr)).
LLEventDetail::visit_and_connect() promised special treatment for the
specific case when an LLEventPump::listen() listener was composed of (possibly
nested) boost::bind() objects storing boost::weak_ptr values -- specifically
boost::bind() rather than std::bind or lambdas, specifically boost::weak_ptr
rather than std::weak_ptr.

Outside of self-tests, it does not appear that anyone actually uses that
support.

There is good reason not to: it's a silent side effect of a complicated
compile-time inspection that could be silently derailed by use of std::bind()
or a lambda or a std::weak_ptr. Can you be sure you've engaged that promise?
How?

A more robust guarantee can be achieved by storing an LLTempBoundConnection in
the transient object itself. When the object is destroyed, the listener is
disconnected. Normal C++ rules around object destruction guarantee it. This
idiom is widely used.

There are a couple good reasons to remove the visit_and_connect() machinery:

* boost::bind() and boost::weak_ptr do not constitute the wave of the future.
  Preferring those constructs to lambdas and std::weak_ptr penalizes new code,
  whether by silently failing or by discouraging use of modern idioms.
* The visit_and_connect() machinery was always complicated, and apparently
  never very robust. Most of its promised features have been commented out
  over the years. Making the code base simpler, clearer and more maintainable
  is always a useful effect.

LLEventDetail::visit_and_connect() was also used by the four
LLNotificationChannelBase::connectMumble() methods. Streamline those as well.

Of course, remove related test code.
2019-10-15 23:06:04 -04:00
Nat Goodspeed 401023ec7a DRTVWR-476: Remove llwrap(), LLListenerWrapper[Base] and support.
The only usage of any of this was in test code.
2019-10-15 16:16:55 -04:00
Nat Goodspeed bdb87556ff DRTVWR-476: Update to viewer-manager build 531762 2019-10-15 14:30:19 -04:00
Nat Goodspeed 279594dcc1 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2019-10-15 13:56:39 -04:00
Nat Goodspeed 33821bd599 increment viewer version to 6.3.3 2019-10-15 13:27:53 -04:00
Nat Goodspeed b26bdc8987 Added tag 6.3.2-release for changeset 07f5d5bc9fae 2019-10-15 13:27:53 -04:00
Nat Goodspeed e29b9ce3b2 DRTVWR-476: Add llsd::array() and llsd::map() variadic functions.
llsd::array(), as one might suspect, takes an arbitrary number of arguments of
arbitrary convertible types and returns an LLSD::Array constructed from those
elements. This supercedes the older LLSDArray class.

llsd::map() takes an even number of arguments paired as (LLSD::String,
arbitrary convertible type) and returns an LLSD::Map constructed from those
(key, value) pairs. This supercedes the older LLSDMap class.

These two functions not only have a simpler API -- arbitrary function
arguments rather than an (arg list)(arg list) sequence -- but also
specifically return a final LLSD object, rather than needing conversion to
LLSD from the LLSDArray or LLSDMap object.

Also support LLSD == LLSD and LLSD != LLSD comparisons, using llsd_equals()
with default exact-float-equality semantics.
2019-10-14 15:49:37 -04:00
Nat Goodspeed 64ac480afe DRTVWR-476: Engage variadic llmake() implementation. 2019-10-14 15:43:06 -04:00
Nat Goodspeed 18bb6d5d49 DRTVWR-476: Make test program --debug switch work like LOGTEST=DEBUG.
The comments within indra/test/test.cpp promise that --debug is, in fact, like
LOGTEST=DEBUG. Until now, that was a lie. LOGTEST=level displayed log output
on stderr as well as in testprogram.log, while --debug did not.

Add LLError::logToStderr() function, and make initForApplication() (i.e.
commonInit()) call that instead of instantiating RecordToStderr inline. Also
call it when test.cpp recognizes --debug switch.

Remove the mFileRecorder, mFixedBufferRecorder and mFileRecorderFileName
members from SettingsConfig. That tactic doesn't scale.

Instead, add findRecorder<RECORDER>() and removeRecorder<RECORDER>() template
functions to locate (or remove) a RecorderPtr to an object of the specified
subclass. Both are based on an underlying findRecorderPos<RECORDER>() template
function. Since we never expect to manage more than a handful of RecorderPtrs,
and since access to the deleted members is very much application setup rather
than any kind of ongoing access, a search loop suffices.

logToFile() uses removeRecorder<RecordToFile>() rather than removing
mFileRecorder (the only use of mFileRecorder).

logToFixedBuffer() uses removeRecorder<RecordToFixedBuffer>() rather than
removing mFixedBufferRecorder (the only use of mFixedBufferRecorder).

Make RecordToFile store the filename with which it was instantiated. Add a
getFilename() method to retrieve it. logFileName() is now based on
findRecorder<RecordToFile>() instead of mFileRecorderFileName (the only use of
mFileRecorderFileName).

Make RecordToStderr::mUseANSI a simple bool rather than a three-state enum,
and set it immediately on construction. Apparently the reason it was set
lazily was because it consults its own checkANSI() method, and of course
'this' doesn't acquire the leaf class type until the constructor has completed
successfully. But since nothing in checkANSI() depends on anything else in
RecordToStderr, making it static solves that problem.
2019-10-14 15:41:09 -04:00
Nat Goodspeed 4aa4a52c08 DRTVWR-476: Fix overflow case in llcoro::postAndSuspend().
Actually the fix is in postAndSuspendSetup(), which affects postAndSuspend(),
postAndSuspendWithTimeout(), suspendUntilEventOnWithTimeout() and
suspendUntilEventOn().

By "overflow case" we mean the special circumstance in which:

* the LLEventPump in question is an LLEventMailDrop, meaning its listeners
  eventually expect to see every post()ed value
* one of the listeners is supposed to consume those values (has called
  LLCoros::set_consuming(true))
* post() is called more than once before that listener is resumed.

The magic of postAndSuspend() (et al.) is a temporary LLCoros::Promise. The
waiting coroutine calls get() on the corresponding Future, causing it to
suspend (as promised) until the Promise is fulfilled.

With the Boost.Fiber implementation of coroutines, fulfilling the Promise
doesn't immediately resume the suspended coroutine -- it merely marks it ready
to resume, next time the scheduler gets control.

A second post() call before the suspended coroutine is resumed results in a
second call to Promise::set_value(). But Promise is a one-shot entity. This
results in a promise_already_satisfied exception. Because a second post() call
during that time window is perfectly reasonable, we catch that exception and
carry on.

The tricky part is: when that exception is thrown, what should the listener
return? Previously we were returning the listener's current consuming setting,
just as when the set_value() call succeeds.

But when the LLEventPump is an LLEventMailDrop, and the listener's consuming
flag is true, that told LLEventMailDrop::post() that the value got through,
and that it needn't bother to save it in its history queue. The net effect was
to discard the value.

Instead, return the listener's consuming flag only when Promise::set_value()
succeeds. When it throws promise_already_satisfied, unconditionally return
false. That directs LLEventMailDrop::post() to enqueue the undelivered value
so that the *next* suspendUntilEventOn() call can pick it up.
2019-10-07 17:18:29 -04:00
Nat Goodspeed b754eba78b DRTVWR-476: Fix Windows line endings 2019-10-04 08:45:00 -04:00
Nat Goodspeed 35dfa830d2 DRTVWR-476: Update to viewer-manager build 531568 2019-10-03 17:18:46 -04:00
Nat Goodspeed 342f04a9ad DRTVWR-476: Update to openjpeg build 531548 2019-10-03 13:52:07 -04:00
Nat Goodspeed 0f612be5f6 DRTVWR-476: Update vlc-bin, jsoncpp, pcre, libndofdev, libhunspell, bugsplat, fmodex, llca, jpeglib, libxml2, slvoice, glod, dullahan, glext, kdu, uriparser, glh_linear, tut, nghttp2, dictionaries, zlib, llphysicsextensions_source, openjpeg, nvapi, expat, viewer-manager, google_breakpad, libpng, ogg_vorbis, openssl, xmlrpc-epi, apr_suite, freetype, boost, colladadom, googlemock, curl, havok-source
Update vlc-bin to codeticket version 531366.
Update jsoncpp to codeticket version 531360.
Update pcre to codeticket version 531373.
Update libndofdev to codeticket version 531359.
Update libhunspell to codeticket version 531369.
Update bugsplat to codeticket version 531352.
Update fmodex to codeticket version 531266.
Update llca to codeticket version 531253.
Update jpeglib to codeticket version 531361.
Update libxml2 to codeticket version 531380.
Update slvoice to codeticket version 531358.
Update glod to codeticket version 531370.
Update dullahan to codeticket version 531387.
Update glext to codeticket version 531247.
Update kdu to codeticket version 531363.
Update uriparser to codeticket version 531367.
Update glh_linear to codeticket version 531260.
Update tut to codeticket version 531246.
Update nghttp2 to codeticket version 531364.
Update dictionaries to codeticket version 531288.
Update zlib to codeticket version 531372.
Update llphysicsextensions_source to codeticket version 531362.
Update openjpeg to codeticket version 531368.
Update nvapi to codeticket version 531376.
Update expat to codeticket version 531365.
Update viewer-manager to codeticket version 531239.
Update google_breakpad to codeticket version 531388.
Update libpng to codeticket version 531386.
Update ogg_vorbis to codeticket version 531357.
Update openssl to codeticket version 531379.
Update xmlrpc-epi to codeticket version 531374.
Update apr_suite to codeticket version 531375.
Update freetype to codeticket version 531385.
Update boost to codeticket version 531381.
Update colladadom to codeticket version 531391.
Update googlemock to codeticket version 531390.
Update curl to codeticket version 531389.
Update havok-source to codeticket version 531509.
2019-10-02 16:34:05 -04:00
Nat Goodspeed 4566bcd1f8 DRTVWR-476: Update to havok-source build 531405 2019-09-28 19:31:32 -04:00
Nat Goodspeed b0f9d5c839 Automated merge with ssh://bitbucket.org/lindenlab/viewer-xcode11 2019-09-28 12:41:22 -04:00
Nat Goodspeed 52c9f57819 DRTVWR-476: Track change to NSView in Xcode 11's 10.15 SDK. 2019-09-25 16:48:36 -04:00
Nat Goodspeed c0b13466f1 DRTVWR-476: Add Stack Overflow link for Brad's Xcode 11 signing fix. 2019-09-25 16:46:49 -04:00
Nat Goodspeed b5dbcbd8f8 Automated merge with ssh://bitbucket.org/lindenlabinternal/viewer-xcode11 2019-09-25 16:31:33 -04:00
Nat Goodspeed 8070100626 Automated merge with ssh://bitbucket.org/lindenlabinternal/viewer-xcode11 2019-09-25 16:29:48 -04:00
Brad Kittenbrink 5d671ff210 Disabled broken automatic code signing for local development when using Xcode 11 2019-09-25 12:53:38 -07:00
Nat Goodspeed 77621dd3fc Automated merge with ssh://bitbucket.org/lindenlab/viewer-vs2017 2019-09-24 14:35:26 -04:00
Nat Goodspeed 44ce972fc4 DRTVWR-476: Re-enable an llcoproceduremanager_test case.
Use new Sync class to make the driving logic wait for the coprocedure to run.
2019-09-19 16:36:41 -04:00
AndreyL ProductEngine 2f7b606202 Backed out changeset: 8e228364f324 2019-09-14 05:14:24 +03:00
AndreyL ProductEngine 548d688adf Backed out changeset: b4182ee25942 2019-09-14 05:14:07 +03:00
AndreyL ProductEngine 28640c19e8 Backed out changeset: 4273d752fb17 2019-09-14 05:13:58 +03:00
AndreyL ProductEngine ddbe9583ff Backed out changeset: a6398f90389a 2019-09-14 05:13:53 +03:00
AndreyL ProductEngine a07b64d30e Backed out changeset: 4a7dac768fae 2019-09-14 05:13:45 +03:00
AndreyL ProductEngine 423a9645e0 Backed out changeset: 20da15768791 2019-09-14 05:13:35 +03:00
AndreyL ProductEngine a100d62783 Backed out changeset: 8da237b54852 2019-09-14 05:13:27 +03:00
AndreyL ProductEngine 11390ad8ed Backed out changeset: 122dc88276c7 2019-09-14 05:13:19 +03:00
AndreyL ProductEngine 1b2579eca2 SL-11536 Backed out CEF update (changeset: c246ab81b298) 2019-09-14 02:28:34 +03:00
Nat Goodspeed b3675542e1 DRTVWR-476: Add Sync class to help with stepwise coroutine tests.
Sync is specifically intended for test programs. It is based on an
LLScalarCond<int>. The idea is that each of two coroutines can watch for the
other to get a chance to run, indicated by incrementing the wrapped int and
notifying the wrapped condition_variable. This is less hand-wavy than calling
llcoro::suspend() and hoping that the other routine will have had a chance to
run.

Use Sync in lleventcoro_test.cpp.

Also refactor lleventcoro_test.cpp so that instead of a collection of static
data requiring a clear() call at start of each individual test function, the
relevant data is all part of the test_data struct common to all test
functions. Make the helper coroutine functions members of test_data too.

Introduce llcoro::logname(), a convenience function to log the name of the
currently executing coroutine or "main" if in the thread's main coroutine.
2019-09-11 09:33:07 -04:00
Nat Goodspeed 97d611eedc DRTVWR-476: Improve llprocess_test.cpp diagnostic output.
If the test<1>() child process terminates with nonzero rc, also report any
stdout/stderr it might have emitted first.
2019-09-10 17:21:34 -04:00
AndreyL ProductEngine 535aad96af Downstream merge from lindenlab/viewer-lynx 2019-09-10 23:17:02 +03:00
Nat Goodspeed 24c7d14199 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2019-09-10 11:54:43 -04:00
Nat Goodspeed e241670694 increment viewer version to 6.3.2 2019-09-10 11:40:40 -04:00
Nat Goodspeed 4798dea988 Added tag 6.3.1-release for changeset ece699718f16 2019-09-10 11:40:39 -04:00
AndreyL ProductEngine 05f1e3e713 Merged in lindenlab/viewer-lynx 2019-09-05 21:53:24 +03:00
AndreyL ProductEngine e8194e6aba SL-11856 Backed out SL-11012
changeset: 0d43d9754b79
2019-09-03 00:25:07 +03:00
Nat Goodspeed ff60e1049d Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2019-08-26 15:34:47 -04:00
AndreyL ProductEngine 1aedd96cd1 Merged in lindenlab/viewer-release 2019-08-26 22:21:30 +03:00
Nat Goodspeed 5986bf4826 increment viewer version to 6.3.1 2019-08-26 14:55:20 -04:00
Nat Goodspeed 3208ce1b7a Added tag 6.3.0-release for changeset 9777aec6dc4a 2019-08-26 14:55:19 -04:00
Nat Goodspeed 716c552f0b DRTVWR-476: Update to libndofdev build 530327 2019-08-22 20:01:50 -04:00