6g6tQIIvjnBEi7a2vkIQDc changeset

Changeset303036653730 (b)
ParentNone (a)
ab
0+diff --git a/src/couchdb/couch_external_server.erl b/src/couchdb/couch_external_server.erl
0+index 045fcee..e1db2b2 100644
0+--- a/src/couchdb/couch_external_server.erl
0++++ b/src/couchdb/couch_external_server.erl
0+@@ -48,7 +48,13 @@ terminate(_Reason, {_Name, _Command, Pid}) ->
0+     ok.
0+ 
0+ handle_call({execute, JsonReq}, _From, {Name, Command, Pid}) ->
0+-    {reply, couch_os_process:prompt(Pid, JsonReq), {Name, Command, Pid}}.
0++    Reply = case couch_os_process:prompt(Pid, JsonReq) of
0++    {json, Json} ->
0++        ?JSON_DECODE(Json);
0++    Else ->
0++        Else
0++    end,
0++    {reply, Reply, {Name, Command, Pid}}.
0+ 
0+ handle_info({'EXIT', _Pid, normal}, State) ->
0+     {noreply, State};
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- Revision None
+++ Revision 303036653730
@@ -0,0 +1,19 @@
+diff --git a/src/couchdb/couch_external_server.erl b/src/couchdb/couch_external_server.erl
+index 045fcee..e1db2b2 100644
+--- a/src/couchdb/couch_external_server.erl
++++ b/src/couchdb/couch_external_server.erl
+@@ -48,7 +48,13 @@ terminate(_Reason, {_Name, _Command, Pid}) ->
+ ok.
+
+ handle_call({execute, JsonReq}, _From, {Name, Command, Pid}) ->
+- {reply, couch_os_process:prompt(Pid, JsonReq), {Name, Command, Pid}}.
++ Reply = case couch_os_process:prompt(Pid, JsonReq) of
++ {json, Json} ->
++ ?JSON_DECODE(Json);
++ Else ->
++ Else
++ end,
++ {reply, Reply, {Name, Command, Pid}}.
+
+ handle_info({'EXIT', _Pid, normal}, State) ->
+ {noreply, State};