diff options
If a response cannot be obtained (the script has no handler) return a more friendly 500 error instead of crashing out with a null reference and letting the connection hang
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 598e5d1..36c6c75 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -1510,11 +1510,25 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1510 | 1510 | ||
1511 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) | 1511 | internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response) |
1512 | { | 1512 | { |
1513 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | 1513 | int responsecode; |
1514 | int responsecode = (int)responsedata["int_response_code"]; | 1514 | string responseString; |
1515 | string responseString = (string)responsedata["str_response_string"]; | 1515 | string contentType; |
1516 | string contentType = (string)responsedata["content_type"]; | ||
1517 | 1516 | ||
1517 | if (responsedata == null) | ||
1518 | { | ||
1519 | responsecode = 500; | ||
1520 | responseString = "No response could be obtained"; | ||
1521 | contentType = "text/plain"; | ||
1522 | responsedata = new Hashtable(); | ||
1523 | } | ||
1524 | else | ||
1525 | { | ||
1526 | |||
1527 | //m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response"); | ||
1528 | responsecode = (int)responsedata["int_response_code"]; | ||
1529 | responseString = (string)responsedata["str_response_string"]; | ||
1530 | contentType = (string)responsedata["content_type"]; | ||
1531 | } | ||
1518 | 1532 | ||
1519 | if (responsedata.ContainsKey("error_status_text")) | 1533 | if (responsedata.ContainsKey("error_status_text")) |
1520 | { | 1534 | { |