Commit Graph

56 Commits (a17fd2352a9746dd3116f956dcc554f95f17e770)

Author SHA1 Message Date
Ansariel a17fd2352a Merge branch 'DRTVWR-600-maint-A' of https://github.com/secondlife/viewer
# Conflicts:
#	indra/llcharacter/llkeyframemotion.cpp
#	indra/llcharacter/llmotioncontroller.cpp
#	indra/llcrashlogger/llcrashlogger.cpp
#	indra/llimage/llimagetga.cpp
#	indra/llmessage/llregionflags.h
#	indra/llprimitive/lldaeloader.cpp
#	indra/llprimitive/llmodel.cpp
#	indra/llrender/llrendertarget.cpp
#	indra/llui/llconsole.cpp
#	indra/llui/llkeywords.cpp
#	indra/llui/llscrolllistctrl.cpp
#	indra/llui/lltextbase.cpp
#	indra/llui/lltexteditor.cpp
#	indra/llui/llurlentry.cpp
#	indra/newview/llappearancemgr.cpp
#	indra/newview/llappviewer.cpp
#	indra/newview/llfloaterworldmap.cpp
#	indra/newview/llgiveinventory.cpp
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llpanelpeople.cpp
#	indra/newview/llpanelpermissions.cpp
#	indra/newview/llpanelteleporthistory.cpp
#	indra/newview/llvocache.cpp
2024-06-09 16:11:24 +02:00
Ansariel b42f9d836b Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings 2024-06-01 15:49:26 +02:00
Ansariel 5f1a19af72 Merge remote-tracking branch 'LL/marchcat/x-ws-merge'
# Conflicts:
#	autobuild.xml
#	indra/linux_crash_logger/llcrashloggerlinux.cpp
#	indra/newview/llappviewerlinux_api.h
#	indra/newview/llappviewerlinux_api_dbus.cpp
#	indra/newview/llappviewerlinux_api_dbus.h
#	indra/newview/llavatarpropertiesprocessor.h
#	indra/newview/llcallbacklist.cpp
#	indra/newview/llimpanel.h
2024-05-01 12:30:57 +02:00
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
Ansariel c5d9c3c2a7 Merge branch 'DRTVWR-563' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	indra/cmake/Tracy.cmake
#	indra/llcommon/llprofiler.h
#	indra/llcommon/llqueuedthread.cpp
#	indra/llimage/llimageworker.cpp
#	indra/llimagej2coj/llimagej2coj.cpp
#	indra/llkdu/llimagej2ckdu.cpp
#	indra/llrender/llimagegl.cpp
#	indra/llrender/llimagegl.h
#	indra/llwindow/llwindowwin32.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/featuretable_mac.txt
#	indra/newview/llappviewer.cpp
#	indra/newview/llfloaterpreference.cpp
#	indra/newview/llmeshrepository.cpp
#	indra/newview/lltexturefetch.cpp
#	indra/newview/llviewercontrol.cpp
#	indra/newview/llviewertexture.cpp
#	indra/newview/llviewertexture.h
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/llviewertexturelist.h
#	indra/newview/llviewerwindow.cpp
#	indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
#	indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml
2022-06-03 15:07:06 +02:00
Dave Parks b6841d75c2 SL-17219 WIP - Texture pipeline overhaul 2022-04-15 19:02:07 -05:00
Ansariel 579b76dcf3 Merge viewer-neko 2019-04-15 12:40:44 +02:00
Brad Kittenbrink 6f9ea467c2 SL-10948: Fix for crash in llcorehttp/_httplibcurl.cpp.
The crash can appear on some non-windows platforms (any LP64 model platforms).
Depending on alignment this can overwrite one word of the pointer `op` declared
above.  Subsequently it will crash when later writing to memory through that
pointer
2019-04-11 17:14:15 -07:00
Ansariel 32cbc9f98b Merge viewer64 2017-11-05 12:46:02 +01:00
Nat Goodspeed 6b508cd9d4 MAINT-7081: Eliminate unused variable errors after new refactoring.
The new helper functions check_curl_easy_setopt() and
check_curl_multi_setopt() encapsulate the pervasive idiom:

    code = curl_{easy,multi}_setopt(handle, option, arg);
    check_curl_{easy,multi}_code(code, option);

