Cleanup definitions of disconnect methods

We had multiple stub methods that simply called other disconnect
methods, making my head hurt with the indirection. Call the right
methods at the right time and rip out the stub methods; if they are
truely needed later they can be added again.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
This commit is contained in:
Dan McGee 2012-02-16 23:30:09 -06:00 committed by Alon Levy
parent a67268cbe1
commit 10d79a35c1
2 changed files with 5 additions and 23 deletions

View File

@ -1201,8 +1201,6 @@ void red_channel_client_disconnect(RedChannelClient *rcc)
reds_stream_free(rcc->stream);
rcc->stream = NULL;
red_channel_remove_client(rcc);
// TODO: not do it till destroyed?
// red_channel_client_remove(rcc);
rcc->channel->channel_cbs.on_disconnect(rcc);
}

View File

@ -8721,17 +8721,6 @@ void red_show_tree(RedWorker *worker)
}
}
// TODO: move to red_channel
static void red_disconnect_channel(RedChannel *channel)
{
red_channel_disconnect(channel);
}
static void display_channel_client_disconnect(RedChannelClient *rcc)
{
red_channel_client_disconnect(rcc);
}
static void display_channel_client_on_disconnect(RedChannelClient *rcc)
{
DisplayChannel *display_channel;
@ -8775,7 +8764,7 @@ void red_disconnect_all_display_TODO_remove_me(RedChannel *channel)
if (!channel) {
return;
}
red_channel_apply_clients(channel, display_channel_client_disconnect);
red_channel_apply_clients(channel, red_channel_client_disconnect);
}
static void red_migrate_display(RedWorker *worker, RedChannelClient *rcc)
@ -9132,7 +9121,7 @@ static int display_channel_client_wait_for_init(DisplayChannelClient *dcc)
}
if (red_now() > end_time) {
red_printf("timeout");
display_channel_client_disconnect(&dcc->common.base);
red_channel_client_disconnect(&dcc->common.base);
break;
}
usleep(DISPLAY_CLIENT_RETRY_INTERVAL);
@ -9944,11 +9933,6 @@ error:
red_channel_client_destroy(&dcc->common.base);
}
static void cursor_channel_client_disconnect(RedChannelClient *rcc)
{
red_channel_client_disconnect(rcc);
}
static void cursor_channel_client_on_disconnect(RedChannelClient *rcc)
{
if (!rcc) {
@ -9968,7 +9952,7 @@ static void red_disconnect_cursor(RedChannel *channel)
ASSERT(channel == (RedChannel *)common->worker->cursor_channel);
common->worker->cursor_channel = NULL;
red_channel_apply_clients(channel, red_reset_cursor_cache);
red_disconnect_channel(channel);
red_channel_disconnect(channel);
}
static void red_migrate_cursor(RedWorker *worker, RedChannelClient *rcc)
@ -10676,7 +10660,7 @@ void handle_dev_display_disconnect(void *opaque, void *payload)
red_printf("disconnect display client");
ASSERT(rcc);
display_channel_client_disconnect(rcc);
red_channel_client_disconnect(rcc);
}
void handle_dev_display_migrate(void *opaque, void *payload)
@ -10725,7 +10709,7 @@ void handle_dev_cursor_disconnect(void *opaque, void *payload)
red_printf("disconnect cursor client");
ASSERT(rcc);
cursor_channel_client_disconnect(rcc);
red_channel_client_disconnect(rcc);
}
void handle_dev_cursor_migrate(void *opaque, void *payload)