qemu/chardev
Daniel P. Berrange 9cca7578b4 char: don't skip client cleanup if 'connected' flag is unset
The tcp_chr_free_connection & tcp_chr_disconnect methods both
skip all of their cleanup work unless the 's->connected' flag
is set.  This flag is set when the incoming client connection
is ready to use. Crucially this is *after* the TLS handshake
has been completed. So if the TLS handshake fails and we try
to cleanup the failed client, all the cleanup is skipped as
's->connected' is still false.

The only important thing that should be skipped in this case
is sending of the CHR_EVENT_CLOSED, because we never got as
far as sending the corresponding CHR_EVENT_OPENED. Every other
bit of cleanup can be robust against being called even when
s->connected is false.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20171005155057.7664-1-berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-10-12 12:10:37 +02:00
..
baum.c chardev/baum: fix baum that releases brlapi twice 2017-09-26 09:11:22 +03:00
char-console.c
char-fd.c
char-fe.c
char-file.c
char-io.c
char-mux.c
char-null.c
char-parallel.c
char-pipe.c
char-pty.c
char-ringbuf.c
char-serial.c
char-socket.c char: don't skip client cleanup if 'connected' flag is unset 2017-10-12 12:10:37 +02:00
char-stdio.c
char-udp.c
char-win-stdio.c
char-win.c
char.c
Makefile.objs
msmouse.c
spice.c
testdev.c
trace-events
wctablet.c