summaryrefslogtreecommitdiff
path: root/indra/lib
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2008-04-28 19:40:54 +0000
committerJosh Bell <josh@lindenlab.com>2008-04-28 19:40:54 +0000
commita089a401ee39c016d7d5c950d4f36e170c5a00e4 (patch)
tree7c260ffdd929f64c52e946e67b761b16717ed7ee /indra/lib
parentb580951a9e4279f04ea342d49c517091cb989a57 (diff)
svn merge -r 84911:86069 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-21-Server --> release
Backport fixes made in the production branch to the trunk now that it is live on the grid: * DEV-14443 Launcher not producing colo prefix when looking up sim class * DEV-10840 "/etc/init.d/backbone stop" returns before all child backbones exited; "backbone restart" results in defunct children * DEV-12558: Able to make anyone's object shout error messages * QAR-483 user start location migration prelude * QAR-490 havok4-6 * Revert havok4-5/4-6 code changes causing parcel access check issues * Revert QAR-277 sqlite-backbone * DEV-12357 SEC-53: Script that crashes regions * QAR-486 New proc and query for Web Classifieds Fix
Diffstat (limited to 'indra/lib')
-rw-r--r--indra/lib/python/indra/base/llsd.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/lib/python/indra/base/llsd.py b/indra/lib/python/indra/base/llsd.py
index cc18dec268..9e636ea423 100644
--- a/indra/lib/python/indra/base/llsd.py
+++ b/indra/lib/python/indra/base/llsd.py
@@ -842,6 +842,16 @@ try:
except:
print "Couldn't import mulib.stacked, not registering LLSD converters"
else:
+ def llsd_convert_json(llsd_stuff, request):
+ callback = request.get_header('callback')
+ if callback is not None:
+ ## See Yahoo's ajax documentation for information about using this
+ ## callback style of programming
+ ## http://developer.yahoo.com/common/json.html#callbackparam
+ req.write("%s(%s)" % (callback, simplejson.dumps(llsd_stuff)))
+ else:
+ req.write(simplejson.dumps(llsd_stuff))
+
def llsd_convert_xml(llsd_stuff, request):
request.write(format_xml(llsd_stuff))
@@ -849,6 +859,8 @@ else:
request.write(format_binary(llsd_stuff))
for typ in [LLSD, dict, list, tuple, str, int, float, bool, unicode, type(None)]:
+ stacked.add_producer(typ, llsd_convert_json, 'application/json')
+
stacked.add_producer(typ, llsd_convert_xml, 'application/llsd+xml')
stacked.add_producer(typ, llsd_convert_xml, 'application/xml')
stacked.add_producer(typ, llsd_convert_xml, 'text/xml')