But since each of these helper functions contains its own local CURL{,M}code
variable 'code', having a caller-scope variable reused for every such call is
no longer necessary -- in fact is no longer used at all. That produces a fatal
warning with MSVC. Get rid of those now-unused variables.
2017-09-30 22:05:21 -04:00
Nat Goodspeed 586d697475 MAINT-7081: Try requesting HTTP/2 when a request wants pipelining. 2017-09-29 17:06:42 -04:00
Ansariel 2797c5938a Merge Firestorm LGPL 2016-04-05 10:47:23 +02:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Ansariel 3192fe832f Merge viewer-quickgraphics 2016-03-08 01:41:31 +01:00
Nicky 04a14f5599 Fix my own typos ... 2016-03-01 01:08:53 +01:00
Nicky cb0017e821 Merge. 2016-02-29 14:23:07 +01:00
Nicky 447493f484 Merge. 2016-02-29 14:15:48 +01:00
Rider Linden bfabb7bd2b MAINT-6137: Re enable pipelining by default, use new version of CURL (7.47) with corrections for timed out connections in pipelining. Minor fix for safer op retrieval. 2016-02-19 11:19:50 -08:00
Nicky 0184c2fc83 Merge with https://bitbucket.org/rider_linden/maint-4952-v-t-u 2016-01-25 15:06:34 +01:00
Rider Linden 37286b3d39 MAINT-5915: Put in some extra null checks around completed HTTP checks to try and eliminate a crash in the wild. 2016-01-21 16:08:07 -08:00
Nicky 8b743a2522 Try to detect if some AV messes up http pipelining, if it happens, switch http pipelining off. 2016-02-13 21:58:50 +01:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Nicky c218e524b2 Merge - Step 1; Still enough to do. 2015-10-26 20:20:13 +01:00
Rider Linden 8d334ca1bf MAINT-5271: Converted internal pointers to internal operation to managed shared pointers. Removed direct cast and dereference of handles. 2015-10-16 11:40:48 -07:00
Rider Linden 1138c57f9a Convert LLCore::HttpHeaders to use shared_ptr<> rather than an intrusive_ptr<> for refrence counting. 2015-07-08 10:01:27 -07:00
Tonya Souther 6bee4b07a9 Fixing whitespace my last commit screwed up. No code change. 2015-05-21 08:09:28 -05:00
Tonya Souther 266ac37b6f Fix cURL library API usage bug: the library expects a long, not an int. 2015-05-20 23:48:01 -05:00
Monty Brandenberg 79ab7c2070 Introduce libcurl handle cache. Create a private cache
of used handles and a fast handle factory that's thread-
correct.
2014-09-19 15:34:09 -04:00
Monty Brandenberg 0c20beda68 Pipelining work. Extend transfer timeout by the pipeline depth
as transfers can appear delayed with deep pipelining and more
requests in the pool.  Added bad HTTP status error (typically
getting a 0 back as HTTP status from libcurl) to the list of
retryable errors.  There's a response stream problem with libcurl
and pipelining that induces this problem.  Retrying helps but
may not be entirely safe.  Watch bug 1420 on the libcurl sourceforge
bug tracker.  Extend options of test/example program to include
un-ranged requests.  Document the excessive data transfer induced
when ranged requests are disabled.  This is an abnormal mode for
very rare users so we'll just eat that for now.
2014-09-04 16:57:44 -04:00
Monty Brandenberg e79a88c8cc Better support for dynamic option changes in llcorehttp. Libcurl has
some problems disabling pipelining on a multi handle with outstanding
requests so build a more conservative system that allows requests
to drain before setting curl multi options.  Would rather not have
this but it is significantly safer.  "HttpPipelining" debug setting
is now fully dynamic.  Connection limits can also be made dynamic
in the near future.  Upped the default connection count back to 8 for
now but will revisit this in the tuning phase.  It might be time to
combine mesh and textures into a single asset class.  For normal
server operations that would be a clear path, but for server under
load, the current scheme may be better.  Minor cleanup in logging
to elminate some redundant strings.  Might add some more tracing to the
stall logic 'just in case'.
2014-08-12 18:21:26 -04:00
Monty Brandenberg 5cca78e718 First HTTP pipelining viewer. Enable pipelining for
GetTexture and GetMesh2 at a pipeline depth of 5.  Create
global debug option, HttpPipelining, to enable and disable
HTTP pipelining (defaults to true).  Tweak texture and
mesh low- and high-water request levels based on pipelining
status and depth.  Fixup texture console which was damaged
in a recent release.  Split logging of the no-request
HTTP error case into two cases:  one for missing URL in
HTTP request, one for HTTP request not created.  A refactor
in llcorehttp is coming:  I will be moving all libcurl-
using code into libcurl-specific modules.
2014-06-23 14:23:33 -04:00
Brad Payne (Vir Linden) 895d52a399 merge viewer-release to sunshine-external 2014-02-25 13:25:40 -05:00
Monty Brandenberg 622eae6555 SH-4490 More 'humane' error code presentation from llcorehttp callers
Added toTerseString() conversion on HttpStatus to generate a string
that's more descriptive than the hex value of the HttpStatus value
but still forms a short, searchable token (e.g. "Http_503" or
"Core_7").  Using this throughout the viewer now, no live cases
of toHex(), I believe.
2013-09-11 19:21:31 -04:00
Monty Brandenberg e764a2a565 SH-4407 Tuning to get new code working as well.
Do some runtime code avoidance and skip unnecessary libcurl and
syscall invocations.
2013-08-16 18:07:49 -04:00
Monty Brandenberg eb2869bd7f SH-4371 Reduce 22mS inter-conenction latency on HTTP operations.
Simple change dropped this value by 7-10mS or so.  Any time we
complete an operation on a transport pass, arrange to skip the
run-loop sleep so that we fill a possible empty slot as quickly
as possible.  With pipelining, this kind of thing should become
unnecessary but for now, we'll do this to increase throughput.
2013-07-29 16:09:22 -04:00
Brad Payne (Vir Linden) a04a706c1b merge 2013-05-21 16:18:48 -04:00
Monty Brandenberg 4eef1c8a2e SH-4106 Significantly upgrade the HttpHeaders interface for SSB.
Header container moves from a vector of raw lines to a vector
of string pairs representing name/value pairs in headers.  For
incoming headers, we normalize the name to lowercase and trim
it.  Values are only left-trimmed.  Outgoing headers are left
as-is.  Simple find() method for the common case, forward and
reverse iterators for those few who need to do it themselves.
The HTTP status line (e.g. 'HTTP/1.1 200 Ok') is no longer treated
as a header to be returned to caller.  Unit tests, as usual,
were a bear but they absolutely ensured outgoing HTTP header
conformance after the change.  Grunt work paid off.

