[Spice-devel] [RFC v4 36/62] server/red_channel: add pipe_size helpers

Alon Levy alevy at redhat.com
Tue Apr 26 03:55:01 PDT 2011


---
 server/red_channel.c |   15 +++++++++++++++
 server/red_channel.h |    4 ++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/server/red_channel.c b/server/red_channel.c
index 4625158..34916fd 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -1100,3 +1100,18 @@ void red_channel_pipes_new_add_tail(RedChannel *channel, new_pipe_item_t creator
                                      red_channel_client_pipe_add_tail_no_push);
     red_channel_push(channel);
 }
+
+uint32_t red_channel_max_pipe_size(RedChannel *channel)
+{
+    return channel->rcc ? channel->rcc->pipe_size : 0;
+}
+
+uint32_t red_channel_min_pipe_size(RedChannel *channel)
+{
+    return channel->rcc ? channel->rcc->pipe_size : 0;
+}
+
+uint32_t red_channel_sum_pipes_size(RedChannel *channel)
+{
+    return channel->rcc ? channel->rcc->pipe_size : 0;
+}
diff --git a/server/red_channel.h b/server/red_channel.h
index 261aa60..38043f1 100644
--- a/server/red_channel.h
+++ b/server/red_channel.h
@@ -367,6 +367,10 @@ RedClient *red_channel_client_get_client(RedChannelClient *rcc);
  * not via the below accessor and direct header manipulation. */
 SpiceDataHeader *red_channel_client_get_header(RedChannelClient *rcc);
 
+uint32_t red_channel_max_pipe_size(RedChannel *channel);
+uint32_t red_channel_min_pipe_size(RedChannel *channel);
+uint32_t red_channel_sum_pipes_size(RedChannel *channel);
+
 /* apply given function to all connected clients */
 typedef void (*channel_client_visitor)(RedChannelClient *rcc);
 typedef void (*channel_client_visitor_data)(RedChannelClient *rcc, void *data);
-- 
1.7.4.4



More information about the Spice-devel mailing list