X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fjsonrpc.c;h=bd019f7381694d3b0806315375ee7a2717ae9105;hb=1264cb08bfcc5cd9372decb53d3e3a7d07cc3a2b;hp=817a35f1d5b0b2822f5066f1a9a03a4068607e95;hpb=dcbb691b0046f0d4421afbe8901d85c186929f7e;p=openvswitch diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c index 817a35f1..bd019f73 100644 --- a/lib/jsonrpc.c +++ b/lib/jsonrpc.c @@ -402,10 +402,14 @@ jsonrpc_create_id(void) } struct jsonrpc_msg * -jsonrpc_create_request(const char *method, struct json *params) +jsonrpc_create_request(const char *method, struct json *params, + struct json **idp) { - return jsonrpc_create(JSONRPC_REQUEST, method, params, NULL, NULL, - jsonrpc_create_id()); + struct json *id = jsonrpc_create_id(); + if (idp) { + *idp = json_clone(id); + } + return jsonrpc_create(JSONRPC_REQUEST, method, params, NULL, NULL, id); } struct jsonrpc_msg * @@ -722,7 +726,7 @@ jsonrpc_session_run(struct jsonrpc_session *s) struct jsonrpc_msg *request; params = json_array_create_empty(); - request = jsonrpc_create_request("echo", params); + request = jsonrpc_create_request("echo", params, NULL); json_destroy(request->id); request->id = json_string_create("echo"); jsonrpc_send(s->rpc, request);