THRIFT-1357: Erlang dependency breaks build
authorJake Farrell <jfarrell@apache.org>
Mon, 26 Sep 2011 15:29:03 +0000 (15:29 +0000)
committerJake Farrell <jfarrell@apache.org>
Mon, 26 Sep 2011 15:29:03 +0000 (15:29 +0000)
Client: erl
Patch: Peter Neumark

Updates json protocol to work with JSX 0.9.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1175906 13f79535-47bb-0310-9956-ffa450edef68

lib/erl/src/thrift_json_protocol.erl

index 48b4962..aa4aed8 100644 (file)
@@ -294,7 +294,7 @@ write(This0, {string, Str}) -> write_values(This0, [
         {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)