xemu/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 chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-fd.c chardev: remove context in chr_update_read_handler 2017-09-22 21:07:27 +02:00
char-fe.c chardev: new qemu_chr_be_update_read_handlers() 2017-09-22 21:07:27 +02:00
char-file.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-io.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-mux.c char: add backend hotswap handler 2017-07-14 11:04:33 +02:00
char-null.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-parallel.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-pipe.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-pty.c chardev: remove context in chr_update_read_handler 2017-09-22 21:07:27 +02:00
char-ringbuf.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-serial.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
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 chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-udp.c chardev: remove context in chr_update_read_handler 2017-09-22 21:07:27 +02:00
char-win-stdio.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char-win.c chardev: move headers to include/chardev 2017-06-02 11:33:52 +04:00
char.c chardev: remove context in chr_update_read_handler 2017-09-22 21:07:27 +02:00
Makefile.objs buildsys: Move brlapi libs to per object 2017-09-22 10:20:34 +08:00
msmouse.c char: move char devices to chardev/ 2017-06-02 11:33:53 +04:00
spice.c char: move char devices to chardev/ 2017-06-02 11:33:53 +04:00
testdev.c char: move char devices to chardev/ 2017-06-02 11:33:53 +04:00
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00
wctablet.c char: move char devices to chardev/ 2017-06-02 11:33:53 +04:00