summaryrefslogtreecommitdiff
path: root/indra
AgeCommit message (Collapse)Author
2012-02-15Add LLProcess::ReadPipe::size(), peek(), contains().Nat Goodspeed
Also add "len" key to event data on LLProcess::getPump(). If you've used setLimit(), event["data"].length() may not reflect the length of the accumulated data in the ReadPipe. Add unit test with stdin/stdout handshake with child process.
2012-02-15VS2010 doesn't know how to compute min(4096, size_t) :-PNat Goodspeed
2012-02-15Fix llprocess_test.cpp's exception catching for Linux.Nat Goodspeed
In the course of re-enabling the indra/test tests last year, Log generalized a workaround I'd introduced in llsdmessage_test.cpp. In Linux viewer land, a test program trying to catch an expected exception can't seem to catch it by its specific class (across the libllcommon.so boundary), but must instead catch std::runtime_error and validate the typeid().name() string. Log added a macro for this idiom in llevents_tut.cpp. Generalize that macro further for normal-case processing as well, move it to a header file of its own and use it in all known places -- plus the new exception-catching tests in llprocess_test.cpp.
2012-02-15Add tests for LLProcess::get[Opt][Read|Write]Pipe() validations.Nat Goodspeed
2012-02-15Preliminary pipe support for LLProcess.Nat Goodspeed
Add LLProcess::FileParam to specify how to construct each child's standard file slot, with lots of comments about features designed but not yet implemented. The point is to design it with enough flexibility to be able to extend to foreseeable use cases. Add LLProcess::Params::files to collect up to 3 FileParam items. Naturally this extends the accepted LLSD syntax as well. Implement type="" (child inherits parent file descriptor) and "pipe" (parent constructs anonymous pipe to pass to child). Add LLProcess::FILESLOT enum, plus methods: getReadPipe(FILESLOT), getOptReadPipe(FILESLOT) getWritePipe(), getOptWritePipe() getPipeName(FILESLOT): placeholder implementation for now Add LLProcess::ReadPipe and WritePipe classes, as returned by get*Pipe(). WritePipe supports get_ostream() method for streaming to child stdin. ReadPipe supports get_istream() method for reading from child stdout/stderr. It also provides getPump() returning LLEventPump& so interested parties can listen for arrival of new data on the aforementioned std::istream. For "pipe" slots, instantiate appropriate *Pipe class. ReadPipe and WritePipe classes are pure virtual bases for ReadPipeImpl and WritePipeImpl, respectively: all implementation data are hidden in the latter classes, visible only in llprocess.cpp. In fact each *PipeImpl class registers itself for "mainloop" ticks, attempting nonblocking I/O to the underlying apr_file_t on each tick. Data are buffered in a boost::asio::streambuf, which bridges between std::[io]stream and the APR I/O calls. Sanity-test ReadPipeImpl by using a pipe to absorb the Python "SyntaxError" output from the successful syntax_error test, rather than alarming the user. Add first few unit tests for validating FileParam. More tests coming!
2012-02-13Use per-frame ticks on "mainloop" LLEventPump to update LLProcess.Nat Goodspeed
When we reimplemented LLProcess on APR, necessitating APR's funny callback mechanism to sense child-process status, every isRunning() or getStatus() call called the APR poll function that calls ALL registered LLProcess callbacks. In other words, every time any consumer called any LLProcess::isRunning() method, all LLProcess callbacks were redundantly fired. Change that so that the single APR poll function is called once per frame, courtesy of the "mainloop" LLEventPump. Once per viewer frame should be well within the realtime duration in which it's reasonable to expect child-process status to change. In effect, this changes LLProcess's public API to introduce a dependency on "mainloop" ticks. Add such ticks to llprocess_test.cpp as well.
2012-02-13Add unit tests for LLProcess::Status functionality.Nat Goodspeed
2012-02-13Suppress a specific unused-var warning on Posix platforms.Nat Goodspeed
2012-02-12Automated merge with ssh://hg.lindenlab.com/nat/viewer-new-aprNat Goodspeed
2012-02-10Eliminate ManifestError for wildcards matching 0 files.Nat Goodspeed
Turns out that some (many?) wildcard LLManifest.path(wildcard) calls are "just in case": sweep up any (e.g.) "*.tga" files there may be, but no problem if there are none. Change path() logic so it tries the next tree (source, artwork, build) if either a specific (non-wildcard) filename doesn't exist, as now, OR if a wildcard matches 0 files in the current tree. This continues to support "just in case" wildcards, while permitting wildcards to work in the artwork and build trees as well as the source tree. Use a more specific exception than ManifestError for missing file. Only in that case should we try the next tree. Any other ManifestError should propagate.
2012-02-10Merge daggy fix in rev a05866ebfea2 (Linux lib wildcards)Nat Goodspeed
2012-02-10Use wildcards instead of many version-specific lib names on Linux.Nat Goodspeed
viewer_manifest.py's Linux_i686Manifest class has contained directives to copy library files with names like (e.g.) "libapr-1.so.0.4.2", which means that every update to any such library requires messing with viewer_manifest.py. But LLManifest.path() claims to support wildcards, and it's more robust to specify "libapr-1.so*" instead. Unfortunately LLManifest.path()'s wildcard support only used to work for files in the source tree (vs. the artwork tree or the build tree). The logic in path() tries each tree in turn, relying on an exception to make it try the next tree. This exception was raised for a nonexistent specific filename -- but it never used to raise that exception for a wildcard matching 0 files. Instead it would simply report "0 files" and proceed, producing an invalid viewer install. Raise that exception for a wildcard matching nothing. This forces path() to consider the artwork tree and the build tree, permitting us to use wildcards in library names. Define an exception specific to LLManifest: ManifestException rather than the generic Python RuntimeException. Make it a subclass of RuntimeException so any existing callers expecting to catch RuntimeException will continue to work.
2012-02-09Remove LLJob class: apr_procattr_autokill_set() should now handle.Nat Goodspeed
LLJob was vestigial code from before migrating Job Object support into APR. Also add APR signal-name string to getStatusString() output.
2012-02-07Automated merge with file:C%3A%5CUsers%5CNat%5Clinden%5Cviewer-tut-fixNat Goodspeed
2012-02-07Disable MSVC warning C4702 (unreachable code) in Boost headers.Nat Goodspeed
2012-02-07Use os.path.normcase(os.path.normpath()) when comparing directories.Nat Goodspeed
Once again we've been bitten by comparison failure between "c:\somepath" and "C:\somepath". Normalize paths in both Python helper scripts to make that comparison more robust.
2012-02-07On Linux, #undef Status: we use that name for nested LLProcess struct.Nat Goodspeed
Apparently something in the Linux system header chain #defines a macro Status as 'int'. That's just Bad in C++ land. It should at the very least be a typedef! #undefining it in llprocess.h permits the viewer to build.
2012-02-07LLProcess::Status enum values need qualification in helper function.Nat Goodspeed
2012-02-07Convert LLProcess implementation from platform-specific to using APR.Nat Goodspeed
Include logic to engage Linden apr_procattr_autokill_set() extension: on Windows, magic CreateProcess() flag must be pushed down into apr_proc_create() level. When using an APR package without that extension, present implementation should lock (e.g.) SLVoice.exe lifespan to viewer's on Windows XP but probably won't on Windows 7: need magic flag on CreateProcess(). Using APR child-termination callback requires us to define state (e.g. LLProcess::RUNNING). Take the opportunity to present Status, capturing state and (if terminated) rc or signal number; but since most of the time all caller really wants is to log the outcome, also present status string, encapsulating logic to examine state and describe exited-with-rc vs. killed-by-signal. New Status logic may report clearer results in the case of a Windows child process killed by exception. Clarify that static LLProcess::isRunning(handle) overload is only for use when the original LLProcess object has been destroyed: really only for unit tests. We necessarily retain our original platform-specific implementations for just that one method. (Nonstatic isRunning() no longer calls static method.) Clarify log output from llprocess_test.cpp in a couple places.
2012-02-06ManageAPR should be noncopyable. Make that explicit.Nat Goodspeed
Any RAII class should either be noncopyable or should deal appropriately with a copy operation. ManageAPR is intended only for extremely simple cases, and hence should be noncopyable.
2012-02-06increment viewer version to 3.3.0Oz Linden
2012-02-03merge changes for vmrg-222Oz Linden
2012-02-03EXP-1868 FIX Remove Merchant Outbox from Me menuRichard Linden
removed merchant outbox context menu reviewed by Leslie
2012-02-03EXP-1868 FIX Remove Merchant Outbox from Me menuRichard Linden
reviewed by Leslie
2012-02-03Automated merge with file:///Users/nat/linden/viewer-tut-fixNat Goodspeed
2012-02-03Escape all strings embedded in TeamCity service messages.Nat Goodspeed
TeamCity requires that certain characters (notably "'") must be escaped when embedded in service messages: http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ServiceMessages TUT frequently outputs messages containing "'", e.g. from ensure_equals() failure. We've seen TC output nesting get confused when it fails to process service messages properly due to parsing unescaped messages. Along with test<n> number, report test name (from set_test_name()) when available. Eliminate horsing around to produce normal output on both std::cout and possible output file. When output file is specified, use boost::iostreams::tee_device to do fanout for us. Improve placement (and possibly reliability) of service messages. Clean up a startling amount of redundancy in service-message production.
2012-02-03EXP-1843 WIP Added an option to output avatar rez timing.Vadim ProductEngine
Use the new "Avatar Rez" debugging tag to see the output.
2012-02-01mergeBrad Payne (Vir Linden)
2012-01-30Set bit flag on CreateProcess() to allow AssignProcessToJobObject().Nat Goodspeed
Windows 7 and friends tend to create a process already implicitly allocated to a job object, and a process can only belong to a single job object. Passing CREATE_BREAKAWAY_FROM_JOB in CreateProcessA()'s dwCreationFlags seems to bypass the access-denied error observed with AssignProcessToJobObject() otherwise. This change should (!) enable OS lifespan management for SLVoice.exe et al.
2012-01-30increment viewer version to 3.2.9Oz Linden
2012-01-30merge changes for vmrg-219Oz Linden
2012-01-30LLProcess::handle must be qualified when used in LLJob class.Nat Goodspeed
2012-01-30Expose 'handle' as well as 'id' on LLProcess objects.Nat Goodspeed
On Posix, these and the corresponding getProcessID()/getProcessHandle() accessors produce the same pid_t value; but on Windows, it's useful to distinguish an int-like 'id' useful to human log readers versus an opaque 'handle' for passing to platform-specific API functions. So make the distinction in a platform-independent way.
2012-01-30Trim trailing "\r\n" from Windows FormatMessage() string for logging.Nat Goodspeed
2012-01-27On Windows, only quote LLProcess arguments if they seem to need it.Nat Goodspeed
On Posix platforms, the OS argument mechanism makes quoting/reparsing unnecessary anyway, so this only affects Windows. Add optional 'triggers' parameter to LLStringUtils::quote() (default: space and double-quote). Only if the passed string contains a character in 'triggers' will it be double-quoted. This is observed to fix a Windows-specific problem in which plugin child process would fail to start because it wasn't expecting a quoted number. Use LLStringUtils::quote() more consistently in LLProcess implementation for logging.
2012-01-25Introduce two new parameters "CurlUseMultipleThreads" and ↵Xiaohong Bao
"CurlRequestTimeOut" for QA to test Curl.
2012-01-25Automated merge with https://bitbucket.org/VirLinden/vir-project-3Xiaohong Bao
2012-01-25fix for SH-2904: textures remain stuck in HTP stateXiaohong Bao
2012-01-24SH-2791 Use request class constructor/destructor for keeping track of ↵Dave Parks
concurrent requests instead of unreliable increments/decrements sprinkled around the code.
2012-01-30mergeBrad Payne (Vir Linden)
2012-01-24merge changes for vmrg-218Oz Linden
2012-01-24mergeDave Parks
2012-01-24SH-1427 Fix for spot lights not working properly on alpha objects, and fix ↵Dave Parks
for alpha lighting of point lights not matching deferred lights.
2012-01-24mergeBrad Payne (Vir Linden)
2012-01-23Reverting background fetch on an item to the old fetFromServer call to fix ↵Leslie Linden
regression bug in inventory late loading
2012-01-23Reverting rev 22217 changes to background fetch so search and recent will ↵Leslie Linden
fully fetch user inventory
2012-01-23Clarify that items in LLProcess::Params::args are implicitly quoted.Nat Goodspeed
That is, we try to pass through each args entry as a separate child-process arvg[] entry, whitespace and all.
2012-01-23LLStringUtil methods are conventionally static.Nat Goodspeed
2012-01-23Use LLProcess::Params::args::empty() instead of comparing iterators.Nat Goodspeed
2012-01-23* Optimization to not waste some time doing std::string assignment all over ↵Leslie Linden
the graphics code. Reviewed by davep.