[Spice-devel] [PATCH 0.8 5/9] server: filter all data from client
Hans de Goede
hdegoede at redhat.com
Fri Apr 1 08:13:05 PDT 2011
Filter all data from client, even when there is no agent connected
to keep filter state correct.
---
server/reds.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/server/reds.c b/server/reds.c
index 3c7077a..7a3399e 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1710,17 +1710,6 @@ static void reds_main_handle_message(void *opaque, size_t size, uint32_t type, v
}
--reds->agent_state.num_client_tokens;
- if (!vdagent) {
- add_token();
- break;
- }
-
- if (!reds->agent_state.client_agent_started) {
- red_printf("SPICE_MSGC_MAIN_AGENT_DATA race");
- add_token();
- break;
- }
-
res = agent_msg_filter_process_data(&reds->agent_state.write_filter,
message, size);
switch (res) {
@@ -1734,6 +1723,17 @@ static void reds_main_handle_message(void *opaque, size_t size, uint32_t type, v
return;
}
+ if (!vdagent) {
+ add_token();
+ break;
+ }
+
+ if (!reds->agent_state.client_agent_started) {
+ red_printf("SPICE_MSGC_MAIN_AGENT_DATA race");
+ add_token();
+ break;
+ }
+
if (!(ring_item = ring_get_head(&reds->agent_state.external_bufs))) {
red_printf("no agent free bufs");
reds_disconnect();
--
1.7.4.2
More information about the Spice-devel
mailing list