aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorTom2011-01-29 19:38:05 -0800
committerTom2011-01-29 19:38:05 -0800
commit35d29ef3e3539b03164289481fbf305ad7565dfb (patch)
treeaa8b764b458e68974a46d8aff50762676f1b0235 /OpenSim
parentMerge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff)
downloadopensim-SC-35d29ef3e3539b03164289481fbf305ad7565dfb.zip
opensim-SC-35d29ef3e3539b03164289481fbf305ad7565dfb.tar.gz
opensim-SC-35d29ef3e3539b03164289481fbf305ad7565dfb.tar.bz2
opensim-SC-35d29ef3e3539b03164289481fbf305ad7565dfb.tar.xz
If llHTTPRequest results in an error, still attempt to get the response text. If we can't (which implies the server is unreachable), return the StatusDescription as before.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index e4a2461..51742ff 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -408,7 +408,17 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
408 { 408 {
409 HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response; 409 HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
410 Status = (int)webRsp.StatusCode; 410 Status = (int)webRsp.StatusCode;
411 ResponseBody = webRsp.StatusDescription; 411 try
412 {
413 using (Stream responseStream = webRsp.GetResponseStream())
414 {
415 ResponseBody = responseStream.GetStreamString();
416 }
417 }
418 catch
419 {
420 ResponseBody = webRsp.StatusDescription;
421 }
412 } 422 }
413 else 423 else
414 { 424 {