diff options
Diffstat (limited to 'OpenSim/Framework/Servers/BaseHttpServer.cs')
-rw-r--r-- | OpenSim/Framework/Servers/BaseHttpServer.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 91b5718..fa64b41 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs | |||
@@ -164,8 +164,8 @@ namespace OpenSim.Framework.Servers | |||
164 | if (TryGetAgentHandler(request, response, out agentHandler)) | 164 | if (TryGetAgentHandler(request, response, out agentHandler)) |
165 | { | 165 | { |
166 | // m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent); | 166 | // m_log.DebugFormat("[HTTP-AGENT] Handler located for {0}", request.UserAgent); |
167 | if(HandleAgentRequest(agentHandler, request, response)) | 167 | if (HandleAgentRequest(agentHandler, request, response)) |
168 | return; | 168 | return; |
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
@@ -177,22 +177,22 @@ namespace OpenSim.Framework.Servers | |||
177 | string handlerKey = GetHandlerKey(request.HttpMethod, path); | 177 | string handlerKey = GetHandlerKey(request.HttpMethod, path); |
178 | 178 | ||
179 | //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); | 179 | //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); |
180 | 180 | ||
181 | if (TryGetStreamHandler(handlerKey, out requestHandler)) | 181 | if (TryGetStreamHandler(handlerKey, out requestHandler)) |
182 | { | 182 | { |
183 | 183 | ||
184 | // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. | 184 | // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. |
185 | byte[] buffer; | 185 | byte[] buffer; |
186 | if (requestHandler is IStreamedRequestHandler) | 186 | if (requestHandler is IStreamedRequestHandler) |
187 | { | 187 | { |
188 | IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; | 188 | IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler; |
189 | 189 | ||
190 | buffer = streamedRequestHandler.Handle(path, request.InputStream, request, response); | 190 | buffer = streamedRequestHandler.Handle(path, request.InputStream, request, response); |
191 | } | 191 | } |
192 | else | 192 | else |
193 | { | 193 | { |
194 | IStreamHandler streamHandler = (IStreamHandler) requestHandler; | 194 | IStreamHandler streamHandler = (IStreamHandler) requestHandler; |
195 | 195 | ||
196 | using (MemoryStream memoryStream = new MemoryStream()) | 196 | using (MemoryStream memoryStream = new MemoryStream()) |
197 | { | 197 | { |
198 | streamHandler.Handle(path, request.InputStream, memoryStream, request, response); | 198 | streamHandler.Handle(path, request.InputStream, memoryStream, request, response); |
@@ -200,11 +200,11 @@ namespace OpenSim.Framework.Servers | |||
200 | buffer = memoryStream.ToArray(); | 200 | buffer = memoryStream.ToArray(); |
201 | } | 201 | } |
202 | } | 202 | } |
203 | 203 | ||
204 | request.InputStream.Close(); | 204 | request.InputStream.Close(); |
205 | if (!response.IsContentTypeSet) response.ContentType = requestHandler.ContentType; | 205 | if (!response.IsContentTypeSet) response.ContentType = requestHandler.ContentType; |
206 | response.ContentLength64 = buffer.LongLength; | 206 | response.ContentLength64 = buffer.LongLength; |
207 | 207 | ||
208 | try | 208 | try |
209 | { | 209 | { |
210 | response.OutputStream.Write(buffer, 0, buffer.Length); | 210 | response.OutputStream.Write(buffer, 0, buffer.Length); |
@@ -216,7 +216,7 @@ namespace OpenSim.Framework.Servers | |||
216 | } | 216 | } |
217 | return; | 217 | return; |
218 | } | 218 | } |
219 | 219 | ||
220 | switch (request.ContentType) | 220 | switch (request.ContentType) |
221 | { | 221 | { |
222 | case null: | 222 | case null: |
@@ -479,7 +479,7 @@ namespace OpenSim.Framework.Servers | |||
479 | private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response) | 479 | private bool HandleAgentRequest(IHttpAgentHandler handler, OSHttpRequest request, OSHttpResponse response) |
480 | { | 480 | { |
481 | 481 | ||
482 | // In the case of REST, then handler is responsible for ALL aspects of | 482 | // In the case of REST, then handler is responsible for ALL aspects of |
483 | // the request/response handling. Nothing is done here, not even encoding. | 483 | // the request/response handling. Nothing is done here, not even encoding. |
484 | 484 | ||
485 | try | 485 | try |