spice/server
Hans de Goede ef6886732e server: Don't reset agent state when the client disconnects
We were calling reds_reset_vdp on client disconnect, which is not a good
idea. reds_reset_vdp does 3 things:

1) It resets the state related to reading chunks from the spicevmc virtio
   port. If the client disconnects while the guest agent is in the middle
   of sending a chunk, this will lead to an inconsistent state, and lots
   of printing of "dispatch_vdi_port_data: invalid port" messages caused
   by this inconsistent state sometimes followed by a segfault.

   This can be triggered by copy and pasting something large (say
   a screenshot) from the guest to the spice-gtk client, as the spice-gtk
   client currently has a bug causing it to crash when receiving a multi
   chunk vdagent messages. Without this patch (and with the spice-gtk bug
   present) I can consistently reproduce this.

2) It clears any buffered writes from the client to the guest still pending
   because the virtio port cannot consume data fast enough. Since the agent
   itself is still running fine, throwing away writes for it because the
   client has disconnected makes no sense. Esp, since on clean exit the
   client may very well send a clipboard release message directly
   before closing the connection, and this may get lost this way.

3) It sets client_agent_started to false, this is the only thing which
   actually makes sense to do on client disconnect.

Note that since we no longer reset the vdp state on client disconnect, we
must now reset it on agent disconnect even if we don't have a client. So
the reds_reset_vdp call in reds_agent_remove() gets moved to the top,
above both the agent_state.connected and reds->peer checks which will
both fail in the no client case.
2011-04-01 11:13:46 +02:00
..
tests Makefiles: fix server/tests/test_util.h not being included in make dist 2010-12-17 14:14:45 +01:00
.gitignore gitignore: add generated_*, vim temps, pyc 2010-11-08 16:06:55 +02:00
agent-msg-filter.c spice-server: Add the ability to filter agent messages 2011-03-24 17:24:31 +01:00
agent-msg-filter.h spice-server: Add the ability to filter agent messages 2011-03-24 17:24:31 +01:00
char_device.h server: add char_device.h header, use in reds.c 2010-12-06 18:09:14 +02:00
demarshallers.h Add destructor for demarshalled messages 2010-06-22 10:53:24 +02:00
glz_encode_match_tmpl.c Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_encode_tmpl.c Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_encoder_config.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
glz_encoder_dictionary_protected.h Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_encoder_dictionary.c Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_encoder_dictionary.h Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_encoder.c Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
glz_encoder.h Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
jpeg_encoder.c client/server: warning fixes (gcc 4.6.0) 2011-01-27 12:48:25 +02:00
jpeg_encoder.h JPEG support: introducing jpeg encoding for spice bitmaps 2010-06-09 11:40:25 +02:00
Makefile.am spice-server: Add the ability to filter agent messages 2011-03-24 17:24:31 +01:00
mjpeg_encoder.c Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
mjpeg_encoder.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
red_bitmap_utils.h Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
red_channel.c Fix various misspellings 2010-07-08 18:26:37 +02:00
red_channel.h Fix various misspellings 2010-07-08 18:26:37 +02:00
red_client_cache.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
red_client_shared_cache.h support for lossy images in the pixmap cache and fill bits 2010-06-09 11:41:01 +02:00
red_common.h Make all message structs internal to spice 2010-06-18 20:27:32 +02:00
red_dispatcher.c server: enabling/disabling jpeg and zlib-over-glz via spice command line args 2010-07-14 12:16:23 +03:00
red_dispatcher.h QXL: redesign. 2010-05-19 11:22:06 +02:00
red_memslots.c improve memory slot error logging. 2010-06-29 12:30:19 +02:00
red_memslots.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
red_parse_qxl.c client/server: warning fixes (gcc 4.6.0) 2011-01-27 12:48:25 +02:00
red_parse_qxl.h move command flags handling to the qxl parser 2010-09-14 10:41:49 +02:00
red_tunnel_worker.c codegen: Various cleanups 2010-07-19 16:28:22 +02:00
red_tunnel_worker.h add spice-experimental.h 2010-05-19 11:22:08 +02:00
red_worker.c server/red_worker: fix used but uninitialized warning (gcc 4.6.0) 2011-02-07 18:51:50 +02:00
red_worker.h server: enabling/disabling jpeg and zlib-over-glz via spice command line args 2010-07-14 12:16:23 +03:00
reds.c server: Don't reset agent state when the client disconnects 2011-04-01 11:13:46 +02:00
reds.h server: add channel notifications. 2010-10-12 11:11:26 +02:00
smartcard.c server/smartcard: don't push our own error on reader add 2011-02-10 10:34:53 +02:00
smartcard.h smartcard: server side (not enabled yet) 2010-12-07 13:31:42 +02:00
snd_worker.c Add destructor for demarshalled messages 2010-06-22 10:53:24 +02:00
snd_worker.h zap vd_interface.h 2010-05-19 11:22:07 +02:00
spice-experimental.h move chardevs out of experimental 2010-12-16 09:17:42 +01:00
spice.h server: Make copy paste support configurable 2011-03-24 17:24:31 +01:00
stat.h Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
zlib_encoder.c applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00
zlib_encoder.h applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00