* 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,10 +221,25 @@ namespace OpenSim.Framework.Servers
_userAgent = req.Headers["user-agent"];
_queryString = new NameValueCollection();
_query = new Hashtable();
foreach (KeyValuePair<string, HttpInputItem> q in req.QueryString)
try
{
_queryString.Add(q.Key, q.Value.Value);
_query[q.Key] = q.Value.Value;
foreach (KeyValuePair<string, HttpInputItem> q in req.QueryString)
{
try
{
_queryString.Add(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
_ipEndPoint = null;