Commit Graph

172 Commits (22a851663cddecced21acd88ed8ae4fa9fc733fd)

Author SHA1 Message Date
Aura Linden b0c683344f 10.5 macs will begin looking for mac_legacy rather than mac 2012-08-15 12:49:42 -07:00
Nat Goodspeed a5b0147df4 Automated merge with http://hg.secondlife.com/viewer-release 2012-05-09 22:33:04 -04:00
Nat Goodspeed d29f920c22 CHOP-900: Use new apr_procattr_constrain_handle_set() extension.
Now LLProcess explicitly requests APR to limit the handles passed to any child
process, instead of wantonly passing whatever happens to be lying around the
parent process at the time.
This requires the latest APR build.
Also revert LLUpdateDownloader::Implementation::mDownloadStream to llofstream
(as in rev 1878a57aebd7) instead of apr_file_t*. Using APR for that file was a
Band-Aid -- a single whacked mole -- for the problem more systemically
addressed by apr_procattr_constrain_handle_set().
2012-05-09 19:55:26 -04:00
Nat Goodspeed 7079513c23 IQA-463: Add apr_file_open(APR_CREATE) flag for downloaded installer.
This handles the case when the target file doesn't exist, just as APR_TRUNCATE
handles the case when it does.
Strengthen error checks concerning downloaded installer file from
ll_apr_warn_status() to ll_apr_assert_status(). Failing to recognize (e.g.)
failure to open that file only leads to mysterious crashes down the road; this
removes the mystery.
2012-04-23 14:49:32 -04:00
Nat Goodspeed 78816bb156 IQA-463: Use APR file I/O for downloaded viewer installer .exe.
On Windows, calling CreateProcess(bInheritHandles=FALSE) is the wrong idea. In
that case, CreateProcess() passes NO handles -- even the files you've
explicitly designated as the child's stdin, stdout, stderr in the STARTUPINFO
struct! Remove LLProcess code to tweak bInheritHandles; we should also remove
the corresponding (useless) APR extension.
Instead, given that the Windows file-locking problem we've observed is
specific to the viewer installer .exe file downloaded by the background
updater logic, use APR file I/O for that specific file. Empirically, both
llofstream and std::ofstream seem to make the open file handle inheritable;
but apr_file_open() documentation says: "By default, the returned file
descriptor will not be inherited by child processes created by
apr_proc_create()." And indeed, it does appear to sidestep the locking problem.
2012-04-23 12:01:15 -04:00
Nat Goodspeed 6da3f0907c Automated merge with ssh://hg.lindenlab.com/nat/viewer-new-apr 2012-02-12 21:59:51 -05:00
Richard Linden 2ed1de224a Automated merge with http://hg.secondlife.com/viewer-development 2012-02-06 15:28:45 -08:00
Richard Linden 5a14a67e06 converted a bunch of narrowing implicit conversions to explicit 2012-02-01 13:03:46 -08:00
Nat Goodspeed 47d9475707 Convert LLProcess consumers from LLSD to LLProcess::Params block.
Using a Params block gives compile-time checking against attribute typos. One
might inadvertently set myLLSD["autofill"] = false and only discover it when
things behave strangely at runtime; but trying to set myParams.autofill will
produce a compile error.
However, it's excellent that the same LLProcess::create() method can accept
either LLProcess::Params or a properly-constructed LLSD block.
2012-01-21 11:45:15 -05:00
Nat Goodspeed f0dbb87833 Per Richard, replace LLProcessLauncher with LLProcess.
LLProcessLauncher had the somewhat fuzzy mandate of (1) accumulating
parameters with which to launch a child process and (2) sometimes tracking the
lifespan of the ensuing child process. But a valid LLProcessLauncher object
might or might not have ever been associated with an actual child process.
LLProcess specifically tracks a child process. In effect, it's a fairly thin
wrapper around a process HANDLE (on Windows) or pid_t (elsewhere), with
lifespan management thrown in. A static LLProcess::create() method launches a
new child; create() accepts an LLSD bundle with child parameters. So building
up a parameter bundle is deferred to LLSD rather than conflated with the
process management object.
Reconcile all known LLProcessLauncher consumers in the viewer code base,
notably the class unit tests.
2012-01-20 18:10:40 -05:00
Nat Goodspeed c0731c1c05 Add log message if LLProcessLauncher child fails to execv().
On a Posix platform (vfork()/execv() implementation), if for any reason the
execv() failed (e.g. executable not on PATH), the viewer would never know, nor
the user: the vfork() child produced no output, and terminated with rc 0! Add
logging, make child terminate with nonzero rc.
Remove pointless addArgument(const char*) overload: this does nothing for you
that the compiler won't do implicitly.
In llupdateinstaller.cpp, remove pointless c_str() call in addArgument() arg:
we were starting with a std::string, then extracting its c_str(), only to
construct a whole new std::string from it!
2012-01-17 18:55:42 -05:00
Xiaohong Bao f082de03ff fix for SH-2845, SH-2846, SH-2847, SH-2851: curl crashes and out-of-memory crashes. 2012-01-12 16:36:56 -07:00
Dave Parks cfb666e9d9 merge 2011-11-15 17:04:37 -06:00
Brad Payne (Vir Linden) 1f17228145 merge 2011-10-18 16:24:23 -04:00
Brad Payne (Vir Linden) 47a4ce19c7 SH-2515 WIP - changed app name in linux updater, dir name in windows installer 2011-09-30 13:16:29 -04:00
Brad Payne (Vir Linden) 41d9ad5cd3 SH-2515 WIP - changed app name in mac-updater 2011-09-30 11:06:12 -04:00
Xiaohong Bao 749d9ebadc Merge 2011-08-31 10:48:56 -06:00
Oz Linden f0bc8a0f71 convert tabs to spaces where they are forbidden 2011-08-17 12:33:23 -04:00
Xiaohong Bao d951267467 Merge from viewer-development 2011-07-15 12:14:34 -06:00
Nat Goodspeed 7a7a0f0c1b EXP-772: If URIs returned by SRV fail, fall back on original URI. 2011-05-26 17:25:26 -04:00
Dave Parks 8a92612fd9 merge 2011-05-16 12:34:15 -05:00
Dave Parks 93696ac019 merge 2011-05-12 17:39:08 -05:00
Seth ProductEngine e213a36f70 STORM-477 Restored the backed out changeset: b62b260aa04d 2011-05-11 18:12:23 +03:00
Nat Goodspeed 343ffb9d51 Remove Pth library from viewer build.
This library was only needed on the Mac, and only with the OS X 10.4 SDK. As
of October 2010, we no longer build the viewer with that SDK. The 10.5 SDK
we're currently using directly supports the functionality for which we
originally brought in Pth.
2011-05-05 19:23:55 -04:00
Aleric Inglewood ef490e308c Introduces a LLThreadLocalData class that can be
accessed through the static LLThread::tldata().
Currently this object contains two (public) thread-local
objects: a LLAPRRootPool and a LLVolatileAPRPool.

