On Mon, Feb 27, 2012 at 01:35:04PM -0800, Ethan Jackson wrote:
> > My thinking was that once I've sent the request, I need to destroy the
> > 'conn' object. and now the caller has this dangling reference.
> > However, the more I think about it, the less valid this argument is
> > because I already make assertions preventing a caller from making a
> > reply twice.  Perhaps simply sending the request, and documenting that
> > only one reply may be made per callback invocation is sufficient.  It
> > certainly would simplify the code significantly.  I'll look into
> > changing it.
> 
> Just to clarify slightly.  I only need to kill the connection object
> in the case that jsonrpc_reply returns an error.  I need to think a
> bit about how to organise this, I had definitely thought about this as
> I wrote the patch and had a reason for doing it this.  Trying to
> remember what it was and if it made sense.

I don't think you need to kill the connection object immediately.
Errors are "sticky", that is, the next call to jsonrpc_get_status()
will report the same error, so you can let run_connection() in the
call to unixctl_server_run() destroy the connection object.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to