Commit Graph

265 Commits (e09c8681ad5f6a645ef433e86166795a5c7dd762)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 86d4724e24 Make private services forbid llHTTPRequest() calls by rejecting those that have the X-SecondLife-Shard header.
If you need to enable this, set AllowHttpRequestIn = true in [Network] for all private services or individual [*Service] sections.
2015-03-04 17:36:35 +00:00
Justin Clark-Casey (justincc) 24ef043395 Make failures in PollServiceHttpRequest.DoHTTPGruntWork() actually log the exception on error 2015-01-19 23:52:34 +00:00
Justin Clark-Casey (justincc) 86367d7219 refactor: Move methods to start a monitored thread, start work in its own thread and run work in the jobengine from Watchdog to a WorkManager class.
This is to achieve a clean separation of concerns - the watchdog is an inappropriate place for work management.
Also adds a WorkManager.RunInThreadPool() class which feeds through to Util.FireAndForget.
Also switches around the name and obj arguments to the new RunInThread() and RunJob() methods so that the callback obj comes after the callback as seen in the SDK and elsewhere
2014-11-25 23:56:32 +00:00
BlueWall 96a2449122 Undo "Revert "Small changes to threading to send thread names to unmanaged threads. Needs Mono 3.6+ to see thread names in utilities like top -H . Some formatting of the thread name to fin in the 16 byte limit on Linux. Please test on Windows to see if the work has any adverse effects.""
Fix for break in next commit

