server/reds: fix reds_main_channel_connected

instead of checking just for reds->main_channel check that there is at least
one client as well.
This commit is contained in:
Alon Levy 2011-08-23 14:00:11 +03:00
parent 0410cccde3
commit f15cac7d7d
3 changed files with 7 additions and 1 deletions

View File

@ -155,6 +155,11 @@ enum NetTestStage {
NET_TEST_STAGE_RATE,
};
int main_channel_is_connected(MainChannel *main_chan)
{
return red_channel_is_connected(&main_chan->base);
}
// when disconnection occurs, let reds shutdown all channels. This will trigger the
// real disconnection of main channel
static void main_channel_client_on_disconnect(RedChannelClient *rcc)

View File

@ -80,6 +80,7 @@ uint32_t main_channel_client_get_link_id(MainChannelClient *mcc);
int main_channel_client_is_low_bandwidth(MainChannelClient *mcc);
uint64_t main_channel_client_get_bitrate_per_sec(MainChannelClient *mcc);
int main_channel_is_connected(MainChannel *main_chan);
// TODO: Defines used to calculate receive buffer size, and also by reds.c
// other options: is to make a reds_main_consts.h, to duplicate defines.

View File

@ -601,7 +601,7 @@ static void reds_reset_vdp()
static int reds_main_channel_connected(void)
{
return !!reds->main_channel;
return main_channel_is_connected(reds->main_channel);
}
void reds_client_disconnect(RedClient *client)