[Spice-devel,v2,08/19] Remove unused red_channel_get_first_socket

Submitted by Frediano Ziglio on Nov. 25, 2016, 2:52 p.m.

Details

Message ID 2f51c7fd967eb0f7e46c07f84d72e2a1b6058b76.1480085518.git-series.fziglio@redhat.com
State New
Headers show
Series "Start cleaning objects on destruction" ( rev: 4 3 2 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Nov. 25, 2016, 2:52 p.m.
This function assume there is only one client.
Was used only by some obsolete functions.
Avoid to use such function in the future.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/red-channel.c | 14 --------------
 server/red-channel.h |  2 --
 2 files changed, 16 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/red-channel.c b/server/red-channel.c
index 0936548..fb2c8c1 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -611,20 +611,6 @@  int red_channel_any_blocked(RedChannel *channel)
     return FALSE;
 }
 
-int red_channel_get_first_socket(RedChannel *channel)
-{
-    RedChannelClient *rcc;
-    RedsStream *stream;
-
-    if (!channel || !channel->priv->clients) {
-        return -1;
-    }
-    rcc = g_list_nth_data(channel->priv->clients, 0);
-    stream = red_channel_client_get_stream(rcc);
-
-    return stream->socket;
-}
-
 int red_channel_no_item_being_sent(RedChannel *channel)
 {
     GListIter iter;
diff --git a/server/red-channel.h b/server/red-channel.h
index 0aa72c5..2c99139 100644
--- a/server/red-channel.h
+++ b/server/red-channel.h
@@ -262,8 +262,6 @@  void red_channel_pipes_add_type(RedChannel *channel, int pipe_item_type);
 
 void red_channel_pipes_add_empty_msg(RedChannel *channel, int msg_type);
 
-int red_channel_get_first_socket(RedChannel *channel);
-
 /* return TRUE if all of the connected clients to this channel are blocked */
 int red_channel_all_blocked(RedChannel *channel);
 

Comments

On Fri, 2016-11-25 at 14:52 +0000, Frediano Ziglio wrote:
> This function assume there is only one client.
> Was used only by some obsolete functions.
> Avoid to use such function in the future.
> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
> ---
>  server/red-channel.c | 14 --------------
>  server/red-channel.h |  2 --
>  2 files changed, 16 deletions(-)
> 
> diff --git a/server/red-channel.c b/server/red-channel.c
> index 0936548..fb2c8c1 100644
> --- a/server/red-channel.c
> +++ b/server/red-channel.c
> @@ -611,20 +611,6 @@ int red_channel_any_blocked(RedChannel
> *channel)
>      return FALSE;
>  }
>  
> -int red_channel_get_first_socket(RedChannel *channel)
> -{
> -    RedChannelClient *rcc;
> -    RedsStream *stream;
> -
> -    if (!channel || !channel->priv->clients) {
> -        return -1;
> -    }
> -    rcc = g_list_nth_data(channel->priv->clients, 0);
> -    stream = red_channel_client_get_stream(rcc);
> -
> -    return stream->socket;
> -}
> -
>  int red_channel_no_item_being_sent(RedChannel *channel)
>  {
>      GListIter iter;
> diff --git a/server/red-channel.h b/server/red-channel.h
> index 0aa72c5..2c99139 100644
> --- a/server/red-channel.h
> +++ b/server/red-channel.h
> @@ -262,8 +262,6 @@ void red_channel_pipes_add_type(RedChannel
> *channel, int pipe_item_type);
>  
>  void red_channel_pipes_add_empty_msg(RedChannel *channel, int
> msg_type);
>  
> -int red_channel_get_first_socket(RedChannel *channel);
> -
>  /* return TRUE if all of the connected clients to this channel are
> blocked */
>  int red_channel_all_blocked(RedChannel *channel);
>