Added request.Proxy=null everywhere, as discussed in 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.htmlconnector_plugin
parent
14a4b146bf
commit
531edd51d8
|
@ -46,8 +46,8 @@ namespace OpenSim.ConsoleClient
|
|||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
WebResponse response = null;
|
||||
|
||||
request.Proxy = null;
|
||||
request.Method = "POST";
|
||||
|
||||
request.ContentType = "application/x-www-form-urlencoded";
|
||||
|
||||
byte[] buffer = Encoding.ASCII.GetBytes(data);
|
||||
|
|
|
@ -306,6 +306,7 @@ namespace OpenSim.Framework.Communications
|
|||
_request.ContentType = "application/xml";
|
||||
_request.Timeout = 200000;
|
||||
_request.Method = RequestMethod;
|
||||
_request.Proxy = null;
|
||||
_asyncException = null;
|
||||
|
||||
// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
|
||||
|
@ -365,6 +366,7 @@ namespace OpenSim.Framework.Communications
|
|||
_request.ContentType = "application/xml";
|
||||
_request.Timeout = 900000;
|
||||
_request.Method = RequestMethod;
|
||||
_request.Proxy = null;
|
||||
_asyncException = null;
|
||||
_request.ContentLength = src.Length;
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ namespace OpenSim.Framework.Configuration.HTTP
|
|||
byte[] buf = new byte[8192];
|
||||
HttpWebRequest request =
|
||||
(HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName);
|
||||
request.Proxy = null;
|
||||
HttpWebResponse response = (HttpWebResponse) request.GetResponse();
|
||||
|
||||
Stream resStream = response.GetResponseStream();
|
||||
|
|
|
@ -70,6 +70,7 @@ namespace OpenSim.Framework.RegionLoader.Web
|
|||
int regionCount = 0;
|
||||
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
|
||||
webRequest.Timeout = 30000; //30 Second Timeout
|
||||
webRequest.Proxy = null;
|
||||
m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
|
||||
|
||||
try
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
request.Proxy = null;
|
||||
request.ContentType = "text/xml";
|
||||
|
||||
MemoryStream buffer = new MemoryStream();
|
||||
|
|
|
@ -57,6 +57,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
request.Proxy = null;
|
||||
request.ContentType = "text/xml";
|
||||
request.Timeout = 10000;
|
||||
|
||||
|
|
|
@ -74,6 +74,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
request.Proxy = null;
|
||||
request.ContentType = "text/xml";
|
||||
request.Timeout = 20000;
|
||||
|
||||
|
@ -139,6 +140,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
request.Proxy = null;
|
||||
request.ContentType = "text/xml";
|
||||
request.Timeout = 10000;
|
||||
|
||||
|
|
|
@ -88,6 +88,7 @@ namespace OpenSim.Framework
|
|||
httpWebRequest.ReadWriteTimeout = readWriteTimeoutMS;
|
||||
httpWebRequest.Timeout = timeoutMS;
|
||||
httpWebRequest.KeepAlive = false;
|
||||
httpWebRequest.Proxy = null;
|
||||
|
||||
return httpWebRequest;
|
||||
}
|
||||
|
|
|
@ -171,6 +171,7 @@ namespace OpenSim.Framework
|
|||
request.Method = method;
|
||||
request.Timeout = timeout;
|
||||
request.KeepAlive = false;
|
||||
request.Proxy = null;
|
||||
request.MaximumAutomaticRedirections = 10;
|
||||
request.ReadWriteTimeout = timeout / 4;
|
||||
request.Headers[OSHeaderRequestID] = reqnum.ToString();
|
||||
|
@ -350,6 +351,7 @@ namespace OpenSim.Framework
|
|||
request.Method = "POST";
|
||||
request.Timeout = timeout;
|
||||
request.KeepAlive = false;
|
||||
request.Proxy = null;
|
||||
request.MaximumAutomaticRedirections = 10;
|
||||
request.ReadWriteTimeout = timeout / 4;
|
||||
request.Headers[OSHeaderRequestID] = reqnum.ToString();
|
||||
|
@ -730,6 +732,7 @@ namespace OpenSim.Framework
|
|||
Type type = typeof(TRequest);
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Proxy = null;
|
||||
WebResponse response = null;
|
||||
TResponse deserial = default(TResponse);
|
||||
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
||||
|
@ -924,6 +927,7 @@ namespace OpenSim.Framework
|
|||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
request.Proxy = null;
|
||||
string respstring = String.Empty;
|
||||
|
||||
using (MemoryStream buffer = new MemoryStream())
|
||||
|
@ -1051,6 +1055,7 @@ namespace OpenSim.Framework
|
|||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
request.Proxy = null;
|
||||
MemoryStream buffer = null;
|
||||
|
||||
if ((verb == "POST") || (verb == "PUT"))
|
||||
|
|
|
@ -384,6 +384,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
|||
Request = (HttpWebRequest) WebRequest.Create(Url);
|
||||
Request.Method = HttpMethod;
|
||||
Request.ContentType = HttpMIMEType;
|
||||
Request.Proxy = null;
|
||||
|
||||
if(!HttpVerifyCert)
|
||||
{
|
||||
|
|
|
@ -148,19 +148,21 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL
|
|||
private void MakeHttpRequest(string url, UUID requestID)
|
||||
{
|
||||
WebRequest request = HttpWebRequest.Create(url);
|
||||
|
||||
if (m_proxyurl != null && m_proxyurl.Length > 0)
|
||||
|
||||
if (m_proxyurl != null && m_proxyurl.Length > 0)
|
||||
{
|
||||
if (m_proxyexcepts != null && m_proxyexcepts.Length > 0)
|
||||
if (m_proxyexcepts != null && m_proxyexcepts.Length > 0)
|
||||
{
|
||||
string[] elist = m_proxyexcepts.Split(';');
|
||||
request.Proxy = new WebProxy(m_proxyurl, true, elist);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
request.Proxy = new WebProxy(m_proxyurl, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
request.Proxy = null;
|
||||
|
||||
RequestState state = new RequestState((HttpWebRequest) request, requestID);
|
||||
// IAsyncResult result = request.BeginGetResponse(new AsyncCallback(HttpRequestReturn), state);
|
||||
|
|
|
@ -826,6 +826,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
|||
try
|
||||
{
|
||||
WebRequest request = HttpWebRequest.Create(url);
|
||||
request.Proxy = null;
|
||||
//Ckrinke: Comment out for now as 'str' is unused. Bring it back into play later when it is used.
|
||||
//Ckrinke Stream str = null;
|
||||
HttpWebResponse response = (HttpWebResponse)(request).GetResponse();
|
||||
|
|
|
@ -110,6 +110,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
|||
|
||||
request.ContentLength = 0;
|
||||
request.KeepAlive = false;
|
||||
request.Proxy = null;
|
||||
|
||||
WebResponse response = request.GetResponse();
|
||||
Stream file = response.GetResponseStream();
|
||||
|
|
|
@ -352,6 +352,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
|||
|
||||
request.ContentLength = 0;
|
||||
request.KeepAlive = false;
|
||||
request.Proxy = null;
|
||||
|
||||
WebResponse response = request.GetResponse();
|
||||
Stream file = response.GetResponseStream();
|
||||
|
|
|
@ -819,6 +819,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
|
||||
mapitemsrequest.Method = "POST";
|
||||
mapitemsrequest.ContentType = "application/xml+llsd";
|
||||
mapitemsrequest.Proxy = null;
|
||||
OSDMap RAMap = new OSDMap();
|
||||
|
||||
// string RAMapString = RAMap.ToString();
|
||||
|
|
|
@ -386,7 +386,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
|
|||
updatePost.ContentType = "text/xml";
|
||||
updatePost.ContentLength = payload.Length;
|
||||
updatePost.UserAgent = "OpenSim.Concierge";
|
||||
|
||||
updatePost.Proxy = null;
|
||||
|
||||
BrokerState bs = new BrokerState(uri, payload, updatePost);
|
||||
bs.Timer = new Timer(delegate(object state)
|
||||
|
|
|
@ -541,6 +541,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
|||
forwardreq.Method = method;
|
||||
forwardreq.ContentType = contenttype;
|
||||
forwardreq.KeepAlive = false;
|
||||
forwardreq.Proxy = null;
|
||||
|
||||
if (method == "POST")
|
||||
{
|
||||
|
|
|
@ -1119,6 +1119,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
|
|||
|
||||
// We are sending just parameters, no content
|
||||
req.ContentLength = 0;
|
||||
req.Proxy = null;
|
||||
|
||||
// Send request and retrieve the response
|
||||
rsp = (HttpWebResponse)req.GetResponse();
|
||||
|
|
|
@ -1150,6 +1150,7 @@ namespace Nwc.XmlRpc
|
|||
request.ContentType = "text/xml";
|
||||
request.AllowWriteStreamBuffering = true;
|
||||
request.KeepAlive = !_disableKeepAlive;
|
||||
request.Proxy = null;
|
||||
|
||||
Stream stream = request.GetRequestStream();
|
||||
XmlTextWriter xml = new XmlTextWriter(stream, Encoding.ASCII);
|
||||
|
|
|
@ -280,6 +280,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
|
|||
WebRequest request = WebRequest.Create(m_uri);
|
||||
request.Method = request_method;
|
||||
request.ContentType = content_type;
|
||||
request.Proxy = null;
|
||||
|
||||
Stream os = null;
|
||||
try
|
||||
|
|
|
@ -77,6 +77,7 @@ namespace OpenSim.Services.Connectors
|
|||
public virtual string Helo()
|
||||
{
|
||||
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI);
|
||||
req.Proxy = null;
|
||||
// Eventually we need to switch to HEAD
|
||||
/* req.Method = "HEAD"; */
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
|||
AgentCreateRequest.Method = "POST";
|
||||
AgentCreateRequest.ContentType = "application/json";
|
||||
AgentCreateRequest.Timeout = 10000;
|
||||
AgentCreateRequest.Proxy = null;
|
||||
//AgentCreateRequest.KeepAlive = false;
|
||||
//AgentCreateRequest.Headers.Add("Authorization", authKey);
|
||||
|
||||
|
|
|
@ -107,6 +107,7 @@ namespace OpenSim.Services.Connectors
|
|||
helloNeighbourRequest.Method = "POST";
|
||||
helloNeighbourRequest.ContentType = "application/json";
|
||||
helloNeighbourRequest.Timeout = 10000;
|
||||
helloNeighbourRequest.Proxy = null;
|
||||
|
||||
// Fill it in
|
||||
OSDMap args = null;
|
||||
|
|
|
@ -184,6 +184,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
{
|
||||
HttpWebRequest request = UntrustedHttpWebRequest.Create(url);
|
||||
request.Method = "HEAD";
|
||||
request.Proxy = null;
|
||||
|
||||
using (WebResponse response = request.GetResponse())
|
||||
{
|
||||
|
@ -339,7 +340,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
// Simian does not require the asset ID to be in the URL because it's in the post data.
|
||||
// By appending it to the URL also, we allow caching proxies (squid) to invalidate asset URLs
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_serverUrl + asset.FullID.ToString());
|
||||
|
||||
request.Proxy = null;
|
||||
|
||||
HttpWebResponse response = MultipartForm.Post(request, postParameters);
|
||||
using (Stream responseStream = response.GetResponseStream())
|
||||
{
|
||||
|
@ -427,6 +429,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
{
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
|
||||
request.Method = "DELETE";
|
||||
request.Proxy = null;
|
||||
|
||||
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||
{
|
||||
|
@ -460,6 +463,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
|||
try
|
||||
{
|
||||
HttpWebRequest request = UntrustedHttpWebRequest.Create(url);
|
||||
request.Proxy = null;
|
||||
|
||||
using (WebResponse response = request.GetResponse())
|
||||
{
|
||||
|
|
|
@ -212,6 +212,7 @@ namespace OpenSim.Region.OptionalModules.Simian
|
|||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(m_serverUrl);
|
||||
request.Timeout = 20000;
|
||||
request.ReadWriteTimeout = 5000;
|
||||
request.Proxy = null;
|
||||
|
||||
using (HttpWebResponse response = MultipartForm.Post(request, postParameters))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue