aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTeravus Ovares2008-09-30 05:39:52 +0000
committerTeravus Ovares2008-09-30 05:39:52 +0000
commit6ea5b515d025a14f706921fdaa5143c041ad7b4c (patch)
tree3b13bd8c96a897791abd1f1bf7fa9f0a07e867b2 /OpenSim
parentUpdate svn properties, minor formatting cleanup. (diff)
downloadopensim-SC_OLD-6ea5b515d025a14f706921fdaa5143c041ad7b4c.zip
opensim-SC_OLD-6ea5b515d025a14f706921fdaa5143c041ad7b4c.tar.gz
opensim-SC_OLD-6ea5b515d025a14f706921fdaa5143c041ad7b4c.tar.bz2
opensim-SC_OLD-6ea5b515d025a14f706921fdaa5143c041ad7b4c.tar.xz
* Get the code up to speed with my -#dev e-mail example. (uncomment out lines 227 - 235 to test.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs21
-rw-r--r--OpenSim/Framework/Servers/OSHttpResponse.cs17
-rw-r--r--OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs12
3 files changed, 45 insertions, 5 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index e44a301..707f621 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -323,7 +323,8 @@ namespace OpenSim.Framework.Servers
323 323
324 OSHttpRequest request = new OSHttpRequest(context.Request); 324 OSHttpRequest request = new OSHttpRequest(context.Request);
325 OSHttpResponse response = new OSHttpResponse(context.Response); 325 OSHttpResponse response = new OSHttpResponse(context.Response);
326 326 context.Response.ProtocolVersion = new Version("1.0");
327 context.Response.KeepAlive = false;
327 // This is the REST agent interface. We require an agent to properly identify 328 // This is the REST agent interface. We require an agent to properly identify
328 // itself. If the REST handler recognizes the prefix it will attempt to 329 // itself. If the REST handler recognizes the prefix it will attempt to
329 // satisfy the request. If it is not recognizable, and no damage has occurred 330 // satisfy the request. If it is not recognizable, and no damage has occurred
@@ -991,11 +992,17 @@ namespace OpenSim.Framework.Servers
991 int responsecode = (int)responsedata["int_response_code"]; 992 int responsecode = (int)responsedata["int_response_code"];
992 string responseString = (string)responsedata["str_response_string"]; 993 string responseString = (string)responsedata["str_response_string"];
993 string contentType = (string)responsedata["content_type"]; 994 string contentType = (string)responsedata["content_type"];
995 if (responsedata.ContainsKey("error_status_text"))
996 {
997 response.StatusDescription = (string)responsedata["error_status_text"];
998 }
994 999
995
996 if (responsedata.ContainsKey("keepalive")) 1000 if (responsedata.ContainsKey("keepalive"))
997 response.KeepAlive = true; 1001 {
1002 bool keepalive = (bool)responsedata["keepalive"];
1003 response.KeepAlive = keepalive;
998 1004
1005 }
999 //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this 1006 //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this
1000 //and should check for NullReferenceExceptions 1007 //and should check for NullReferenceExceptions
1001 1008
@@ -1014,7 +1021,7 @@ namespace OpenSim.Framework.Servers
1014 response.StatusCode = responsecode; 1021 response.StatusCode = responsecode;
1015 } 1022 }
1016 1023
1017 response.AddHeader("Content-type", contentType); 1024 response.AddHeader("Content-Type", contentType);
1018 1025
1019 byte[] buffer; 1026 byte[] buffer;
1020 1027
@@ -1121,12 +1128,18 @@ namespace OpenSim.Framework.Servers
1121 if (!m_ssl) 1128 if (!m_ssl)
1122 { 1129 {
1123 m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); 1130 m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
1131 //m_httpListener.Prefixes.Add("http://10.1.1.5:" + m_port + "/");
1124 } 1132 }
1125 else 1133 else
1126 { 1134 {
1127 m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/"); 1135 m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/");
1128 m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); 1136 m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
1129 } 1137 }
1138 HttpListenerPrefixCollection prefixs = m_httpListener.Prefixes;
1139
1140 foreach (string prefix in prefixs)
1141 System.Console.WriteLine("Listening on: " + prefix);
1142
1130 m_httpListener.Start(); 1143 m_httpListener.Start();
1131 1144
1132 HttpListenerContext context; 1145 HttpListenerContext context;
diff --git a/OpenSim/Framework/Servers/OSHttpResponse.cs b/OpenSim/Framework/Servers/OSHttpResponse.cs
index 6fff026..f881a22 100644
--- a/OpenSim/Framework/Servers/OSHttpResponse.cs
+++ b/OpenSim/Framework/Servers/OSHttpResponse.cs
@@ -200,6 +200,23 @@ namespace OpenSim.Framework.Servers
200 } 200 }
201 } 201 }
202 202
203 public Version ProtocolVersion
204 {
205 get
206 {
207 if (!HttpServer)
208 return _httpListenerResponse.ProtocolVersion;
209
210 return new Version("1.0");
211 }
212 set
213 {
214 if (!HttpServer)
215 _httpListenerResponse.ProtocolVersion = value;
216
217 }
218 }
219
203 /// <summary> 220 /// <summary>
204 /// Return the output stream feeding the body. 221 /// Return the output stream feeding the body.
205 /// </summary> 222 /// </summary>
diff --git a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
index 2eb0ecd..4f4c6ea 100644
--- a/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/EventQueueGetModule.cs
@@ -177,7 +177,7 @@ namespace OpenSim.Region.Environment.Modules.Framework
177 if (m_ids.ContainsKey(avatar.UUID)) 177 if (m_ids.ContainsKey(avatar.UUID))
178 { 178 {
179 // close the event queue. 179 // close the event queue.
180 m_ids[avatar.UUID] = -1; 180 //m_ids[avatar.UUID] = -1;
181 } 181 }
182 } 182 }
183 } 183 }
@@ -224,6 +224,16 @@ namespace OpenSim.Region.Environment.Modules.Framework
224 lock (m_ids) 224 lock (m_ids)
225 thisID = m_ids[agentID]; 225 thisID = m_ids[agentID];
226 226
227 //if (element == null)
228 //{
229 // responsedata["int_response_code"] = 502;
230 // responsedata["content_type"] = "text/plain";
231 // responsedata["keepalive"] = false;
232 // responsedata["str_response_string"] = "Upstream error: ";
233 // responsedata["error_status_text"] = "Upstream error:";
234 // return responsedata;
235 //}
236
227 if (thisID == -1) // close-request 237 if (thisID == -1) // close-request
228 { 238 {
229 responsedata["int_response_code"] = 502; 239 responsedata["int_response_code"] = 502;