Commit Graph

26 Commits

Author SHA1 Message Date
Aleric Inglewood
74dff061ff Support for new LL Responder API.
This adds mStatus, mReason and mContent to ResponderBase
and fills those in instead of passing it to member functions.
The added danger here is that now code can accidently try
to access these variables while they didn't already get a
correct value.

Affected members of ResponderBase (that now have less arguments):
decode_llsd_body, decode_raw_body, completedHeaders,
completed -> httpCompleted, result -> httpSuccess,
errorWithContent and error -> httpFailure.

New API:

ResponderBase::setResult
ResponderBase::getStatus()
ResponderBase::getReason()
ResponderBase::getContent()
ResponderBase::getResponseHeaders() (returns AIHTTPReceivedHeaders though, not LLSD)
ResponderBase::dumpResponse()
ResponderWithCompleted::completeResult
ResponderWithResult::failureResult (previously pubErrorWithContent)
ResponderWithResult::successResult (previously pubResult)

Not implemented:

getHTTPMethod() - use getName() instead which returns the class name of the responder.

completedHeaders() is still called as usual, although you can ignore
it (not implement in a derived responder) and call getResponseHeaders()
instead, provided you implement needsHeaders() and have it return true.

However, classes derived from ResponderHeadersOnly do not have
completedHeaders(), so they still must implement completedHeaders(),
and then call getResponseHeaders() or just access mReceivedHeaders
directly, as usual.
2014-07-12 18:29:44 +02:00
Aleric Inglewood
45e6b7975f First version of HTTP bandwidth throttling.
Adds throttling based on on average bandwidth usage per HTTP service.
Since only HTTP textures are using this, they are still starved by other
services like inventory and mesh dowloads. Also, it will be needed to
move the maximum number of connections per service the to the PerService
class, and dynamically tune them: reducing the number of connections is
the first thing to do when using too much bandwidth.

I also added a graph for HTTP texture bandwidth to the stats floater.
For some reason the average bandwidth (over 1 second) look almost like
scattered noise... weird for something that is averaged...
2013-04-24 22:04:21 +02:00
Drake Arconis
b800320a49 Remove LLMemType and related files 2013-03-04 12:02:01 -05:00
Aleric Inglewood
f9738cb611 Add getName() to every non-base class Responder object. 2013-01-11 04:15:55 +01:00
Siana Gearz
abb562d1ab For extra safety 2012-11-05 03:22:57 +01:00
Siana Gearz
1dcfa9e0ee Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer
Conflicts:
	indra/llmessage/llregionpresenceverifier.cpp
	indra/llmessage/llregionpresenceverifier.h
2012-11-04 02:10:31 +01:00
Siana Gearz
7f0664ff82 Bringing back message logger 2012-11-03 14:13:13 +01:00
Aleric Inglewood
c0ac428179 Code cleanup
* Moved Responder stuff to LLHTTPClient.
* Renamed LLHTTPClient::Responder to LLHTTPClient::ResponderWithResult.
* Deleted LLHTTPClientAdapter and LLHTTPClientInterface.
* Renamed AICurlInterface::TransferInfo to AITransferInfo and moved it
  to llhttpclient.h
* Removed 'CURLcode code' argument from completed_headers.
2012-10-31 23:11:42 +01:00
Aleric Inglewood
3f1fb9a66e Add improved timeout handling for HTTP transactions.
Introduces AIHTTPTimeoutPolicy objects which do not just
specify a single "timeout" in seconds, but a plethora of
timings related to the life cycle of the average HTTP
transaction.

This knowledge is that moved to the Responder being
used instead of floating constants hardcoded in the
callers of http requests. This assumes that the same
timeout policy is wanted for each transaction that
uses the same Responder, which can be enforced is needed.

