mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-12 19:18:11 +00:00
server/red_channel (tunnel): change sig of red_channel_handle_message
for later usage with red_worker
This commit is contained in:
parent
26dda37c27
commit
0512726b68
@ -387,15 +387,16 @@ void red_channel_init_outgoing_messages_window(RedChannel *channel)
|
||||
red_channel_push(channel);
|
||||
}
|
||||
|
||||
int red_channel_handle_message(RedChannel *channel, SpiceDataHeader *header, uint8_t *msg)
|
||||
int red_channel_handle_message(RedChannel *channel, uint32_t size,
|
||||
uint16_t type, void *message)
|
||||
{
|
||||
switch (header->type) {
|
||||
switch (type) {
|
||||
case SPICE_MSGC_ACK_SYNC:
|
||||
if (header->size != sizeof(uint32_t)) {
|
||||
if (size != sizeof(uint32_t)) {
|
||||
red_printf("bad message size");
|
||||
return FALSE;
|
||||
}
|
||||
channel->ack_data.client_generation = *(uint32_t *)(msg);
|
||||
channel->ack_data.client_generation = *(uint32_t *)(message);
|
||||
break;
|
||||
case SPICE_MSGC_ACK:
|
||||
if (channel->ack_data.client_generation == channel->ack_data.generation) {
|
||||
@ -404,7 +405,7 @@ int red_channel_handle_message(RedChannel *channel, SpiceDataHeader *header, uin
|
||||
}
|
||||
break;
|
||||
default:
|
||||
red_printf("invalid message type %u", header->type);
|
||||
red_printf("invalid message type %u", type);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@ -196,7 +196,9 @@ void red_channel_shutdown(RedChannel *channel);
|
||||
void red_channel_init_outgoing_messages_window(RedChannel *channel);
|
||||
|
||||
/* handles general channel msgs from the client */
|
||||
int red_channel_handle_message(RedChannel *channel, SpiceDataHeader *header, uint8_t *msg);
|
||||
int red_channel_handle_message(RedChannel *channel, uint32_t size,
|
||||
uint16_t type, void *message);
|
||||
|
||||
|
||||
/* when preparing send_data: should call reset, then init and then add_buf per buffer that is
|
||||
being sent */
|
||||
|
||||
@ -2247,7 +2247,7 @@ static int tunnel_channel_handle_message(RedChannel *channel, SpiceDataHeader *h
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return red_channel_handle_message(channel, header, msg);
|
||||
return red_channel_handle_message(channel, header->size, header->type, msg);
|
||||
}
|
||||
|
||||
switch (header->type) {
|
||||
@ -2325,7 +2325,7 @@ static int tunnel_channel_handle_message(RedChannel *channel, SpiceDataHeader *h
|
||||
}
|
||||
return tunnel_channel_handle_migrate_data(tunnel_channel, (TunnelMigrateData *)msg);
|
||||
default:
|
||||
return red_channel_handle_message(channel, header, msg);
|
||||
return red_channel_handle_message(channel, header->size, header->type, msg);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user