* Adds error handlers for errors parsing the querystring passed on the OSHttpRequest constructor.

* maybe..  it was a key that was null.  Obviously you can't still a null key in a string key'ed collection.
0.6.0-stable
Teravus Ovares 2008-10-01 04:26:51 +00:00
parent f49ba0cbfe
commit 6754681e5b
1 changed files with 18 additions and 3 deletions

View File

@ -221,11 +221,26 @@ namespace OpenSim.Framework.Servers
_userAgent = req.Headers["user-agent"]; _userAgent = req.Headers["user-agent"];
_queryString = new NameValueCollection(); _queryString = new NameValueCollection();
_query = new Hashtable(); _query = new Hashtable();
try
{
foreach (KeyValuePair<string, HttpInputItem> q in req.QueryString) foreach (KeyValuePair<string, HttpInputItem> q in req.QueryString)
{
try
{ {
_queryString.Add(q.Key, q.Value.Value); _queryString.Add(q.Key, q.Value.Value);
_query[q.Key] = q.Value.Value; _query[q.Key] = q.Value.Value;
} }
catch (InvalidCastException)
{
System.Console.WriteLine("[OSHttpRequest]: Errror parsing querystring.. but it was recoverable.. skipping on to the next one");
continue;
}
}
}
catch (Exception)
{
System.Console.WriteLine("[OSHttpRequest]: Errror parsing querystring");
}
// TODO: requires change to HttpServer.HttpRequest // TODO: requires change to HttpServer.HttpRequest
_ipEndPoint = null; _ipEndPoint = null;