diff options
author | Teravus Ovares | 2008-09-30 05:39:52 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-09-30 05:39:52 +0000 |
commit | 6ea5b515d025a14f706921fdaa5143c041ad7b4c (patch) | |
tree | 3b13bd8c96a897791abd1f1bf7fa9f0a07e867b2 /OpenSim/Framework | |
parent | Update svn properties, minor formatting cleanup. (diff) | |
download | opensim-SC-6ea5b515d025a14f706921fdaa5143c041ad7b4c.zip opensim-SC-6ea5b515d025a14f706921fdaa5143c041ad7b4c.tar.gz opensim-SC-6ea5b515d025a14f706921fdaa5143c041ad7b4c.tar.bz2 opensim-SC-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/Framework')
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 21 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/OSHttpResponse.cs | 17 |
2 files changed, 34 insertions, 4 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> |