mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-08 22:10:46 +00:00
Move agent_file_xfer to RedsState struct
Removing more global variables Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
fe4db36783
commit
9c512617cb
@ -219,6 +219,7 @@ struct RedsState {
|
||||
spice_wan_compression_t jpeg_state;
|
||||
|
||||
gboolean agent_copypaste;
|
||||
gboolean agent_file_xfer;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -149,7 +149,6 @@ static long *lock_count;
|
||||
uint32_t streaming_video = SPICE_STREAM_VIDEO_FILTER;
|
||||
spice_wan_compression_t zlib_glz_state = SPICE_WAN_COMPRESSION_AUTO;
|
||||
int agent_mouse = TRUE;
|
||||
int agent_file_xfer = TRUE;
|
||||
static bool exit_on_disconnect = FALSE;
|
||||
|
||||
RedsState *reds = NULL;
|
||||
@ -417,7 +416,7 @@ static void reds_reset_vdp(RedsState *reds)
|
||||
}
|
||||
/* Reset read filter to start with clean state when the agent reconnects */
|
||||
agent_msg_filter_init(&state->read_filter, reds->agent_copypaste,
|
||||
agent_file_xfer, TRUE);
|
||||
reds->agent_file_xfer, TRUE);
|
||||
/* Throw away pending chunks from the current (if any) and future
|
||||
* messages written by the client.
|
||||
* TODO: client should clear its agent messages queue when the agent
|
||||
@ -531,7 +530,7 @@ void reds_client_disconnect(RedsState *reds, RedClient *client)
|
||||
|
||||
/* Reset write filter to start with clean state on client reconnect */
|
||||
agent_msg_filter_init(&reds->agent_state.write_filter, reds->agent_copypaste,
|
||||
agent_file_xfer, TRUE);
|
||||
reds->agent_file_xfer, TRUE);
|
||||
|
||||
/* Throw away pending chunks from the current (if any) and future
|
||||
* messages read from the agent */
|
||||
@ -3298,9 +3297,9 @@ static void reds_init_vd_agent_resources(RedsState *reds)
|
||||
|
||||
ring_init(&state->read_bufs);
|
||||
agent_msg_filter_init(&state->write_filter, reds->agent_copypaste,
|
||||
agent_file_xfer, TRUE);
|
||||
reds->agent_file_xfer, TRUE);
|
||||
agent_msg_filter_init(&state->read_filter, reds->agent_copypaste,
|
||||
agent_file_xfer, TRUE);
|
||||
reds->agent_file_xfer, TRUE);
|
||||
|
||||
state->read_state = VDI_PORT_READ_STATE_READ_HEADER;
|
||||
state->receive_pos = (uint8_t *)&state->vdi_chunk_header;
|
||||
@ -3429,6 +3428,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
|
||||
reds->image_compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
|
||||
reds->jpeg_state = SPICE_WAN_COMPRESSION_AUTO;
|
||||
reds->agent_copypaste = TRUE;
|
||||
reds->agent_file_xfer = TRUE;
|
||||
return reds;
|
||||
}
|
||||
|
||||
@ -3819,9 +3819,9 @@ SPICE_GNUC_VISIBLE int spice_server_set_agent_copypaste(SpiceServer *s, int enab
|
||||
SPICE_GNUC_VISIBLE int spice_server_set_agent_file_xfer(SpiceServer *s, int enable)
|
||||
{
|
||||
spice_assert(reds == s);
|
||||
agent_file_xfer = enable;
|
||||
reds->agent_state.write_filter.file_xfer_enabled = agent_file_xfer;
|
||||
reds->agent_state.read_filter.file_xfer_enabled = agent_file_xfer;
|
||||
s->agent_file_xfer = enable;
|
||||
reds->agent_state.write_filter.file_xfer_enabled = s->agent_file_xfer;
|
||||
reds->agent_state.read_filter.file_xfer_enabled = s->agent_file_xfer;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user