Hi, I did not tested it as I see the discussion on IRC that you will also report an error in server in case file-xfer is disabled when we receive a file-xfer messages. Just a small comment bellow On Tue, Dec 20, 2016 at 08:39:31PM +0100, Pavel Grunt wrote: > It will be used to announce disabled caps to the client > > Related: rhbz#1373725 > --- > server/agent-msg-filter.c | 3 +++ > server/agent-msg-filter.h | 1 + > server/reds.c | 6 ++++++ > server/tests/test-agent-msg-filter.c | 8 ++++++-- > 4 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/server/agent-msg-filter.c b/server/agent-msg-filter.c > index 17f8e889..0791089d 100644 > --- a/server/agent-msg-filter.c > +++ b/server/agent-msg-filter.c > @@ -109,6 +109,9 @@ data_to_read: > filter->result = AGENT_MSG_FILTER_OK; > } > break; > + case VD_AGENT_ANNOUNCE_CAPABILITIES: > + filter->result = AGENT_MSG_FILTER_CAPABILITIES; > + break; > default: > filter->result = AGENT_MSG_FILTER_OK; > } > diff --git a/server/agent-msg-filter.h b/server/agent-msg-filter.h > index b4d8e720..d5636737 100644 > --- a/server/agent-msg-filter.h > +++ b/server/agent-msg-filter.h > @@ -30,6 +30,7 @@ typedef enum { > AGENT_MSG_FILTER_DISCARD, > AGENT_MSG_FILTER_PROTO_ERROR, > AGENT_MSG_FILTER_MONITORS_CONFIG, > + AGENT_MSG_FILTER_CAPABILITIES, > } AgentMsgFilterResult; > > typedef struct AgentMsgFilter { > diff --git a/server/reds.c b/server/reds.c > index 3b30928a..3127b188 100644 > --- a/server/reds.c > +++ b/server/reds.c > @@ -795,6 +795,8 @@ static RedPipeItem *vdi_port_read_one_msg_from_device(RedCharDevice *self, > dev->priv->read_state = VDI_PORT_READ_STATE_GET_BUFF; > } > switch (vdi_port_read_buf_process(reds->agent_dev, dispatch_buf)) { > + case AGENT_MSG_FILTER_CAPABILITIES: > + /* fall through */ > case AGENT_MSG_FILTER_OK: > return &dispatch_buf->base; > case AGENT_MSG_FILTER_PROTO_ERROR: > @@ -1108,6 +1110,8 @@ void reds_on_main_agent_data(RedsState *reds, MainChannelClient *mcc, void *mess > res = agent_msg_filter_process_data(&reds->agent_dev->priv->write_filter, > message, size); > switch (res) { > + case AGENT_MSG_FILTER_CAPABILITIES: > + /* fall through */ > case AGENT_MSG_FILTER_OK: > break; > case AGENT_MSG_FILTER_DISCARD: > @@ -1185,6 +1189,8 @@ void reds_on_main_channel_migrate(RedsState *reds, MainChannelClient *mcc) > > read_buf->len = read_data_len; > switch (vdi_port_read_buf_process(reds->agent_dev, read_buf)) { > + case AGENT_MSG_FILTER_CAPABILITIES: > + /* fall through */ > case AGENT_MSG_FILTER_OK: > main_channel_client_push_agent_data(mcc, > read_buf->data, > diff --git a/server/tests/test-agent-msg-filter.c b/server/tests/test-agent-msg-filter.c > index 2f5568a6..260c6409 100644 > --- a/server/tests/test-agent-msg-filter.c > +++ b/server/tests/test-agent-msg-filter.c > @@ -98,9 +98,10 @@ static void test_agent_msg_filter_run(void) > /* forward everything to the agent */ > agent_msg_filter_init(&filter, TRUE, TRUE, FALSE, FALSE); > for (type = VD_AGENT_MOUSE_STATE; type < VD_AGENT_END_MESSAGE; type++) { > + AgentMsgFilterResult result = (type != VD_AGENT_ANNOUNCE_CAPABILITIES) ? > + AGENT_MSG_FILTER_OK : AGENT_MSG_FILTER_CAPABILITIES; I would go for a real if instead > msg.msg_header.type = type; > - g_assert_cmpint(agent_msg_filter_process_data(&filter, msg.data, len), ==, > - AGENT_MSG_FILTER_OK); > + g_assert_cmpint(agent_msg_filter_process_data(&filter, msg.data, len), ==, result); > } > > /* filter everything */ > @@ -121,6 +122,9 @@ static void test_agent_msg_filter_run(void) > case VD_AGENT_MONITORS_CONFIG: > result = AGENT_MSG_FILTER_MONITORS_CONFIG; > break; > + case VD_AGENT_ANNOUNCE_CAPABILITIES: > + result = AGENT_MSG_FILTER_CAPABILITIES; > + break; > default: > result = AGENT_MSG_FILTER_OK; > }
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel