aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorDiva Canto2012-09-30 07:22:55 -0700
committerDiva Canto2012-09-30 07:22:55 -0700
commit531edd51d82ecd6a842a2611c99e9919634491ef (patch)
tree0e28069aa1b2278f91b9275f98db7990abb7d964 /OpenSim/Framework
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-531edd51d82ecd6a842a2611c99e9919634491ef.zip
opensim-SC-531edd51d82ecd6a842a2611c99e9919634491ef.tar.gz
opensim-SC-531edd51d82ecd6a842a2611c99e9919634491ef.tar.bz2
opensim-SC-531edd51d82ecd6a842a2611c99e9919634491ef.tar.xz
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.html
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/RestClient.cs2
-rw-r--r--OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs1
-rw-r--r--OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs1
-rw-r--r--OpenSim/Framework/Servers/HttpServer/RestObjectPoster.cs1
-rw-r--r--OpenSim/Framework/Servers/HttpServer/RestObjectPosterResponse.cs1
-rw-r--r--OpenSim/Framework/Servers/HttpServer/RestSessionService.cs2
-rw-r--r--OpenSim/Framework/UntrustedWebRequest.cs1
-rw-r--r--OpenSim/Framework/WebUtil.cs5
8 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs
index 97b3b60..226e52f 100644
--- a/OpenSim/Framework/Communications/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient.cs
@@ -306,6 +306,7 @@ namespace OpenSim.Framework.Communications
306 _request.ContentType = "application/xml"; 306 _request.ContentType = "application/xml";
307 _request.Timeout = 200000; 307 _request.Timeout = 200000;
308 _request.Method = RequestMethod; 308 _request.Method = RequestMethod;
309 _request.Proxy = null;
309 _asyncException = null; 310 _asyncException = null;
310 311
311// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); 312// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
@@ -365,6 +366,7 @@ namespace OpenSim.Framework.Communications
365 _request.ContentType = "application/xml"; 366 _request.ContentType = "application/xml";
366 _request.Timeout = 900000; 367 _request.Timeout = 900000;
367 _request.Method = RequestMethod; 368 _request.Method = RequestMethod;
369 _request.Proxy = null;
368 _asyncException = null; 370 _asyncException = null;
369 _request.ContentLength = src.Length; 371 _request.ContentLength = src.Length;
370 372
diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
index 3dce578..7aaf776 100644
--- a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
+++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
@@ -65,6 +65,7 @@ namespace OpenSim.Framework.Configuration.HTTP
65 byte[] buf = new byte[8192]; 65 byte[] buf = new byte[8192];
66 HttpWebRequest request = 66 HttpWebRequest request =
67 (HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName); 67 (HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName);
68 request.Proxy = null;
68 HttpWebResponse response = (HttpWebResponse) request.GetResponse(); 69 HttpWebResponse response = (HttpWebResponse) request.GetResponse();
69 70
70 Stream resStream = response.GetResponseStream(); 71 Stream resStream = response.GetResponseStream();
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
index a2f5d9c..96d4d59 100644
--- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
+++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
@@ -70,6 +70,7 @@ namespace OpenSim.Framework.RegionLoader.Web
70 int regionCount = 0; 70 int regionCount = 0;
71 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url); 71 HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
72 webRequest.Timeout = 30000; //30 Second Timeout 72 webRequest.Timeout = 30000; //30 Second Timeout
73 webRequest.Proxy = null;
73 m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url); 74 m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
74 75
75 try 76 try
diff --git a/OpenSim/Framework/Servers/HttpServer/RestObjectPoster.cs b/OpenSim/Framework/Servers/HttpServer/RestObjectPoster.cs
index 48ced19..61161e3 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestObjectPoster.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestObjectPoster.cs
@@ -50,6 +50,7 @@ namespace OpenSim.Framework.Servers.HttpServer
50 50
51 WebRequest request = WebRequest.Create(requestUrl); 51 WebRequest request = WebRequest.Create(requestUrl);
52 request.Method = verb; 52 request.Method = verb;
53 request.Proxy = null;
53 request.ContentType = "text/xml"; 54 request.ContentType = "text/xml";
54 55
55 MemoryStream buffer = new MemoryStream(); 56 MemoryStream buffer = new MemoryStream();
diff --git a/OpenSim/Framework/Servers/HttpServer/RestObjectPosterResponse.cs b/OpenSim/Framework/Servers/HttpServer/RestObjectPosterResponse.cs
index 451745c..727f027 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestObjectPosterResponse.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestObjectPosterResponse.cs
@@ -57,6 +57,7 @@ namespace OpenSim.Framework.Servers.HttpServer
57 57
58 WebRequest request = WebRequest.Create(requestUrl); 58 WebRequest request = WebRequest.Create(requestUrl);
59 request.Method = verb; 59 request.Method = verb;
60 request.Proxy = null;
60 request.ContentType = "text/xml"; 61 request.ContentType = "text/xml";
61 request.Timeout = 10000; 62 request.Timeout = 10000;
62 63
diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs
index 19c03a8..1612d4a 100644
--- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs
+++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs
@@ -74,6 +74,7 @@ namespace OpenSim.Framework.Servers.HttpServer
74 74
75 WebRequest request = WebRequest.Create(requestUrl); 75 WebRequest request = WebRequest.Create(requestUrl);
76 request.Method = verb; 76 request.Method = verb;
77 request.Proxy = null;
77 request.ContentType = "text/xml"; 78 request.ContentType = "text/xml";
78 request.Timeout = 20000; 79 request.Timeout = 20000;
79 80
@@ -139,6 +140,7 @@ namespace OpenSim.Framework.Servers.HttpServer
139 140
140 WebRequest request = WebRequest.Create(requestUrl); 141 WebRequest request = WebRequest.Create(requestUrl);
141 request.Method = verb; 142 request.Method = verb;
143 request.Proxy = null;
142 request.ContentType = "text/xml"; 144 request.ContentType = "text/xml";
143 request.Timeout = 10000; 145 request.Timeout = 10000;
144 146
diff --git a/OpenSim/Framework/UntrustedWebRequest.cs b/OpenSim/Framework/UntrustedWebRequest.cs
index e6411cc..f2355b1 100644
--- a/OpenSim/Framework/UntrustedWebRequest.cs
+++ b/OpenSim/Framework/UntrustedWebRequest.cs
@@ -88,6 +88,7 @@ namespace OpenSim.Framework
88 httpWebRequest.ReadWriteTimeout = readWriteTimeoutMS; 88 httpWebRequest.ReadWriteTimeout = readWriteTimeoutMS;
89 httpWebRequest.Timeout = timeoutMS; 89 httpWebRequest.Timeout = timeoutMS;
90 httpWebRequest.KeepAlive = false; 90 httpWebRequest.KeepAlive = false;
91 httpWebRequest.Proxy = null;
91 92
92 return httpWebRequest; 93 return httpWebRequest;
93 } 94 }
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index 1d9e2ce..9eff0d2 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -171,6 +171,7 @@ namespace OpenSim.Framework
171 request.Method = method; 171 request.Method = method;
172 request.Timeout = timeout; 172 request.Timeout = timeout;
173 request.KeepAlive = false; 173 request.KeepAlive = false;
174 request.Proxy = null;
174 request.MaximumAutomaticRedirections = 10; 175 request.MaximumAutomaticRedirections = 10;
175 request.ReadWriteTimeout = timeout / 4; 176 request.ReadWriteTimeout = timeout / 4;
176 request.Headers[OSHeaderRequestID] = reqnum.ToString(); 177 request.Headers[OSHeaderRequestID] = reqnum.ToString();
@@ -350,6 +351,7 @@ namespace OpenSim.Framework
350 request.Method = "POST"; 351 request.Method = "POST";
351 request.Timeout = timeout; 352 request.Timeout = timeout;
352 request.KeepAlive = false; 353 request.KeepAlive = false;
354 request.Proxy = null;
353 request.MaximumAutomaticRedirections = 10; 355 request.MaximumAutomaticRedirections = 10;
354 request.ReadWriteTimeout = timeout / 4; 356 request.ReadWriteTimeout = timeout / 4;
355 request.Headers[OSHeaderRequestID] = reqnum.ToString(); 357 request.Headers[OSHeaderRequestID] = reqnum.ToString();
@@ -730,6 +732,7 @@ namespace OpenSim.Framework
730 Type type = typeof(TRequest); 732 Type type = typeof(TRequest);
731 733
732 WebRequest request = WebRequest.Create(requestUrl); 734 WebRequest request = WebRequest.Create(requestUrl);
735 request.Proxy = null;
733 WebResponse response = null; 736 WebResponse response = null;
734 TResponse deserial = default(TResponse); 737 TResponse deserial = default(TResponse);
735 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); 738 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
@@ -924,6 +927,7 @@ namespace OpenSim.Framework
924 927
925 WebRequest request = WebRequest.Create(requestUrl); 928 WebRequest request = WebRequest.Create(requestUrl);
926 request.Method = verb; 929 request.Method = verb;
930 request.Proxy = null;
927 string respstring = String.Empty; 931 string respstring = String.Empty;
928 932
929 using (MemoryStream buffer = new MemoryStream()) 933 using (MemoryStream buffer = new MemoryStream())
@@ -1051,6 +1055,7 @@ namespace OpenSim.Framework
1051 1055
1052 WebRequest request = WebRequest.Create(requestUrl); 1056 WebRequest request = WebRequest.Create(requestUrl);
1053 request.Method = verb; 1057 request.Method = verb;
1058 request.Proxy = null;
1054 MemoryStream buffer = null; 1059 MemoryStream buffer = null;
1055 1060
1056 if ((verb == "POST") || (verb == "PUT")) 1061 if ((verb == "POST") || (verb == "PUT"))