Revert "Added request.Proxy=null everywhere, as discussed in http://stackoverflow.com/questions/2519655/httpwebrequest-is-extremely-slow."

But the patch is here, in case anyone wants to try it.

This reverts commit 531edd51d8.
connector_plugin
Diva Canto 2012-09-30 07:48:03 -07:00
parent 531edd51d8
commit 91a5c602e3
25 changed files with 8 additions and 41 deletions

View File

@ -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);

View File

@ -306,7 +306,6 @@ 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);
@ -366,7 +365,6 @@ namespace OpenSim.Framework.Communications
_request.ContentType = "application/xml";
_request.Timeout = 900000;
_request.Method = RequestMethod;
_request.Proxy = null;
_asyncException = null;
_request.ContentLength = src.Length;

View File

@ -65,7 +65,6 @@ 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();

View File

@ -70,7 +70,6 @@ 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

View File

@ -50,7 +50,6 @@ namespace OpenSim.Framework.Servers.HttpServer
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Proxy = null;
request.ContentType = "text/xml";
MemoryStream buffer = new MemoryStream();

View File

@ -57,7 +57,6 @@ namespace OpenSim.Framework.Servers.HttpServer
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Proxy = null;
request.ContentType = "text/xml";
request.Timeout = 10000;

View File

@ -74,7 +74,6 @@ namespace OpenSim.Framework.Servers.HttpServer
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Proxy = null;
request.ContentType = "text/xml";
request.Timeout = 20000;
@ -140,7 +139,6 @@ namespace OpenSim.Framework.Servers.HttpServer
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Proxy = null;
request.ContentType = "text/xml";
request.Timeout = 10000;

View File

@ -88,7 +88,6 @@ namespace OpenSim.Framework
httpWebRequest.ReadWriteTimeout = readWriteTimeoutMS;
httpWebRequest.Timeout = timeoutMS;
httpWebRequest.KeepAlive = false;
httpWebRequest.Proxy = null;
return httpWebRequest;
}

View File

@ -171,7 +171,6 @@ 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();
@ -351,7 +350,6 @@ 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();
@ -732,7 +730,6 @@ 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));
@ -927,7 +924,6 @@ namespace OpenSim.Framework
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Proxy = null;
string respstring = String.Empty;
using (MemoryStream buffer = new MemoryStream())
@ -1055,7 +1051,6 @@ namespace OpenSim.Framework
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Proxy = null;
MemoryStream buffer = null;
if ((verb == "POST") || (verb == "PUT"))

View File

@ -384,7 +384,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
Request = (HttpWebRequest) WebRequest.Create(Url);
Request.Method = HttpMethod;
Request.ContentType = HttpMIMEType;
Request.Proxy = null;
if(!HttpVerifyCert)
{

View File

@ -148,21 +148,19 @@ 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);

View File

@ -826,7 +826,6 @@ 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();

View File

@ -110,7 +110,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
request.ContentLength = 0;
request.KeepAlive = false;
request.Proxy = null;
WebResponse response = request.GetResponse();
Stream file = response.GetResponseStream();

View File

@ -352,7 +352,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain
request.ContentLength = 0;
request.KeepAlive = false;
request.Proxy = null;
WebResponse response = request.GetResponse();
Stream file = response.GetResponseStream();

View File

@ -819,7 +819,6 @@ 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();

View File

@ -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)

View File

@ -541,7 +541,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
forwardreq.Method = method;
forwardreq.ContentType = contenttype;
forwardreq.KeepAlive = false;
forwardreq.Proxy = null;
if (method == "POST")
{

View File

@ -1119,7 +1119,6 @@ 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();

View File

@ -1150,7 +1150,6 @@ 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);

View File

@ -280,7 +280,6 @@ 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

View File

@ -77,7 +77,6 @@ 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"; */

View File

@ -125,7 +125,6 @@ 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);

View File

@ -107,7 +107,6 @@ namespace OpenSim.Services.Connectors
helloNeighbourRequest.Method = "POST";
helloNeighbourRequest.ContentType = "application/json";
helloNeighbourRequest.Timeout = 10000;
helloNeighbourRequest.Proxy = null;
// Fill it in
OSDMap args = null;

View File

@ -184,7 +184,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
{
HttpWebRequest request = UntrustedHttpWebRequest.Create(url);
request.Method = "HEAD";
request.Proxy = null;
using (WebResponse response = request.GetResponse())
{
@ -340,8 +339,7 @@ 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())
{
@ -429,7 +427,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "DELETE";
request.Proxy = null;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
@ -463,7 +460,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
try
{
HttpWebRequest request = UntrustedHttpWebRequest.Create(url);
request.Proxy = null;
using (WebResponse response = request.GetResponse())
{

View File

@ -212,7 +212,6 @@ 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))
{