diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Util.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 2ac4eb1..e7a7f49 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1521,7 +1521,23 @@ namespace OpenSim.Framework | |||
1521 | return null; | 1521 | return null; |
1522 | } | 1522 | } |
1523 | 1523 | ||
1524 | 1524 | public static string GetCallerIP(Hashtable req) | |
1525 | { | ||
1526 | if (req.ContainsKey("headers")) | ||
1527 | { | ||
1528 | try | ||
1529 | { | ||
1530 | Hashtable headers = (Hashtable)req["headers"]; | ||
1531 | if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null) | ||
1532 | return headers["remote_addr"].ToString(); | ||
1533 | } | ||
1534 | catch (Exception e) | ||
1535 | { | ||
1536 | m_log.WarnFormat("[UTIL]: exception in GetCallerIP: {0}", e.Message); | ||
1537 | } | ||
1538 | } | ||
1539 | return string.Empty; | ||
1540 | } | ||
1525 | 1541 | ||
1526 | } | 1542 | } |
1527 | } | 1543 | } |