X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2Fjsonrpc.c;h=b48e247513a3e03bb94437f9452e2509b4147899;hb=71cc59f928f1fae64645540463da41f3c44f761a;hp=1e312a2783d9e2cc408447959b403b1199ade2f9;hpb=37e237206c12af5773feb519e56c4534b750aeac;p=cascardo%2Fovs.git diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c index 1e312a278..b48e24751 100644 --- a/lib/jsonrpc.c +++ b/lib/jsonrpc.c @@ -238,6 +238,7 @@ jsonrpc_send(struct jsonrpc *rpc, struct jsonrpc_msg *msg) { struct ofpbuf *buf; struct json *json; + struct ds ds = DS_EMPTY_INITIALIZER; size_t length; char *s; @@ -249,8 +250,9 @@ jsonrpc_send(struct jsonrpc *rpc, struct jsonrpc_msg *msg) jsonrpc_log_msg(rpc, "send", msg); json = jsonrpc_msg_to_json(msg); - s = json_to_string(json, 0); - length = strlen(s); + json_to_ds(json, 0, &ds); + length = ds.length; + s = ds_steal_cstr(&ds); json_destroy(json); buf = xmalloc(sizeof *buf);