public
Description: YAWS is an erlang web server
Clone URL: git://github.com/mojombo/yaws.git
Search Repo:
Fixing json-rpc problems
KirinDave (author)
Tue Jul 10 15:39:09 -0700 2007
commit  9d2f565e0556d329dca17d9b53d3fd85d1940844
tree    398c81ad42b297633584761096fc361d26088ca2
parent  7031832c17aef8eb180ee6006d16bf3705a6c9d1
...
280
281
282
283
 
284
285
286
...
289
290
291
292
 
293
294
295
...
280
281
282
 
283
284
285
286
...
289
290
291
 
292
293
294
295
0
@@ -280,7 +280,7 @@ encode_handler_payload({response, [ErlStruct]}, ID, RpcType) -> % {{{
0
 encode_handler_payload({response, ErlStruct}, ID, RpcType) ->
0
     StructStr =
0
   case RpcType of
0
- json -> json:encode({struct, [ {result, ErlStruct}, {id, ID}]});
0
+ json -> json:encode({struct, [ {result, ErlStruct}, {id, case ID of undefined -> ""; Defined -> Defined end}]});
0
    haxe -> [$h, $x, $r | haxe:encode(ErlStruct)]
0
   end,
0
     {ok, StructStr}. % }}}
0
@@ -289,7 +289,7 @@ decode_handler_payload(json, JSonStr) -> %{{{
0
     try
0
         {ok, Obj} = json:decode_string(JSonStr),
0
         Method = list_to_atom(jsonrpc:s(Obj, method)),
0
- {array, Args} = jsonrpc:s(Obj, params),
0
+ {_Kind, Args} = jsonrpc:s(Obj, params),
0
         ID = jsonrpc:s(Obj, id),
0
         {ok, {call, Method, Args}, ID}
0
     catch

Comments

    No one has commented yet.