summaryrefslogtreecommitdiff
path: root/jsonrpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'jsonrpc.c')
-rw-r--r--jsonrpc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/jsonrpc.c b/jsonrpc.c
index a02bbaa..54ad96c 100644
--- a/jsonrpc.c
+++ b/jsonrpc.c
@@ -6,6 +6,9 @@
#include <jansson.h>
#include "jsonrpc.h"
+int dummy = 0;
+json_t *jsonrpc_async_dummy = (json_t *)&dummy;
+
json_t *jsonrpc_error_object(int code, json_t *data)
{
// reference to data is stolen
@@ -199,7 +202,11 @@ json_t *jsonrpc_handle_request_single(void *apparg, json_t *json_request, struct
json_result = NULL;
} else {
if (rc==0) {
- json_response = jsonrpc_result_response(json_id, json_result);
+ if (json_result == jsonrpc_async_dummy)
+ json_response = NULL;
+ else
+ json_response = jsonrpc_result_response(
+ json_id, json_result);
} else if (rc==JSONRPC_INVALID_PARAMS) {
json_response = jsonrpc_error_response(json_id,
jsonrpc_error_object(JSONRPC_INVALID_PARAMS, json_result));