diff options
author | Charles Krinke | 2009-05-13 01:27:23 +0000 |
---|---|---|
committer | Charles Krinke | 2009-05-13 01:27:23 +0000 |
commit | a5feb0682a95065e354406c047fa623c1a811db8 (patch) | |
tree | 8ab7600cf5468e41bf3e5d2bf91ebcc716a7ebd3 /OpenSim/Framework/Servers/BaseOpenSimServer.cs | |
parent | Added interface, implementation stub and (diff) | |
download | opensim-SC_OLD-a5feb0682a95065e354406c047fa623c1a811db8.zip opensim-SC_OLD-a5feb0682a95065e354406c047fa623c1a811db8.tar.gz opensim-SC_OLD-a5feb0682a95065e354406c047fa623c1a811db8.tar.bz2 opensim-SC_OLD-a5feb0682a95065e354406c047fa623c1a811db8.tar.xz |
Thank you kindly, BlueWall sir, for a patch that:
Adding a jsonp wrapper to the user supplied status report
uri if the key "callback" exists. It will work with many
javascript toolkits to provide an ajax callback to allow
the browser to update stats reports without the
intervention of an intermediate server.
Diffstat (limited to 'OpenSim/Framework/Servers/BaseOpenSimServer.cs')
-rw-r--r-- | OpenSim/Framework/Servers/BaseOpenSimServer.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 7ab5c33..b35c791 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs | |||
@@ -488,8 +488,16 @@ namespace OpenSim.Framework.Servers | |||
488 | } | 488 | } |
489 | 489 | ||
490 | public string StatReport(OSHttpRequest httpRequest) | 490 | public string StatReport(OSHttpRequest httpRequest) |
491 | { | 491 | { |
492 | return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version ); | 492 | // If we catch a request for "callback", wrap the response in the value for jsonp |
493 | if( httpRequest.Query.ContainsKey("callback")) | ||
494 | { | ||
495 | return httpRequest.Query["callback"].ToString() + "(" + m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version ) + ");"; | ||
496 | } | ||
497 | else | ||
498 | { | ||
499 | return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version ); | ||
500 | } | ||
493 | } | 501 | } |
494 | 502 | ||
495 | protected void RemovePIDFile() | 503 | protected void RemovePIDFile() |