LLTextureFetch was also given a second options structure
for texture fetches.  Same as the original but with header return
to caller requested.  Baked textures should use this, the other
20,000 texture fetch requests should continue to use the original.
2013-04-15 16:55:35 +00:00
Monty Brandenberg 8868964b54 SH-4106 Significantly upgrade the HttpHeaders interface for SSB.
Header container moves from a vector of raw lines to a vector
of string pairs representing name/value pairs in headers.  For
incoming headers, we normalize the name to lowercase and trim
it.  Values are only left-trimmed.  Outgoing headers are left
as-is.  Simple find() method for the common case, forward and
reverse iterators for those few who need to do it themselves.
The HTTP status line (e.g. 'HTTP/1.1 200 Ok') is no longer treated
as a header to be returned to caller.  Unit tests, as usual,
were a bear but they absolutely ensured outgoing HTTP header
conformance after the change.  Grunt work paid off.

LLTextureFetch was also given a second options structure
for texture fetches.  Same as the original but with header return
to caller requested.  Baked textures should use this, the other
20,000 texture fetch requests should continue to use the original.
2013-04-15 16:55:35 +00:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Don Kjer f945415210 Large changes to the LLCurl::Responder API, as well as pulling in some changes to common libraries from the server codebase:
* Additional error checking in http handlers.
* Uniform log spam for http errors.
* Switch to using constants for http heads and status codes.
* Fixed bugs in incorrectly checking if parsing LLSD xml resulted in an error.
* Reduced spam regarding LLSD parsing errors in the default completedRaw http handler.  It should not longer be necessary to short-circuit completedRaw to avoid spam.
* Ported over a few bug fixes from the server code.
* Switch mode http status codes to use S32 instead of U32.
* Ported LLSD::asStringRef from server code; avoids copying strings all over the place.
* Ported server change to LLSD::asBinary; this always returns a reference now instead of copying the entire binary blob.
* Ported server pretty notation format (and pretty binary format) to llsd serialization.

