[ovs-dev] [PATCH] jsonrpc: Alters jsonrpc_recv to return the RPC message if fully consumed.

Ben Pfaff blp at nicira.com
Thu Apr 3 22:34:30 UTC 2014


On Thu, Apr 03, 2014 at 03:06:03PM -0700, Chris Hydon wrote:
> Previously, if the final iteration of the loop in jsonrpc_recv reads or
> parses the last portion of a json object, it will return EAGAIN, with
> the next call to jsonrpc_recv setting the message pointer. This can be
> problematic if external code uses this function in conjunction with a
> check on the socket's file descripitor. With this change, the loop does
> not end if the byte queue is non-empty unless the parser has completed,
> in which case the message pointer will always be set to the parsed
> message.
> 
> Signed-off-by: Chris Hydon<chydon at aristanetworks.com>

I see the problem but I think that overall the code is just
unnecessarily complicated here.  I sent out an alternative patch that
makes it simpler and should fix the same problem.  Will you review it?
It is posted here:
        http://openvswitch.org/pipermail/dev/2014-April/038437.html
Thanks.



More information about the dev mailing list