The first is the general memory pool used by this thread
(and this thread alone), while the second is intended
for short lived memory allocations (needed for APR).
The advantages of not mixing those two is that the latter
is used most frequently, and as a result of it's nature
can be destroyed and reconstructed on a "regular" basis.

This patch adds LLAPRPool (completely replacing the old one),
which is a wrapper around apr_pool_t* and has complete
thread-safity checking.

Whenever an apr call requires memory for some resource,
a memory pool in the form of an LLAPRPool object can
be created with the same life-time as this resource;
assuring clean up of the memory no sooner, but also
not much later than the life-time of the resource
that needs the memory.

Many, many function calls and constructors had the
pool parameter simply removed (it is no longer the
concern of the developer, if you don't write code
that actually does an libapr call then you are no
longer bothered with memory pools at all).

However, I kept the notion of short-lived and
long-lived allocations alive (see my remark in
the jira here: https://jira.secondlife.com/browse/STORM-864?focusedCommentId=235356&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-235356
which requires that the LLAPRFile API needs
to allow the user to specify how long they
think a file will stay open. By choosing
'short_lived' as default for the constructor
that immediately opens a file, the number of
instances where this needs to be specified is
drastically reduced however (obviously, any
automatic LLAPRFile is short lived).

***

Addressed Boroondas remarks in https://codereview.secondlife.com/r/99/
regarding (doxygen) comments. This patch effectively only changes comments.

Includes some 'merge' stuff that ended up in llvocache.cpp
(while starting as a bug fix, now only resulting in a cleanup).

***

Added comment 'The use of apr_pool_t is OK here'.

Added this comment on every line where apr_pool_t
is correctly being used.

This should make it easier to spot (future) errors
where someone started to use apr_pool_t; you can
just grep all sources for 'apr_pool_t' and immediately
see where it's being used while LLAPRPool should
have been used.

Note that merging this patch is very easy:
If there are no other uses of apr_pool_t in the code
(one grep) and it compiles, then it will work.

***

Second Merge (needed to remove 'delete mCreationMutex'
from LLImageDecodeThread::~LLImageDecodeThread).

***

Added back #include <apr_pools.h>.

Apparently that is needed on libapr version 1.2.8.,
the version used by Linden Lab, for calls to
apr_queue_*. This is a bug in libapr (we also
include <apr_queue.h>, that is fixed in (at least) 1.3.7.

Note that 1.2.8 is VERY old. Even 1.3.x is old.

***

License fixes (GPL -> LGPL). And typo in comments.
Addresses merov's comments on the review board.

***

Added Merov's compile fixes for windows.
2011-02-05 15:58:07 +01:00
Loren Shih fbc6e5d639 Automated merge up from viewer-development into mesh-development 2011-02-01 11:28:22 -05:00
Oz Linden f0074f1002 merge changes back from beta branch 2011-02-01 07:22:32 -05:00
Andrew A. de Laix 9fa947ef74 a less brain dead fix for CHOP-369 2011-01-24 14:58:10 -08:00
Andrew A. de Laix 14042f631d fix CHOP-369: catch case of synchronous download failure. 2011-01-24 10:54:08 -08:00
Loren Shih 38f4bad925 Automated merge up from viewer-development 2011-01-21 10:36:29 -05:00
Oz Linden 4f3953763d merge changes from viewer-beta 2011-01-20 20:48:16 -05:00
Andrew A. de Laix 8e4d6bb1ac fix CHOP-366, on temporary errors (e.g. version manager returns other than 200) show error dialog instructing the user to manually install the latest viewer. 2011-01-14 12:59:42 -08:00
Merov Linden 804495ad41 STORM-477 : backout changeset 6f5cb303d3e2 2011-01-13 11:15:47 -08:00
Seth ProductEngine 4af9db7b79 STORM-477 FIXED Re-implemented LLDir::getNextFileInDir() as an iterator object.
- Replaced all existing usages of LLDir::getNextFileInDir() with the new directory iterator object.
- Removed platform specific LLDir::getNextFileInDir() implementation.
2011-01-11 19:50:58 +02:00
Loren Shih fdf19a5268 Automated merge up from viewer-development 2011-01-10 11:20:39 -05:00
Oz Linden a4d5e38535 STORM-826 (workaround): correct mixed and dos-style line endings 2011-01-06 11:06:20 -05:00
Loren Shih 5f99331f4a Automated merge up from viewer-development 2010-12-29 13:23:02 -05:00
Andrew A. de Laix 2c68cb2c69 fix windows build? 2010-12-20 10:38:36 -08:00
brad kittenbrink f95effdacf Better fix for CHOP-286 - reenabled bandwidth limits on linux now that we've fixed the freeze. 2010-12-17 15:59:51 -08:00
brad kittenbrink 63dec2a9b9 Temporary workaround for CHOP-286: bandwidth limits freeze the downloader thread on linux 2010-12-17 14:26:55 -08:00
Andrew A. de Laix 3c3c9a0d49 Automated merge with https://bitbucket.org/mani_linden/viewer-development 2010-12-17 12:07:22 -08:00
Andrew A. de Laix 67a543aa6c ich bin stupid; this should actually fix the windows build. 2010-12-17 12:07:09 -08:00
Andrew A. de Laix 6a6757cab4 don't rely on stream cast to bool behavior; use explicit fail call. 2010-12-17 11:35:26 -08:00
Andrew A. de Laix 049815bd52 and don't break other builds. 2010-12-17 10:55:09 -08:00
Andrew A. de Laix b707048fdf fix windows build (suppress warning from lexical_cast) 2010-12-17 10:53:02 -08:00
Andrew A. de Laix 1774489ef8 Vary install failed message depending on whether it was required or not. 2010-12-16 09:34:19 -08:00
Loren Shih ee0055f5af Automated merge up from viewer-development 2010-12-16 11:12:15 -05:00
Oz Linden 33f745b237 pulling fixes back from viewer-beta 2010-12-15 10:12:49 -05:00
brad kittenbrink 3641d012e3 Merge 2010-12-14 16:19:20 -08:00
Andrew A. de Laix 5b5d2c428c Record update version in download marker so it can be recalled if resumed in another viewer session. 2010-12-14 09:54:28 -08:00