You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jf...@apache.org on 2011/09/26 17:29:04 UTC

svn commit: r1175906 - /thrift/trunk/lib/erl/src/thrift_json_protocol.erl

Author: jfarrell
Date: Mon Sep 26 15:29:03 2011
New Revision: 1175906

URL: http://svn.apache.org/viewvc?rev=1175906&view=rev
Log:
THRIFT-1357: Erlang dependency breaks build
Client: erl
Patch: Peter Neumark

Updates json protocol to work with JSX 0.9.


Modified:
    thrift/trunk/lib/erl/src/thrift_json_protocol.erl

Modified: thrift/trunk/lib/erl/src/thrift_json_protocol.erl
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/erl/src/thrift_json_protocol.erl?rev=1175906&r1=1175905&r2=1175906&view=diff
==============================================================================
--- thrift/trunk/lib/erl/src/thrift_json_protocol.erl (original)
+++ thrift/trunk/lib/erl/src/thrift_json_protocol.erl Mon Sep 26 15:29:03 2011
@@ -294,7 +294,7 @@ write(This0, {string, Str}) -> write_val
         {context_pre_item, false},
         case is_binary(Str) of
             true -> Str;
-            false -> jsx:term_to_json(list_to_binary(Str))
+            false -> jsx:term_to_json(list_to_binary(Str), [{strict, false}])
         end,
         {context_post_item, false}
     ]);
@@ -325,7 +325,7 @@ write_values(This0, ValueList) ->
 %% Subsequent calls to read actually operate on the events returned by JSX.
 read_all(#json_protocol{transport = Transport0} = State) ->
     {Transport1, Bin} = read_all_1(Transport0, []),
-    P = jsx:decoder(),
+    P = jsx:parser(),
     State#json_protocol{
         transport = Transport1,
         jsx = P(Bin)