spice/server
Hans de Goede f8e6dc78c7 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-04 11:22:24 +02:00
..
tests server/tests: add test_playback 2011-03-22 09:44:52 +02: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:28:21 +01:00
agent-msg-filter.h spice-server: Add the ability to filter agent messages 2011-03-24 17:28:21 +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
inputs_channel.c server/input: avoid double free() of RedChannel on disconnect 2011-03-03 14:59:31 +01:00
inputs_channel.h server/inputs_channel: remove unused declaration in inputs_channel.h 2010-12-07 21:32:34 +02:00
jpeg_encoder.c client/server: warning fixes (gcc 4.6.0) 2011-01-25 17:22:48 +02:00
jpeg_encoder.h JPEG support: introducing jpeg encoding for spice bitmaps 2010-06-09 11:40:25 +02:00
main_channel.c server/red_channel: add red_channel_get_first_socket 2011-03-02 17:27:52 +02:00
main_channel.h server: split main_channel from reds 2011-01-13 06:56:51 +02:00
Makefile.am spice-server: Add the ability to filter agent messages 2011-03-24 17:28:21 +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 Revert "server/red_channel: red_channel_event: push on blocked" 2011-03-03 14:59:31 +01:00
red_channel.h server/red_channel: move out_bytes_counter from Outgoing to RedChannel 2011-03-02 17:27:53 +02:00
red_client_cache.h server/red_worker: use red_channel_pipe_item_init 2011-03-02 17:27:53 +02:00
red_client_shared_cache.h server: use red_channel_get_message_serial 2011-03-02 17:27:51 +02:00
red_common.h server/common: introduce common/spice_common.h 2011-03-02 17:27:51 +02:00
red_dispatcher.c server: rename s/peer/stream 2011-02-28 16:36:35 +01: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-25 17:22:48 +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 server/red_channel (+): remove red_channel_add_buf 2011-03-02 17:27:52 +02:00
red_tunnel_worker.h add spice-experimental.h 2010-05-19 11:22:08 +02:00
red_worker.c server/red_worker: use red_channel_pipe_item_init 2011-03-02 17:27:53 +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-04 11:22:24 +02:00
reds.h server: add SASL support 2011-02-28 16:36:35 +01:00
smartcard.c server/red_channel (+): remove red_channel_add_buf 2011-03-02 17:27:52 +02:00
smartcard.h smartcard: server side (not enabled yet) 2010-12-07 13:31:42 +02:00
snd_worker.c server: add reds_channel_dispose() 2011-02-28 16:36:35 +01: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:16:10 +01:00
spice.h server: Make copy paste support configurable 2011-03-24 17:30:03 +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