This reverts commit 376fab1402.
2014-09-17 20:03:54 -04:00
BlueWall 376fab1402 Revert "Small changes to threading to send thread names to unmanaged threads. Needs Mono 3.6+ to see thread names in utilities like top -H . Some formatting of the thread name to fin in the 16 byte limit on Linux. Please test on Windows to see if the work has any adverse effects."
This reverts commit af286d5fcb.
Issue with Jenkins builds
2014-09-17 18:11:41 -04:00
BlueWall af286d5fcb Small changes to threading to send thread names to unmanaged threads. Needs Mono 3.6+ to see thread names in utilities like top -H . Some formatting of the thread name to fin in the 16 byte limit on Linux. Please test on Windows to see if the work has any adverse effects. 2014-09-17 17:56:10 -04:00
Justin Clark-Casey (justincc) 1e3027afb1 Temporary stop CAPS service points from being added to stats as this can be a huge number.
A stop gap solution - a better one may be to improve stats display on simulator-side.
Caps information is still accessible via the "show caps stats by user" and "show caps stats by cap" commands
2014-07-26 01:41:03 +01:00
Justin Clark-Casey (justincc) 8c5c9806d7 Add stats for service endpoints using existing data.
For each service endpoint (e.g. posts to the xinventory service), a stat is available which shows the number of requests received and moving average per second
The full name is "service.<http-method>:<path>.requests (e.g. service.POST:/xinventory.requests)
2014-07-25 23:00:41 +01:00
Oren Hurvitz 99ac770abb Close streams immediately when we finish using them 2014-07-21 08:30:03 +01:00
Justin Clark-Casey (justincc) 5450b1b024 Change assembly versions to 0.8.1 2014-06-17 18:37:15 +01:00
Diva Canto 20f20895cf Adds optional HTTP Basic Authentication to Robust service connectors. 2014-05-23 16:19:43 -07:00
Oren Hurvitz 882af7195c Better error-handling and logging in case User Profile requests fail 2014-05-19 11:11:06 +01:00
Oren Hurvitz 88f7a833dc Improved HTTP logging 2014-04-29 07:59:17 +01:00
Oren Hurvitz bc06db3df4 - Created a standard function to send XML-RPC requests, which logs them like we do for other types of HTTP activity.
- Changed OpenProfileClient to use the new XML-RPC sending function
- Improved logging in WebUtil
2014-04-24 15:58:43 +01:00
Oren Hurvitz d15a3b10a3 When sending JSON-RPC calls (for UserProfile), use WebUtil instead of constructing the HTTP requests manually. This allows the calls to be logged when using "debug http all 6". 2014-04-24 15:58:41 +01:00
Oren Hurvitz 2051535ce1 String matching in REST handlers: must allow '-' as a separator, because the "/map" handler uses it 2014-04-02 15:11:54 +01:00
Oren Hurvitz aa217cf90f Better string matching when searching for REST handlers: must match an entire path component (ending with '/' or a similar character).
For example, these should match: "/assets" and "/assets/12345", but these shouldn't match: "/assets" and "/assets_exist".
2014-04-02 08:52:44 +03:00
Oren Hurvitz bbfda8e19e Fixed last-resort sending of error response (HTTP 500) when an error occurs while handling a request.
The previous code didn't actually send the response, so the caller was stuck until the timeout (100 seconds).
2014-04-02 06:32:41 +01:00
BlueWall a15282f023 Merge branch 'master' into m_test 2014-03-27 12:21:38 -04:00
Oren Hurvitz 6d1d58b654 Use the "X-Content-Encoding" header to indicate gzipped data, because old OpenSims fail if they get an unknown "Content-Encoding" 2014-03-25 18:09:23 +01:00
BlueWall 9aec36156e Sync code that has moved in development branch with changes in master 2014-03-25 11:09:27 -04:00
BlueWall dba33fee39 Move from UserProfileModule for general availability 2014-03-25 11:08:11 -04:00
Oren Hurvitz b1d8aa0b64 Use the "Content-Encoding" header to indicate gzipped streams 2014-03-25 15:36:59 +01:00
Oren Hurvitz f90aee696a Always throw an exception if MakeRequest (used for HTTP POST) fails. (Previously many exceptions were ignored)
Resolves http://opensimulator.org/mantis/view.php?id=6949
2014-03-25 09:37:10 +01:00
Oren Hurvitz f901a38204 Improved logging of HTTP requests
- MemoryBuffer isn't seekable, so we can't log it. Log the string instead.
- Handle compressed streams
- Don't attempt to dump binary data. Either don't log it at all (if we know it's binary), or at least convert non-ASCII characters to ASCII.
- Log responses to HTTP requests
- Use the same log prefix for all of these log messages ("[LOGHTTP]"), to make them easy to see at a glance
- Increased the snippet length to 200 (80 doesn't show enough), and add "..." only if the message was actually truncated

Resolves http://opensimulator.org/mantis/view.php?id=6949
2014-03-25 09:36:53 +01:00
Justin Clark-Casey (justincc) fad1d70180 Add httpserver.<port>.QueuedPollResponses and httpserver.<port>.ProcessedPollResponses statistics 2014-03-18 23:47:33 +00:00
Justin Clark-Casey (justincc) 9e0d419239 minor: Correction to description of QueuedPollResponses since this covers long poll and other 'poll' types 2014-03-18 23:24:22 +00:00
Justin Clark-Casey (justincc) eed343ed8a Add httpserver.<port-number>,QueuedPollResponses stat
This shows the number pf poll responses queued for processing.
2014-03-18 23:21:07 +00:00
Justin Clark-Casey (justincc) f3e177814a Add regression test for http inventory fetch.
Involved some restructuring to allow regression tests to dequeue inventory requests and perform poll responses synchronously rather than async
2014-03-17 20:51:35 +00:00
Justin Clark-Casey (justincc) 7cab41f422 refactor: replace verbose checks with String.IsNullOrEmpty where applicable.
Thanks to Kira for this patch from http://opensimulator.org/mantis/view.php?id=6845
2013-11-15 21:45:08 +00:00
teravus 75f63ecfcd * Add a session concurrency option per key. Allows developer/config to specify number of concurrent requests on a service. 2013-10-09 22:21:25 -05:00
teravus 1df58d04b1 * Move the BasicDOSProtector.cs to OpenSim.Framework (all useful classes belong there.....)
* Add an IsBlocked(string Key) method so it can be used more generically.   (think..   if we want to rate limit login failures, we could have a call in the Login Service to IsBlocked(uuid.ToString()) and ignore the connection if it returns true, if IsBlocked returns false, we could run the login information and if the login fails we could run the Process method to count the login failures.
2013-10-07 23:48:24 -05:00
teravus 75fdd6054d * Refactor
* Break out common BasicDOSProtector code into separate class.
2013-10-07 23:19:50 -05:00
teravus f76cc6036e * Added a Basic DOS protection container/base object for the most common HTTP Server handlers. XMLRPC Handler, GenericHttpHandler and <Various>StreamHandler
* Applied the XmlRpcBasicDOSProtector.cs to the login service as both an example, and good practice.
* Applied the BaseStreamHandlerBasicDOSProtector.cs to the friends service as an example of the DOS Protector on StreamHandlers
* Added CircularBuffer, used for CPU and Memory friendly rate monitoring.
* DosProtector has 2 states, 1. Just Check for blocked users and check general velocity, 2. Track velocity per user,     It only jumps to 2 if it's getting a lot of requests, and state 1 is about as resource friendly as if it wasn't even there.
2013-10-07 21:35:55 -05:00
teravus 85593d8d25 * Add an initial complete frame timeout to the WebSocket processor to make it easier to write WebSocket service code that is resistant to Denial of Service attacks. 2013-10-04 20:37:59 -05:00
Justin Clark-Casey (justincc) 42bdf44658 Bump OPenSimulator version and assembly versions up to 0.8.0 Dev 2013-10-04 23:33:47 +01:00
Aleric Inglewood 7889e7757a Don't use 'Indented' formatting for RpcXml responses.
(cherry picked from commit 93abcde69043b175071e0bb752538d9730433f1d)
2013-09-22 21:10:01 -05:00
Justin Clark-Casey (justincc) 77d418a36d remove mono compiler warnings from PollServiceRequestManager 2013-08-17 00:56:19 +01:00
Diva Canto 3dac92f345 Increased the rate of the PollServiceRequestManager to 0.5 secs (it was 1sec). Group chat is going over the EQ... Hopefully this won't increase CPU when there's nothing going on, but we need to watch for that. 2013-07-26 21:40:04 -07:00
Diva Canto 18d5d8f5dd Removed verbose debug from previous commit 2013-07-21 09:00:08 -07:00
Diva Canto edafea6ae6 PollServiceRequestManager: changed the long poll from a Queue to a List. No need to dequeue and enqueue items every 1sec. 2013-07-21 08:59:48 -07:00
Diva Canto 98d47ea428 Delay the enqueueing of non-longpoll requests for 100ms. No need to have these requests actively on the processing queue if it seems they're not ready. 2013-07-21 08:57:16 -07:00
Diva Canto b5062ae7ee Changed the timoeut of EQ 502s (no events) to 50 secs. The viewer post requests timeout in 60 secs.
There's plenty of room for improvement in handling the EQs. Some other time...
2013-07-18 13:30:04 -07:00
Diva Canto 552b85d33d Revert "Revert "Putting the requests back in the queue while testing for count >0 is not the smartest move...""
This reverts commit 7127891957.
2013-07-18 12:25:04 -07:00
Diva Canto 9e35b069a4 Reverting the reverts I did yesterday. cpu-branch has now been
successfully tested, and I'm merging back those changes, which proved to
be good.
Revert "Revert "Cleared up much confusion in PollServiceRequestManager. Here's the history:""

This reverts commit fa2370b32e.
2013-07-18 12:23:27 -07:00
Diva Canto fa2370b32e Revert "Cleared up much confusion in PollServiceRequestManager. Here's the history:"
This reverts commit e46459ef21.
2013-07-17 15:05:36 -07:00
Diva Canto 7127891957 Revert "Putting the requests back in the queue while testing for count >0 is not the smartest move..."
This reverts commit f4317dc26d.
2013-07-17 15:04:27 -07:00
Diva Canto 519dba9a69 Revert "Now trying DoubleQueue instead of BlockingQueue for the PollServiceRequestManager."
This reverts commit 5f95f4d78e.
2013-07-17 15:03:16 -07:00
Diva Canto 5c54eb30ed Revert "This is a completely unreasonable thing to do, effectively defying the purpose of BlockingQueues. Trying this, to see the effect on CPU."
This reverts commit 5232ab0496.
2013-07-17 15:02:54 -07:00
Diva Canto 5232ab0496 This is a completely unreasonable thing to do, effectively defying the purpose of BlockingQueues. Trying this, to see the effect on CPU. 2013-07-17 14:36:55 -07:00