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