summaryrefslogtreecommitdiffstats
path: root/server/red_channel.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-11-04 17:20:24 +0200
committerAlon Levy <alevy@redhat.com>2011-02-07 19:21:21 +0200
commit7dfd7a0c779da2df2c90ea59a9defb313779aaca (patch)
tree425f3ae05f62a76ce7d8444162646dbc731dc69f /server/red_channel.h
parente571b5ebbb5f60d264f2d2eab8ec34d389fd3752 (diff)
downloadspice-7dfd7a0c779da2df2c90ea59a9defb313779aaca.tar.gz
spice-7dfd7a0c779da2df2c90ea59a9defb313779aaca.tar.xz
spice-7dfd7a0c779da2df2c90ea59a9defb313779aaca.zip
server/red_channel: add hold_item (from red_worker)
hold_item called on init_send_data, matching release. This is not the behavior of red_worker - we ref++ (==hold_item) when sending the item, and --refs when releasing it, instead of only holding if the send is blocked. Note 1: Naming: hold_pipe_item is the proc name, the variable is called hold_item, this is similar to release_item/release_pipe_item naming. Note 2: All channels have empty implementation, we later use this when red_worker get's RedChannelized.
Diffstat (limited to 'server/red_channel.h')
-rw-r--r--server/red_channel.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/red_channel.h b/server/red_channel.h
index e8ebb053..a778ffbe 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -107,6 +107,7 @@ typedef void (*channel_release_msg_recv_buf_proc)(RedChannel *channel,
typedef void (*channel_disconnect_proc)(RedChannel *channel);
typedef int (*channel_configure_socket_proc)(RedChannel *channel);
typedef void (*channel_send_pipe_item_proc)(RedChannel *channel, PipeItem *item);
+typedef void (*channel_hold_pipe_item_proc)(PipeItem *item);
typedef void (*channel_release_pipe_item_proc)(RedChannel *channel,
PipeItem *item, int item_pushed);
typedef void (*channel_on_incoming_error_proc)(RedChannel *channel);
@@ -145,6 +146,7 @@ struct RedChannel {
channel_disconnect_proc disconnect;
channel_send_pipe_item_proc send_item;
+ channel_hold_pipe_item_proc hold_item;
channel_release_pipe_item_proc release_item;
int during_send;
@@ -165,6 +167,7 @@ RedChannel *red_channel_create(int size, RedsStreamContext *peer,
channel_handle_message_proc handle_message,
channel_alloc_msg_recv_buf_proc alloc_recv_buf,
channel_release_msg_recv_buf_proc release_recv_buf,
+ channel_hold_pipe_item_proc hold_item,
channel_send_pipe_item_proc send_item,
channel_release_pipe_item_proc release_item);
@@ -178,6 +181,7 @@ RedChannel *red_channel_create_parser(int size, RedsStreamContext *peer,
channel_handle_parsed_proc handle_parsed,
channel_alloc_msg_recv_buf_proc alloc_recv_buf,
channel_release_msg_recv_buf_proc release_recv_buf,
+ channel_hold_pipe_item_proc hold_item,
channel_send_pipe_item_proc send_item,
channel_release_pipe_item_proc release_item,
channel_on_incoming_error_proc incoming_error,