* The new LLCurl::Responder API no longer has two error handlers to choose from.  Overriding the following methods have been deprecated:
** error - use httpFailure
** errorWithContent - use httpFailure
** result - use httpSuccess
** completed - use httpCompleted
** completedHeader - no longer necessary; call getResponseHeaders() from a completion method to obtain these headers.

* In order to 'catch' a completed http request, override one of these methods:
** httpSuccess - Called for any 2xx status code.
** httpFailure - Called for any non-2xx status code.
** httpComplete - Called for all status codes.  Default implementation is to call either httpSuccess or httpFailure.
* It is recommended to keep these methods protected/private in order to avoid triggering of these methods without using a 'push' method (see below).

* Uniform error handling should followed whenever possible by calling a variant of this during httpFailure:
** llwarns << dumpResponse() << llendl;
* Be sure to include LOG_CLASS(your_class_name) in your class in order for the log entry to give more context.

* In order to 'push' a result into the responder, you should no longer call error, errorWithContent, result, or completed.
* Nor should you directly call httpSuccess/Failure/Completed (unless passing a message up to a parent class).
* Instead, you can set the internal content of a responder and trigger a corresponding method using the following methods:
** successResult - Sets results and calls httpSuccess
** failureResult - Sets results and calls httpFailure
** completedResult - Sets results and calls httpCompleted

* To obtain information about a the response from a reponder method, use the following getters:
** getStatus - HTTP status code
** getReason - Reason string
** getContent - Content (Parsed body LLSD)
** getResponseHeaders - Response Headers (LLSD map)
** getHTTPMethod - HTTP method of the request
** getURL - URL of the request

* It is still possible to override completeRaw if you want to manipulate data directly out of LLPumpIO.

