aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2009-07-21 06:47:29 +0000
committerTeravus Ovares2009-07-21 06:47:29 +0000
commitc243ae43f23be20ec3388ed30e8b7b806ad2a2a7 (patch)
tree2c38ab90f6c81e08ada7ef4f4dbad6da77afd75a /OpenSim
parent* nothing in this commit, re-triggering panda.. which crashed while testing. (diff)
downloadopensim-SC_OLD-c243ae43f23be20ec3388ed30e8b7b806ad2a2a7.zip
opensim-SC_OLD-c243ae43f23be20ec3388ed30e8b7b806ad2a2a7.tar.gz
opensim-SC_OLD-c243ae43f23be20ec3388ed30e8b7b806ad2a2a7.tar.bz2
opensim-SC_OLD-c243ae43f23be20ec3388ed30e8b7b806ad2a2a7.tar.xz
* Updated C# WebServer to the latest available source download (r19869) and applied a few mods from the old version (now up on opensim-libs (VS 3.5 project).
* Made various changes to BaseHttpServer to accommodate the new interfaces. * This version has been significantly re-architected and may fail in unusual and insidious ways. * Please pay attention to any errors you get and post a Mantis if you can reproduce an issue with the HTTPServer. I'm including the pdb and having the http server compiled in debug for a few weeks so that when an error occurs, it'll print the pertenant data. * Once again, this is the full C# WebServer, not the lite branch that is included in LibOMV (we need SSL!)
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs19
-rw-r--r--OpenSim/Framework/Servers/Tests/OSHttpTests.cs31
-rw-r--r--OpenSim/Region/UserStatistics/Default_Report.cs6
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs6
4 files changed, 51 insertions, 11 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index ef61200..4532e76 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -226,6 +226,15 @@ namespace OpenSim.Framework.Servers.HttpServer
226 return true; 226 return true;
227 } 227 }
228 228
229 private void OnRequest(object source, RequestEventArgs args)
230 {
231 IHttpClientContext context = (IHttpClientContext)source;
232 IHttpRequest request = args.Request;
233
234 OnHandleRequestIOThread(context,request);
235
236 }
237
229 public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request) 238 public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request)
230 { 239 {
231 OSHttpRequest req = new OSHttpRequest(context, request); 240 OSHttpRequest req = new OSHttpRequest(context, request);
@@ -1406,7 +1415,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1406 { 1415 {
1407 //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); 1416 //m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
1408 //m_httpListener.Prefixes.Add("http://10.1.1.5:" + m_port + "/"); 1417 //m_httpListener.Prefixes.Add("http://10.1.1.5:" + m_port + "/");
1409 m_httpListener2 = new CoolHTTPListener(m_listenIPAddress, (int)m_port); 1418 m_httpListener2 = CoolHTTPListener.Create(m_listenIPAddress, (int)m_port);
1410 m_httpListener2.ExceptionThrown += httpServerException; 1419 m_httpListener2.ExceptionThrown += httpServerException;
1411 m_httpListener2.LogWriter = httpserverlog; 1420 m_httpListener2.LogWriter = httpserverlog;
1412 1421
@@ -1414,7 +1423,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1414 // if you want more detailed trace information from the HttpServer 1423 // if you want more detailed trace information from the HttpServer
1415 //m_httpListener2.UseTraceLogs = true; 1424 //m_httpListener2.UseTraceLogs = true;
1416 1425
1417 m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; 1426 //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor;
1418 } 1427 }
1419 else 1428 else
1420 { 1429 {
@@ -1422,7 +1431,7 @@ namespace OpenSim.Framework.Servers.HttpServer
1422 //m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); 1431 //m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
1423 } 1432 }
1424 1433
1425 m_httpListener2.RequestHandler += OnHandleRequestIOThread; 1434 m_httpListener2.RequestReceived += OnRequest;
1426 //m_httpListener.Start(); 1435 //m_httpListener.Start();
1427 m_httpListener2.Start(64); 1436 m_httpListener2.Start(64);
1428 HTTPDRunning = true; 1437 HTTPDRunning = true;
@@ -1474,10 +1483,10 @@ namespace OpenSim.Framework.Servers.HttpServer
1474 { 1483 {
1475 HTTPDRunning = false; 1484 HTTPDRunning = false;
1476 m_httpListener2.ExceptionThrown -= httpServerException; 1485 m_httpListener2.ExceptionThrown -= httpServerException;
1477 m_httpListener2.DisconnectHandler = null; 1486 //m_httpListener2.DisconnectHandler = null;
1478 1487
1479 m_httpListener2.LogWriter = null; 1488 m_httpListener2.LogWriter = null;
1480 m_httpListener2.RequestHandler -= OnHandleRequestIOThread; 1489 m_httpListener2.RequestReceived -= OnRequest;
1481 1490
1482 m_httpListener2.Stop(); 1491 m_httpListener2.Stop();
1483 } 1492 }
diff --git a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
index 48db44d..f7f0afa 100644
--- a/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
+++ b/OpenSim/Framework/Servers/Tests/OSHttpTests.cs
@@ -46,6 +46,10 @@ namespace OpenSim.Framework.Servers.Tests
46 public class TestHttpClientContext: IHttpClientContext 46 public class TestHttpClientContext: IHttpClientContext
47 { 47 {
48 private bool _secured; 48 private bool _secured;
49 public bool IsSecured
50 {
51 get { return _secured; }
52 }
49 public bool Secured 53 public bool Secured
50 { 54 {
51 get { return _secured; } 55 get { return _secured; }
@@ -62,10 +66,19 @@ namespace OpenSim.Framework.Servers.Tests
62 public void Respond(string body) {} 66 public void Respond(string body) {}
63 public void Send(byte[] buffer) {} 67 public void Send(byte[] buffer) {}
64 public void Send(byte[] buffer, int offset, int size) {} 68 public void Send(byte[] buffer, int offset, int size) {}
69 public void Respond(string httpVersion, HttpStatusCode statusCode, string reason, string body, string contentType) {}
70
71 public event EventHandler<DisconnectedEventArgs> Disconnected = delegate { };
72 /// <summary>
73 /// A request have been received in the context.
74 /// </summary>
75 public event EventHandler<RequestEventArgs> RequestReceived = delegate { };
76
65 } 77 }
66 78
67 public class TestHttpRequest: IHttpRequest 79 public class TestHttpRequest: IHttpRequest
68 { 80 {
81 private string _uriPath;
69 public bool BodyIsComplete 82 public bool BodyIsComplete
70 { 83 {
71 get { return true; } 84 get { return true; }
@@ -183,6 +196,24 @@ namespace OpenSim.Framework.Servers.Tests
183 196
184 return clone; 197 return clone;
185 } 198 }
199 public IHttpResponse CreateResponse(IHttpClientContext context)
200 {
201 return new HttpResponse(context, this);
202 }
203 /// <summary>
204 /// Path and query (will be merged with the host header) and put in Uri
205 /// </summary>
206 /// <see cref="Uri"/>
207 public string UriPath
208 {
209 get { return _uriPath; }
210 set
211 {
212 _uriPath = value;
213
214 }
215 }
216
186 } 217 }
187 218
188 public class TestHttpResponse: IHttpResponse 219 public class TestHttpResponse: IHttpResponse
diff --git a/OpenSim/Region/UserStatistics/Default_Report.cs b/OpenSim/Region/UserStatistics/Default_Report.cs
index 668fd45..0e17630 100644
--- a/OpenSim/Region/UserStatistics/Default_Report.cs
+++ b/OpenSim/Region/UserStatistics/Default_Report.cs
@@ -112,15 +112,15 @@ TD.align_top { vertical-align: top; }
112 112
113 ajaxUpdaterDivs[0] = "activeconnections"; 113 ajaxUpdaterDivs[0] = "activeconnections";
114 ajaxUpdaterSeconds[0] = 10; 114 ajaxUpdaterSeconds[0] = 10;
115 ajaxUpdaterReportFragments[0] = "activeconnectionsajax.ajax"; 115 ajaxUpdaterReportFragments[0] = "activeconnectionsajax.html";
116 116
117 ajaxUpdaterDivs[1] = "activesimstats"; 117 ajaxUpdaterDivs[1] = "activesimstats";
118 ajaxUpdaterSeconds[1] = 20; 118 ajaxUpdaterSeconds[1] = 20;
119 ajaxUpdaterReportFragments[1] = "simstatsajax.ajax"; 119 ajaxUpdaterReportFragments[1] = "simstatsajax.html";
120 120
121 ajaxUpdaterDivs[2] = "activelog"; 121 ajaxUpdaterDivs[2] = "activelog";
122 ajaxUpdaterSeconds[2] = 5; 122 ajaxUpdaterSeconds[2] = 5;
123 ajaxUpdaterReportFragments[2] = "activelogajax.ajax"; 123 ajaxUpdaterReportFragments[2] = "activelogajax.html";
124 124
125 HTMLUtil.InsertPeriodicUpdaters(ref output, ajaxUpdaterDivs, ajaxUpdaterSeconds, ajaxUpdaterReportFragments); 125 HTMLUtil.InsertPeriodicUpdaters(ref output, ajaxUpdaterDivs, ajaxUpdaterSeconds, ajaxUpdaterReportFragments);
126 126
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 0807607..a65b84c 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -110,9 +110,9 @@ namespace OpenSim.Region.UserStatistics
110 reports.Add("", rep); 110 reports.Add("", rep);
111 reports.Add("prototype.js", protodep); 111 reports.Add("prototype.js", protodep);
112 reports.Add("updater.js", updatedep); 112 reports.Add("updater.js", updatedep);
113 reports.Add("activeconnectionsajax.ajax", ajConnections); 113 reports.Add("activeconnectionsajax.html", ajConnections);
114 reports.Add("simstatsajax.ajax", ajSimStats); 114 reports.Add("simstatsajax.html", ajSimStats);
115 reports.Add("activelogajax.ajax", ajLogLines); 115 reports.Add("activelogajax.html", ajLogLines);
116 reports.Add("clients.report", clientReport); 116 reports.Add("clients.report", clientReport);
117 reports.Add("sessions.report", sessionsReport); 117 reports.Add("sessions.report", sessionsReport);
118 118