aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/WebUtil.cs (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Log RestClient requests similarly to WebClient (e.g, "debug http all 6" logs ↵Oren Hurvitz2014-08-021-1/+1
| | | | the entire request and response)
* Close streams immediately when we finish using themOren Hurvitz2014-08-021-3/+4
|
* Adds optional HTTP Basic Authentication to Robust service connectors.Diva Canto2014-05-231-4/+71
|
* Fix behaviour change in recent commit bbc1dc6 so that ↵Justin Clark-Casey (justincc)2014-05-131-5/+10
| | | | | | | | SynchronousRestObjectRequester.MakeRequest() calls with no timeout specified use the default HttpWebRequest timeout as previously. I mistakenly thought that that default request timeout was inifite rather than 100 seconds, restoring previously behaviour. As per http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.timeout%28v=vs.100%29.aspx Relates to http://opensimulator.org/mantis/view.php?id=7165
* Replace existing 0 timeout in internal overloaded ↵Justin Clark-Casey (justincc)2014-05-121-3/+4
| | | | | | SynchronousRestObjectRequester.MakeRequest() methods with proper Timeout.Infinite (-1) instead. Triggered by recent faf9ba53 though this was wrong in the code before, it's just that we didn't actually try to set the timeout given.
* minor: Add method doc to SynchronousRestObjectRequester.MakeRequest() methodsJustin Clark-Casey (justincc)2014-05-121-5/+27
|
* In SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(string ↵Justin Clark-Casey (justincc)2014-05-121-0/+2
| | | | | | | verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections) actually set timeout on WebRequest if given. Previously, we were doing nothing with this parameter. No effect on current code since none of the 6 callers attempt to use the timeout.
* Improved HTTP loggingOren Hurvitz2014-04-291-3/+2
|
* - Created a standard function to send XML-RPC requests, which logs them like ↵Oren Hurvitz2014-04-241-74/+138
| | | | | | | we do for other types of HTTP activity. - Changed OpenProfileClient to use the new XML-RPC sending function - Improved logging in WebUtil
* When sending JSON-RPC calls (for UserProfile), use WebUtil instead of ↵Oren Hurvitz2014-04-241-12/+12
| | | | constructing the HTTP requests manually. This allows the calls to be logged when using "debug http all 6".
* Fixed last-resort sending of error response (HTTP 500) when an error occurs ↵Oren Hurvitz2014-04-021-6/+6
| | | | | | while handling a request. The previous code didn't actually send the response, so the caller was stuck until the timeout (100 seconds).
* Fixed a case where logging an HTTP response failed because the stream was ↵Oren Hurvitz2014-03-271-23/+28
| | | | non-seekable
* Log errors in MakeRequest() as INFO, not ERROR. Some communications problems ↵Oren Hurvitz2014-03-271-2/+2
| | | | | | are benign (e.g., can't send Friend status update to a region that is down), so don't log them as ERROR so soon. We rethrow the exception, so the caller can still decide to log the error as an ERROR. Resolves http://opensimulator.org/mantis/view.php?id=7077
* Use the "X-Content-Encoding" header to indicate gzipped data, because old ↵Oren Hurvitz2014-03-251-1/+1
| | | | OpenSims fail if they get an unknown "Content-Encoding"
* Use the "Content-Encoding" header to indicate gzipped streamsOren Hurvitz2014-03-251-3/+5
|
* Always throw an exception if MakeRequest (used for HTTP POST) fails. ↵Oren Hurvitz2014-03-251-19/+10
| | | | | | (Previously many exceptions were ignored) Resolves http://opensimulator.org/mantis/view.php?id=6949
* Improved logging of HTTP requestsOren Hurvitz2014-03-251-35/+87
| | | | | | | | | | | - 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
* Set up a StreamReader and call ReadToEnd() instead of using the ↵Justin Clark-Casey (justincc)2014-02-271-41/+13
| | | | | | GetStreamString() extension method This eliminates some stream seeking that was never necessary and makes disposable of the StreamReader consistent with other code
* refactor: More consistently use using construct within WebUtil to match ↵Justin Clark-Casey (justincc)2014-02-271-225/+218
| | | | other existing code there.
* Add more details to InvalidOperationException logging in ↵Justin Clark-Casey (justincc)2014-02-271-3/+4
| | | | SychronousRestFormsRequest.MakeRequest().
* Make sure Web streams are disposed after useOren Hurvitz2014-01-311-3/+3
|
* refactor: replace verbose checks with String.IsNullOrEmpty where applicable.Justin Clark-Casey (justincc)2013-11-151-1/+1
| | | | Thanks to Kira for this patch from http://opensimulator.org/mantis/view.php?id=6845
* Make it possible to switch whether we serialize osd requests per endpoint or ↵Justin Clark-Casey (justincc)2013-08-051-4/+16
| | | | | | not, either via config (SerializeOSDRequests in [Network]) or via the "debug comms set" console command. For debug purposes to assess what impact this has on network response in a heavy test environment.
* Issue: 10 simultaneous TPs, many not making it. Now bypassing the per-url ↵Diva Canto2013-08-021-3/+3
| | | | lock -- we should be "ok" (or, more "ok") now that we have increased the connection limit on the http library. But this is a sensitive part of the code, so it may need reverting.
* Revert "WARNING: BRUTE FORCE DEBUG. AVOID USING THIS COMMIT."Diva Canto2013-07-041-4/+0
| | | | This reverts commit c95a23863ab51810ccc01afd3dd641c18a183305.
* WARNING: BRUTE FORCE DEBUG. AVOID USING THIS COMMIT.Diva Canto2013-07-041-0/+4
|
* Changed HG status notifications timeout down to 15secs from the default 100.Diva Canto2013-06-291-1/+9
|
* Implement logging of first 80 characters (debug level 5) or full body data ↵Justin Clark-Casey (justincc)2013-06-121-2/+52
| | | | | | | (debug level 6) on outgoing requests, depending on debug level This is set via "debug http out <level>" This matches the existing debug level behaviours for logging incoming http data
* Make sure we dispose of WebResponse, StreamReader and Stream in various ↵Justin Clark-Casey (justincc)2013-02-271-30/+31
| | | | places where we were not already.
* Allow setting connection limits, part 2Melanie2012-09-301-1/+26
|
* Revert "Added request.Proxy=null everywhere, as discussed in ↵Diva Canto2012-09-301-5/+0
| | | | | | | | http://stackoverflow.com/questions/2519655/httpwebrequest-is-extremely-slow." But the patch is here, in case anyone wants to try it. This reverts commit 531edd51d82ecd6a842a2611c99e9919634491ef.
* Added request.Proxy=null everywhere, as discussed in ↵Diva Canto2012-09-301-0/+5
| | | | | | http://stackoverflow.com/questions/2519655/httpwebrequest-is-extremely-slow. Thanks R.Gunther (rigun@rigutech.nl) https://lists.berlios.de/pipermail/opensim-users/2012-September/010986.html
* minor: Make slow outgoing request log messages consistent with other log ↵Justin Clark-Casey (justincc)2012-09-211-7/+7
| | | | messages
* Add request number counting to incoming HTTP requests in the same way that ↵Justin Clark-Casey (justincc)2012-09-211-1/+1
| | | | | | | | | this was already being done for outgoing HTTP requests. This allows us to associate debug logging messages with the right request. It also allows us to put a request number on 'long request' logging even if other debug logging is not enabled, which gives us some idea of whether every request is suffering this problem or only some. This is a separate internal number not associated with any incoming number in the opensim-request-id header, this will be clarified when logging of this incoming request number is re-enabled. This commit also adds port number to HTTP IN logging to allow us to distinguish between different request numbers on different ports.
* Insert a new log level 4 for HTTP IN and HTTP OUT that will log how long the ↵Justin Clark-Casey (justincc)2012-09-201-0/+24
| | | | | | | request took. This is only printed if debug http level >= 4 and the request didn't take more than the time considered 'long', in which case the existing log message is printed. This displaces the previous log levels 4 and 5 which are now 5 and 6 respectively.
* Add ability to turn on/off logging of outgoing HTTP requests flowing through ↵Justin Clark-Casey (justincc)2012-09-201-8/+33
| | | | | | | | | WebUtil. This is for debugging purposes. This is controlled via the "debug http" command which can already log incoming requests. This now gains a mandatory parameter of in, out or all to control what is logged. Log messages are also shortened and labelled and HTTP IN or HTTP OUT to be consistent with existing UDP PACKET IN and PACKET OUT messages.
* Change LongCallTime on WebUtil to 3000, to match the time where request ↵Justin Clark-Casey (justincc)2012-05-041-1/+1
| | | | | | | handling is considered "slow". This may be the wrong thing to do but stops lots of log spam in HG setups now that the monitoring is extended to other outgoing calls. LongCallTime may need to be made configurable.
* Extend 'slow' request logging to other server outbound requests (forms, ↵Justin Clark-Casey (justincc)2012-05-041-79/+194
| | | | | | rest, async rest) as well as the existing logging on outbound OSD requests. Also prints out the first 100 chars of any slow request data since this can contain useful info (such as agent ID).
* Add request verb and url to error messages in WebUtil that lack this.Justin Clark-Casey (justincc)2012-04-261-17/+38
| | | | Make exception printing consistent across windows and mono.
* Rename the stream extension method WebUtil.CopyTo() to WebUtil.CopyStream().Robert Adams2012-03-121-1/+6
| | | | | | | | | | .NET 4.0 added the method Stream.CopyTo(stream, bufferSize). For .NET 3.5 and before, WebUtil defined an extension method for Stream with the signature Stream.CopyTo(stream, maxBytesToCopy). The meaning of the second parameter is different in the two forms and depending on which compiler and/or runtime you use, you could get one form or the other. Crashes ensue. This change renames the WebUtil stream copy method to something that cannot be confused with the new CopyTo method defined in .NET 4.0.
* Serialize all web requests to a particular host:port pair; only applied to ↵Mic Bowman2012-03-091-0/+41
| | | | the PostToService variants.
* Some clean up in WebUtil, remove unused ServiceRequest function.Mic Bowman2012-02-271-71/+7
|
* remove some mono compiler warningsJustin Clark-Casey (justincc)2011-11-251-1/+1
|
* Get rid of the spurious [WEB UTIL] couldn't decode <OpenSim agent ↵Justin Clark-Casey (justincc)2011-11-191-1/+1
| | | | | | | 57956c4b-ff2e-4fc1-9995-613c6256cc98>: Invalid character 'O' in input string messages These are just the result of an attempt to canonicalize received messages - it's not important that we constantly log them. Also finally get the deregister grid service message working properly
* Make OpenSim.Framework.Servers.HttpServer rely on OpenSim.Framework instead ↵Justin Clark-Casey (justincc)2011-10-251-31/+29
| | | | | | | | | of the other way around. This is necessary so that code in HttpServer can use framework facilities such as the thread watchdog for monitoring purposes. Doing this shuffle meant that MainServer was moved into OpenSim/Framework/Servers Also had to make OpenSim.Framework.Console rely on OpenSim.Framework rather than the other way around since it in turn relies on HttpServer MainConsole and some new interfaces had to be moved into OpenSim/Framework to allow this. This can be reverted if parts of OpenSim.Framework stop relying on console presence (cheifly RegionInfo)
* minor: remove whitespaceJustin Clark-Casey (justincc)2011-07-131-1/+0
|
* Remove an unused 404 checker since on a 404, GetResponse() throws a ↵Justin Clark-Casey (justincc)2011-07-131-3/+0
| | | | WebException rather than proceeding.
* if a SynchronousRestObjectRequester request fails, then unless it's due to a ↵Justin Clark-Casey (justincc)2011-07-131-0/+11
| | | | | | | 404, log the exception for diagnostic purposes This is instead of logging "Invalid XML" for all failures, even if they weren't a result of invalid xml. A default TReponse is returned in the event of a 404, which is the same behaviour as previously.
* Remove the obsoleted SynchronousRestObjectPosterJustin Clark-Casey (justincc)2011-07-131-9/+0
|
* Changed yet more Warns to Debugs.Diva Canto2011-05-141-4/+4
|