* See indra/llmessage/llcurl.h for more information.
2013-03-13 06:26:25 +00:00
Monty Brandenberg bf004be102 SH-3308 Beef up retry messaging.
Reformatted messages around request retry.  Successfully retried requests
also message so you can see the cycle closed.  Added additional retryable
error codes (timeout, other libcurl failures).  Commenting and removed some
unnecessary std::min logic.
2012-08-01 12:38:28 -04:00
Monty Brandenberg 85e69b043b Big comment and naming cleanup. Ready for prime-time.
Add to-do list to _httpinternal.h to guide anyone who
wants to pitch in and help.
2012-07-23 23:40:07 +00:00
Monty Brandenberg d238341afa SH-3189 Remove/improve naive data structures
When releasing HTTP waiters, avoid unnecessary sort activity.
For Content-Type in responses, let libcurl do the work and removed
my parsing of headers.  Drop Content-Encoding as libcurl will deal
with that.  If anyone is interested, they can parse.
2012-07-16 11:53:04 -04:00
Monty Brandenberg 2d7b7de203 More integration work for texture fetch timeouts.
The fetch state machine received a new timeout during the WAIT_HTTP_REQ
state.  For the integration, rather than jump the state to done, we issue
a request cancel and let the notification plumbing do the rest without
any race conditions or special-case logic.
2012-07-03 13:06:46 -04:00
Monty Brandenberg e8b0088d1a SH-3184/SH-3221 More work on cleanup with better unit test work and more aggressive shutdown of a thread.
Some additional work let me enable a memory check for the clean shutdown case and
generally do a better job on other interfaces.  Request queue waiters now awake
on shutdown and don't sleep once the queue is turned off.  Much better semantically
for how this will be used.
2012-06-26 12:28:58 -04:00
Monty Brandenberg e172ec84fa SH-3184/SH-3221 Improve cleanup, destructor, thread termination, etc. logic in library.
With this commit, the cleanup paths should be production quality.  Unit tests have been
expanded to include cases requiring thread termination and cleanup by the worker thread.
Special operation/request added to support the unit tests.  Thread interface expanded
to include a very aggressive cancel() method that does not do cleanup but prevents the
thread from accessing objects that will be destroyed.
2012-06-23 23:33:50 -04:00
Monty Brandenberg bc7d5b24d1 This sets down the groundwork for dynamic policy classes.
Groundwork is used for the default class which currently represents
texture fetching.  Class options implemented from API user into
HttpLibcurl.  Policy layer is going to start doing some traffic
shaping like work to solve problems with consumer-grade gear.
Need to have dynamic aspects to policies and that starts now...
2012-06-22 19:13:50 -04:00
Monty Brandenberg a50944e078 Cleanup: move magic nubmers to new _httpinternal.h header file. 2012-06-19 17:01:02 -04:00
Monty Brandenberg b08125a587 LLMutex recursive lock, global & per-request tracing, simple GET request, LLProxy support, HttpOptions starting to work, HTTP resource waiting fixed.
Non-LLThread-based threads need to do some registration or LLMutex locks taken out in these
threads will not work as expected (SH-3154).  We'll get a better solution later, this fixes
some things for now.  Tracing of operations now supported.  Global and per-request (via
HttpOptions) tracing levels of [0..3].  The 2 and 3 levels use libcurl's VERBOSE mode
combined with CURLOPT_DEBUGFUNCTION to stream high levels of detail into the log.  *Very*
laggy but useful.  Simple GET request supported (no Range: header).  Really just a
degenrate case of a ranged get but supplied an API anyway.  Global option to use the
LLProxy interface to setup CURL handles for either socks5 or http proxy usage.  This
isn't really the most encapsulated way to do this but a better solution will have to
come later.  The wantHeaders and tracing options are now supported in HttpOptions giving
per-request controls.  Big refactoring of the HTTP resource waiter in lltexturefetch.
What I was doing before wasn't correct.  Instead, I'm implementing the resource wait
after the Semaphore model (though not using system semaphores).  So instead of having
a sequence like:  SEND_HTTP_REQ -> WAIT_HTTP_RESOURCE -> SEND_HTTP_REQ, we now
do WAIT_HTTP_RESOURCE -> WAIT_HTTP_RESOURCE2 (actual wait) -> SEND_HTTP_REQ.  Works
well but the prioritized filling of the corehttp library needs some performance
work later.
2012-06-14 16:31:48 -04:00
Monty Brandenberg 89187229dd Refactoring of the request completion thread and removal of 206/content-range hack in xport.
Retry/response handling is decided in policy so moved that there.  Removed special case
206-without-content-range response in transport.  Have this sitation recognizable in the
API and let callers deal with it as needed.
2012-06-11 15:28:06 -04:00