Remove unused and obsolete main_channel_close

This function wrongly close the first client.
Wrongly as closing the file descriptor cause a dandling
file descriptor in the object potentially leading
to closing another file descriptor open later.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
Frediano Ziglio 2016-11-18 05:35:46 +00:00
parent 311a79155d
commit 97eee5a352
2 changed files with 0 additions and 11 deletions

View File

@ -306,16 +306,6 @@ MainChannelClient *main_channel_link(MainChannel *channel, RedClient *client,
return mcc;
}
// TODO: ? shouldn't it disconnect all clients? or shutdown all main_channels?
void main_channel_close(MainChannel *main_chan)
{
int socketfd;
if (main_chan && (socketfd = red_channel_get_first_socket(RED_CHANNEL(main_chan))) != -1) {
close(socketfd);
}
}
MainChannel* main_channel_new(RedsState *reds)
{
// TODO: set the migration flag of the channel

View File

@ -61,7 +61,6 @@ RedClient *main_channel_get_client_by_link_id(MainChannel *main_chan, uint32_t l
MainChannelClient *main_channel_link(MainChannel *, RedClient *client,
RedsStream *stream, uint32_t link_id, int migration, int num_common_caps,
uint32_t *common_caps, int num_caps, uint32_t *caps);
void main_channel_close(MainChannel *main_chan); // not destroy, just socket close
void main_channel_push_mouse_mode(MainChannel *main_chan, int current_mode, int is_client_mouse_allowed);
void main_channel_push_agent_connected(MainChannel *main_chan);
void main_channel_push_agent_disconnected(MainChannel *main_chan);