diff options
author | Yonit Halperin <yhalperi@redhat.com> | 2011-10-05 09:05:13 +0200 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2011-11-02 11:19:48 +0200 |
commit | 0bf518cd3daad526a16468e82c1d6c715535e9ba (patch) | |
tree | 937b1d33c82d86a5ac391335069e3115d6a40bef /server/main_channel.c | |
parent | bd8771adbcf3ff34d14333cf874191e8d105f612 (diff) | |
download | spice-0bf518cd3daad526a16468e82c1d6c715535e9ba.tar.gz spice-0bf518cd3daad526a16468e82c1d6c715535e9ba.tar.xz spice-0bf518cd3daad526a16468e82c1d6c715535e9ba.zip |
server: set & test channel capabilities in red_channel
The code for setting and testing channel capabilities was
unnecessarily duplicated. Now it is in red_channel.
RedsChannel was dropped from Reds; It was used only for holding
the channels common capabilities, which are now held in RedChannel.
Diffstat (limited to 'server/main_channel.c')
-rw-r--r-- | server/main_channel.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/server/main_channel.c b/server/main_channel.c index 43c0f3f2..49028b3f 100644 --- a/server/main_channel.c +++ b/server/main_channel.c @@ -39,17 +39,13 @@ #include "server/demarshallers.h" #include "common/ring.h" #include "common/messages.h" -#include "reds.h" #include "main_channel.h" +#include "reds.h" #include "red_channel.h" #include "generated_marshallers.h" #define ZERO_BUF_SIZE 4096 -// approximate max receive message size for main channel -#define RECEIVE_BUF_SIZE \ - (4096 + (REDS_AGENT_WINDOW_SIZE + REDS_NUM_INTERNAL_AGENT_MESSAGES) * SPICE_AGENT_MAX_DATA_SIZE) - #define REDS_MAX_SEND_IOVEC 100 #define NET_TEST_WARMUP_BYTES 0 @@ -143,11 +139,6 @@ struct MainChannelClient { #endif }; -struct MainChannel { - RedChannel base; - uint8_t recv_buf[RECEIVE_BUF_SIZE]; -}; - enum NetTestStage { NET_TEST_STAGE_INVALID, NET_TEST_STAGE_WARMUP, @@ -911,12 +902,18 @@ uint32_t main_channel_client_get_link_id(MainChannelClient *mcc) return mcc->connection_id; } -MainChannelClient *main_channel_client_create(MainChannel *main_chan, RedClient *client, - RedsStream *stream, uint32_t connection_id) +static MainChannelClient *main_channel_client_create(MainChannel *main_chan, RedClient *client, + RedsStream *stream, uint32_t connection_id, + int num_common_caps, uint32_t *common_caps, + int num_caps, uint32_t *caps) { MainChannelClient *mcc = (MainChannelClient*)red_channel_client_create(sizeof(MainChannelClient), &main_chan->base, - client, stream); + client, stream, + num_common_caps, + common_caps, + num_caps, + caps); mcc->connection_id = connection_id; mcc->bitrate_per_sec = ~0; @@ -942,7 +939,9 @@ MainChannelClient *main_channel_link(MainChannel *channel, RedClient *client, // into usage somewhere (not an issue until we return migration to it's // former glory) red_printf("add main channel client"); - mcc = main_channel_client_create(channel, client, stream, connection_id); + mcc = main_channel_client_create(channel, client, stream, connection_id, + num_common_caps, common_caps, + num_caps, caps); return mcc; } |