summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2012-02-16 23:30:09 -0600
committerAlon Levy <alevy@redhat.com>2012-02-21 10:20:45 +0200
commit10d79a35c1f571fe91615dd0ffa0f67a903b69c2 (patch)
tree41c1261f415ed8516804fabe4fed7fd6ffe905bc /server
parenta67268cbe1038126f00cec5a5330786b4b24a6cc (diff)
downloadspice-10d79a35c1f571fe91615dd0ffa0f67a903b69c2.tar.gz
spice-10d79a35c1f571fe91615dd0ffa0f67a903b69c2.tar.xz
spice-10d79a35c1f571fe91615dd0ffa0f67a903b69c2.zip
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>
Diffstat (limited to 'server')
-rw-r--r--server/red_channel.c2
-rw-r--r--server/red_worker.c26
2 files changed, 5 insertions, 23 deletions
diff --git a/server/red_channel.c b/server/red_channel.c
index 6296dc96..09161187 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -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);
}
diff --git a/server/red_worker.c b/server/red_worker.c
index 77033631..3973f3e9 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -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)