diff options
author | Mic Bowman | 2012-08-29 14:56:51 -0700 |
---|---|---|
committer | Mic Bowman | 2012-08-29 14:56:51 -0700 |
commit | 3d736d575ff9670ac813f13eb1cff07dea10328b (patch) | |
tree | be3458150faf0a738c2e14814b2ff3992e4b4d5a /OpenSim/Region/CoreModules | |
parent | implementing rule tracking (diff) | |
download | opensim-SC-3d736d575ff9670ac813f13eb1cff07dea10328b.zip opensim-SC-3d736d575ff9670ac813f13eb1cff07dea10328b.tar.gz opensim-SC-3d736d575ff9670ac813f13eb1cff07dea10328b.tar.bz2 opensim-SC-3d736d575ff9670ac813f13eb1cff07dea10328b.tar.xz |
This partially implements the LSL function to set the response
type for an HTTP request. Since the "official" LSL function limits
the use of the response type, it is implemented as osSetContentType
with a string for the content mime type and a threat level of high.
With this function you should be able to implement rather functional
media-on-a-prim application with much less difficulty.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 05d54f0..53a9679 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -84,6 +84,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
84 | public string body; | 84 | public string body; |
85 | public int responseCode; | 85 | public int responseCode; |
86 | public string responseBody; | 86 | public string responseBody; |
87 | public string responseType = "text/plain"; | ||
87 | //public ManualResetEvent ev; | 88 | //public ManualResetEvent ev; |
88 | public bool requestDone; | 89 | public bool requestDone; |
89 | public int startTime; | 90 | public int startTime; |
@@ -302,6 +303,22 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
302 | } | 303 | } |
303 | } | 304 | } |
304 | 305 | ||
306 | public void HttpContentType(UUID request, string type) | ||
307 | { | ||
308 | lock (m_UrlMap) | ||
309 | { | ||
310 | if (m_RequestMap.ContainsKey(request)) | ||
311 | { | ||
312 | UrlData urlData = m_RequestMap[request]; | ||
313 | urlData.requests[request].responseType = type; | ||
314 | } | ||
315 | else | ||
316 | { | ||
317 | m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString()); | ||
318 | } | ||
319 | } | ||
320 | } | ||
321 | |||
305 | public void HttpResponse(UUID request, int status, string body) | 322 | public void HttpResponse(UUID request, int status, string body) |
306 | { | 323 | { |
307 | lock (m_UrlMap) | 324 | lock (m_UrlMap) |
@@ -504,7 +521,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
504 | //put response | 521 | //put response |
505 | response["int_response_code"] = requestData.responseCode; | 522 | response["int_response_code"] = requestData.responseCode; |
506 | response["str_response_string"] = requestData.responseBody; | 523 | response["str_response_string"] = requestData.responseBody; |
507 | response["content_type"] = "text/plain"; | 524 | response["content_type"] = requestData.responseType; |
525 | // response["content_type"] = "text/plain"; | ||
508 | response["keepalive"] = false; | 526 | response["keepalive"] = false; |
509 | response["reusecontext"] = false; | 527 | response["reusecontext"] = false; |
510 | 528 | ||