Revision 303036653730 () - Diff

Link to this snippet: https://friendpaste.com/6g6tQIIvjnBEi7a2vkIQDc
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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};