I added a AIHTTPTimeoutPolicy for EVERY responder,
only to make it easier later to tune timeout values
and/or to get feedback about which responder runs
into HTTP errors in debug output (especially time outs),
so that they can be tuned later. If we already understood
exactly what we were doing then most responders could
have been left alone and just return the default timeout
policy: by far most timeout policies are just a copy
of the default policy, currently.

This commit is not finished... It's a work in progress
(viewer runs fine with it though).
2012-10-05 15:53:29 +02:00
Aleric Inglewood
fbb5dced97 Merge remote-tracking branch 'singu/master' into curlthreading2
Conflicts:
	indra/llcommon/CMakeLists.txt
	indra/llmessage/llcurl.cpp
	indra/llmessage/llcurl.h
	indra/llmessage/llhttpclient.cpp
	indra/llmessage/llhttpclient.h
	indra/llmessage/llpumpio.cpp
	indra/llmessage/llpumpio.h
	indra/llmessage/llurlrequest.cpp
	indra/llmessage/llurlrequest.h
	indra/newview/hipporestrequest.cpp
	indra/newview/llappviewer.cpp
	indra/newview/llspatialpartition.cpp
	indra/newview/llviewermedia.cpp
	indra/newview/llxmlrpctransaction.cpp

Conflicts resolved by choosing curlthreading2
for any llmessage file regardless (which looks
correct upon investigation); the rest also
turned out to need to use curlthreading2, except
in one line where I added a semi-colon after
an assert(), and the assert was changed in
singu/master.
2012-08-13 17:07:25 +02:00
Shyotl
eef51e0bd0 Pulled llpacketring.h and llhttpclient.h out of the precompiled header. 2012-08-09 22:50:05 -05:00
Siana Gearz
15086833a3 Random stab in the dark coming right up! 2012-07-22 11:26:36 +02:00
Siana Gearz
8b6f462d13 Wholesale update of llmessage to V3.2
Note that this removes message logger for now.
2012-03-06 07:31:15 +01:00
Shyotl
9453c2c2e9 Memory tracking system updated. 2012-01-29 01:33:14 -06:00
Shyotl
6c921ba340 Routine V3 merge. 2012-01-29 01:25:39 -06:00
Shyotl
244e30297f AIAPRPool, AIAPRRootPool, AIVolatileAPRPool, AIThreadLocalData etc, were rebranded by LL. Merging change to clean up diffs. 2011-09-20 22:08:48 -05:00
Shyotl
c029f00e12 CURL easy handles are now cached for reacquisition. Should lessen hitching by about half on systems exhibiting such. 2011-05-20 19:03:43 -05:00
Aleric Inglewood
4d932d5e2d Added a thread-safe and robust wrapper for APR pools.
See http://redmine.imprudenceviewer.org/issues/590
and https://jira.secondlife.com/browse/SNOW-596
2011-05-05 02:52:55 +02:00
Shyotl
f9937d7f8a V2 llmessage merge, incl. llcommon requisites.
Excluded llareslistener, as that appears to only be present for unit-testing
Excluded new SSL methods because, well, they don't work right reliably in v2 for me
2011-02-25 19:30:59 -06:00
Beeks
5ce4286fd7 f 2010-08-22 15:14:30 -04:00
phr0z3nt04st
c6a4f2570f Shift Right click now works on profile pictures, fixed minor message system bug where packets going in would be considered spoofed packets 2010-07-06 12:24:00 -05:00
phr0z3nt04st
b13bbd7b40 Added ip spoofing protectection. 2010-06-22 15:31:11 -05:00
Hazim Gazov
c44805ae20 preliminary inbound message spoofing support completed 2010-06-13 09:36:32 +00:00
phr0z3nt04st
9acbbfdd44 I think i finnally fixed message loggine.... 2010-06-08 20:09:40 -05:00
Hazim Gazov
25fe391f07 added message logger / builder floaters 2010-05-05 17:08:05 -03:00
Hazim Gazov
7a86d01598 Imported existing code 2010-04-02 02:48:44 -03:00