X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fjsonrpc.c;h=bb4f6baf35449b1cf6606218b063704efb9d73f2;hb=6c4bf0b0070d474ac6cf97b3fda2e262cd060703;hp=72590a2f41da2d73c1b1c35da361e89a54cc8590;hpb=0d11f523a371910cb0ed5549a85836f83a7552c2;p=openvswitch diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c index 72590a2f..bb4f6baf 100644 --- a/lib/jsonrpc.c +++ b/lib/jsonrpc.c @@ -23,6 +23,7 @@ #include "byteq.h" #include "dynamic-string.h" +#include "fatal-signal.h" #include "json.h" #include "list.h" #include "ofpbuf.h" @@ -266,6 +267,12 @@ jsonrpc_recv(struct jsonrpc *rpc, struct jsonrpc_msg **msgp) if (json_parser_is_done(rpc->parser)) { jsonrpc_received(rpc); if (rpc->status) { + const struct byteq *q = &rpc->input; + if (q->head <= BYTEQ_SIZE) { + stream_report_content(q->buffer, q->head, + STREAM_JSONRPC, + THIS_MODULE, rpc->name); + } return rpc->status; } } @@ -293,6 +300,8 @@ jsonrpc_send_block(struct jsonrpc *rpc, struct jsonrpc_msg *msg) { int error; + fatal_signal_run(); + error = jsonrpc_send(rpc, msg); if (error) { return error; @@ -314,6 +323,7 @@ jsonrpc_recv_block(struct jsonrpc *rpc, struct jsonrpc_msg **msgp) for (;;) { int error = jsonrpc_recv(rpc, msgp); if (error != EAGAIN) { + fatal_signal_run(); return error; }