mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-08-07 12:36:46 +00:00
server/red_channel: add red_channel_{,no_}item_being_sent
This commit is contained in:
parent
17ebd6a719
commit
5575d6e5fa
@ -727,6 +727,12 @@ RedsStream *red_channel_get_stream(RedChannel *channel)
|
||||
return channel->stream;
|
||||
}
|
||||
|
||||
SpiceDataHeader *red_channel_get_header(RedChannel *channel)
|
||||
{
|
||||
return channel->send_data.header;
|
||||
}
|
||||
/* end of accessors */
|
||||
|
||||
int red_channel_get_first_socket(RedChannel *channel)
|
||||
{
|
||||
if (!channel->stream) {
|
||||
@ -735,7 +741,12 @@ int red_channel_get_first_socket(RedChannel *channel)
|
||||
return channel->stream->socket;
|
||||
}
|
||||
|
||||
SpiceDataHeader *red_channel_get_header(RedChannel *channel)
|
||||
int red_channel_item_being_sent(RedChannel *channel, PipeItem *item)
|
||||
{
|
||||
return channel->send_data.header;
|
||||
return channel->send_data.item == item;
|
||||
}
|
||||
|
||||
int red_channel_no_item_being_sent(RedChannel *channel)
|
||||
{
|
||||
return channel->send_data.item == NULL;
|
||||
}
|
||||
|
||||
@ -260,6 +260,14 @@ int red_channel_any_blocked(RedChannel *channel);
|
||||
/* helper for channels that have complex logic that can possibly ready a send */
|
||||
int red_channel_send_message_pending(RedChannel *channel);
|
||||
|
||||
/* returns TRUE if item is being sent by one of the channel clients. This will
|
||||
* be true if someone called init_send_data but send has not completed (or perhaps
|
||||
* hasn't even begun, i.e. no one called begin_send_)
|
||||
* */
|
||||
int red_channel_item_being_sent(RedChannel *channel, PipeItem *item);
|
||||
|
||||
int red_channel_no_item_being_sent(RedChannel *channel);
|
||||
|
||||
// TODO: unstaticed for display/cursor channels. they do some specific pushes not through
|
||||
// adding elements or on events. but not sure if this is actually required (only result
|
||||
// should be that they ""try"" a little harder, but if the event system is correct it
|
||||
|
||||
@ -9436,7 +9436,7 @@ static void red_wait_pipe_item_sent(RedChannel *channel, PipeItem *item)
|
||||
red_printf("timeout");
|
||||
channel->disconnect(channel);
|
||||
} else {
|
||||
if (channel->send_data.item == item) {
|
||||
if (red_channel_item_being_sent(channel, item)) {
|
||||
red_wait_outgoing_item(channel);
|
||||
}
|
||||
}
|
||||
@ -9522,7 +9522,7 @@ static inline void destroy_surface_wait(RedWorker *worker, int surface_id)
|
||||
// there is one during sending.
|
||||
red_wait_outgoing_item((RedChannel *)worker->display_channel);
|
||||
if (worker->display_channel) {
|
||||
ASSERT(!worker->display_channel->common.base.send_data.item);
|
||||
ASSERT(red_channel_no_item_being_sent(&worker->display_channel->common.base));
|
||||
}
|
||||
}
|
||||
|
||||
@ -9570,7 +9570,7 @@ static inline void handle_dev_destroy_surfaces(RedWorker *worker)
|
||||
if (!worker->cursor_channel->common.base.migrate) {
|
||||
red_pipe_add_verb(&worker->cursor_channel->common.base, SPICE_MSG_CURSOR_RESET);
|
||||
}
|
||||
ASSERT(!worker->cursor_channel->common.base.send_data.item);
|
||||
ASSERT(red_channel_no_item_being_sent(&worker->cursor_channel->common.base));
|
||||
}
|
||||
|
||||
if (worker->display_channel) {
|
||||
@ -9646,7 +9646,7 @@ static inline void handle_dev_destroy_primary_surface(RedWorker *worker)
|
||||
if (!worker->cursor_channel->common.base.migrate) {
|
||||
red_pipe_add_verb(&worker->cursor_channel->common.base, SPICE_MSG_CURSOR_RESET);
|
||||
}
|
||||
ASSERT(!worker->cursor_channel->common.base.send_data.item);
|
||||
ASSERT(red_channel_no_item_being_sent(&worker->cursor_channel->common.base));
|
||||
}
|
||||
|
||||
flush_all_qxl_commands(worker);
|
||||
@ -9708,7 +9708,7 @@ static void handle_dev_input(EventListener *listener, uint32_t events)
|
||||
if (!cursor_red_channel->migrate) {
|
||||
red_pipe_add_verb(cursor_red_channel, SPICE_MSG_CURSOR_RESET);
|
||||
}
|
||||
ASSERT(!cursor_red_channel->send_data.item);
|
||||
ASSERT(red_channel_no_item_being_sent(cursor_red_channel));
|
||||
|
||||
worker->cursor_visible = TRUE;
|
||||
worker->cursor_position.x = worker->cursor_position.y = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user