]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: Fix client crash on connection close
authorJiri Denemark <jdenemar@redhat.com>
Fri, 2 Mar 2012 18:57:27 +0000 (19:57 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 5 Mar 2012 10:30:02 +0000 (11:30 +0100)
commit720bee300896a0e66d47e391be7cd86719697075
treec9a8b5bb33b22f363afe693cca47a92ad03db0f1
parent57e677a7c6e55dea60d9be5667e8eebba11cc2b4
rpc: Fix client crash on connection close

A multi-threaded client with event loop may crash if one of its threads
closes a connection while event loop is in the middle of sending
keep-alive message (either request or response). The right place for it
is inside virNetClientIOEventLoop() between poll() and
virNetClientLock(). We should only close a connection directly if no-one
is using it and defer the closing to the last user otherwise. So far we
only did so if the close was initiated by keep-alive timeout.
src/rpc/virnetclient.c