[Spice-commits] 3 commits - server/reds.c server/reds-private.h
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Feb 3 07:07:41 PST 2016
server/reds-private.h | 4 ++++
server/reds.c | 38 +++++++++++++++++++-------------------
2 files changed, 23 insertions(+), 19 deletions(-)
New commits:
commit ffd2cda51ec426ef82ffccee30d44866972a7ee4
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Tue Jan 27 14:23:38 2015 -0600
Move exit_on_disconnect to RedsState struct
Removing more global variables
Acked-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/reds-private.h b/server/reds-private.h
index 8cce70d..197c89c 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -220,6 +220,7 @@ struct RedsState {
gboolean agent_copypaste;
gboolean agent_file_xfer;
+ gboolean exit_on_disconnect;
};
#endif
diff --git a/server/reds.c b/server/reds.c
index 19af841..73df8e4 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -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;
-static bool exit_on_disconnect = FALSE;
RedsState *reds = NULL;
@@ -461,7 +460,7 @@ void reds_client_disconnect(RedsState *reds, RedClient *client)
{
RedsMigTargetClient *mig_client;
- if (exit_on_disconnect)
+ if (reds->exit_on_disconnect)
{
spice_info("Exiting server because of client disconnect.\n");
exit(0);
@@ -3429,6 +3428,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
reds->jpeg_state = SPICE_WAN_COMPRESSION_AUTO;
reds->agent_copypaste = TRUE;
reds->agent_file_xfer = TRUE;
+ reds->exit_on_disconnect = FALSE;
return reds;
}
@@ -3543,7 +3543,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_listen_socket_fd(SpiceServer *s, int lis
SPICE_GNUC_VISIBLE int spice_server_set_exit_on_disconnect(SpiceServer *s, int flag)
{
spice_assert(reds == s);
- exit_on_disconnect = !!flag;
+ s->exit_on_disconnect = !!flag;
return 0;
}
commit 9c512617cbd53e1cbdc676b81d4605be856b2499
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Tue Jan 27 14:22:29 2015 -0600
Move agent_file_xfer to RedsState struct
Removing more global variables
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/reds-private.h b/server/reds-private.h
index 0f24236..8cce70d 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -219,6 +219,7 @@ struct RedsState {
spice_wan_compression_t jpeg_state;
gboolean agent_copypaste;
+ gboolean agent_file_xfer;
};
#endif
diff --git a/server/reds.c b/server/reds.c
index 31ddae5..19af841 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -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;
}
commit fe4db367830548190eae0988ca86ea0cc608d6d7
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Tue Jan 27 14:21:33 2015 -0600
Move agent_copypaste to RedsState struct
Removing more global variables
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/reds-private.h b/server/reds-private.h
index e9a5e65..0f24236 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -217,6 +217,8 @@ struct RedsState {
gboolean ticketing_enabled;
SpiceImageCompression image_compression;
spice_wan_compression_t jpeg_state;
+
+ gboolean agent_copypaste;
};
#endif
diff --git a/server/reds.c b/server/reds.c
index 6076575..31ddae5 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -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_copypaste = TRUE;
int agent_file_xfer = TRUE;
static bool exit_on_disconnect = FALSE;
@@ -417,7 +416,7 @@ static void reds_reset_vdp(RedsState *reds)
state->current_read_buf = NULL;
}
/* Reset read filter to start with clean state when the agent reconnects */
- agent_msg_filter_init(&state->read_filter, agent_copypaste,
+ agent_msg_filter_init(&state->read_filter, reds->agent_copypaste,
agent_file_xfer, TRUE);
/* Throw away pending chunks from the current (if any) and future
* messages written by the client.
@@ -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, agent_copypaste,
+ agent_msg_filter_init(&reds->agent_state.write_filter, reds->agent_copypaste,
agent_file_xfer, TRUE);
/* Throw away pending chunks from the current (if any) and future
@@ -3298,9 +3297,9 @@ static void reds_init_vd_agent_resources(RedsState *reds)
int i;
ring_init(&state->read_bufs);
- agent_msg_filter_init(&state->write_filter, agent_copypaste,
+ agent_msg_filter_init(&state->write_filter, reds->agent_copypaste,
agent_file_xfer, TRUE);
- agent_msg_filter_init(&state->read_filter, agent_copypaste,
+ agent_msg_filter_init(&state->read_filter, reds->agent_copypaste,
agent_file_xfer, TRUE);
state->read_state = VDI_PORT_READ_STATE_READ_HEADER;
@@ -3429,6 +3428,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
reds->ticketing_enabled = TRUE; /* ticketing enabled by default */
reds->image_compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
reds->jpeg_state = SPICE_WAN_COMPRESSION_AUTO;
+ reds->agent_copypaste = TRUE;
return reds;
}
@@ -3810,9 +3810,9 @@ SPICE_GNUC_VISIBLE int spice_server_set_agent_mouse(SpiceServer *s, int enable)
SPICE_GNUC_VISIBLE int spice_server_set_agent_copypaste(SpiceServer *s, int enable)
{
spice_assert(reds == s);
- agent_copypaste = enable;
- reds->agent_state.write_filter.copy_paste_enabled = agent_copypaste;
- reds->agent_state.read_filter.copy_paste_enabled = agent_copypaste;
+ s->agent_copypaste = enable;
+ reds->agent_state.write_filter.copy_paste_enabled = s->agent_copypaste;
+ reds->agent_state.read_filter.copy_paste_enabled = s->agent_copypaste;
return 0;
}
More information about the Spice-commits
mailing list