summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-02-20 17:00:53 +0100
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-02-23 23:00:47 +0100
commit69717b01851b1e0c5b06db860c6f1c7e254a116a (patch)
tree2f1c29f091a4e0fef7bff7f1dcef5069521f9f54
parentb0d83c33d16462aabf858a7e011698989ecd11b6 (diff)
downloadspice-69717b01851b1e0c5b06db860c6f1c7e254a116a.tar.gz
spice-69717b01851b1e0c5b06db860c6f1c7e254a116a.tar.xz
spice-69717b01851b1e0c5b06db860c6f1c7e254a116a.zip
Remove redundant argument to vdi_port_read_buf_process
The 'port' argument can be determined from VDIPortState, so no need to pass both (through RedsState) to vdi_port_read_buf_process().
-rw-r--r--server/reds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/reds.c b/server/reds.c
index 24562eef..d6e1b212 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -581,12 +581,12 @@ static void vdi_port_read_buf_release(uint8_t *data, void *opaque)
}
/* returns TRUE if the buffer can be forwarded */
-static int vdi_port_read_buf_process(RedsState *reds, int port, VDIReadBuf *buf)
+static int vdi_port_read_buf_process(RedsState *reds, VDIReadBuf *buf)
{
VDIPortState *state = &reds->agent_state;
int res;
- switch (port) {
+ switch (state->vdi_chunk_header.port) {
case VDP_CLIENT_PORT: {
res = agent_msg_filter_process_data(&state->read_filter,
buf->data, buf->len);
@@ -707,7 +707,7 @@ static SpiceCharDeviceMsgToClient *vdi_port_read_one_msg_from_device(SpiceCharDe
} else {
state->read_state = VDI_PORT_READ_STATE_GET_BUFF;
}
- if (vdi_port_read_buf_process(reds, state->vdi_chunk_header.port, dispatch_buf)) {
+ if (vdi_port_read_buf_process(reds, dispatch_buf)) {
return dispatch_buf;
} else {
vdi_port_read_buf_unref(dispatch_buf);
@@ -1076,7 +1076,7 @@ void reds_on_main_channel_migrate(RedsState *reds, MainChannelClient *mcc)
!agent_state->read_filter.msg_data_to_read);
read_buf->len = read_data_len;
- if (vdi_port_read_buf_process(reds, agent_state->vdi_chunk_header.port, read_buf)) {
+ if (vdi_port_read_buf_process(reds, read_buf)) {
main_channel_client_push_agent_data(mcc,
read_buf->data,
read_buf->len,