[Spice-devel] [PATCH 06/18] Add RedsState arg to reds_init_client_[ssl_]connection()

Frediano Ziglio fziglio at redhat.com
Tue Feb 9 10:43:53 UTC 2016


> 
> From: Jonathon Jongsma <jjongsma at redhat.com>
> 
> ---
>  server/reds.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/server/reds.c b/server/reds.c
> index 6467c7e..7b8848a 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -2265,7 +2265,7 @@ static void reds_handle_ssl_accept(int fd, int event,
> void *data)
>      }
>  }
>  
> -static RedLinkInfo *reds_init_client_connection(int socket)
> +static RedLinkInfo *reds_init_client_connection(RedsState *reds, int socket)
>  {
>      RedLinkInfo *link;
>      int delay_val = 1;
> @@ -2318,12 +2318,12 @@ error:
>  }
>  
>  
> -static RedLinkInfo *reds_init_client_ssl_connection(int socket)
> +static RedLinkInfo *reds_init_client_ssl_connection(RedsState *reds, int
> socket)
>  {
>      RedLinkInfo *link;
>      int ssl_status;
>  
> -    link = reds_init_client_connection(socket);
> +    link = reds_init_client_connection(reds, socket);
>      if (link == NULL)
>          goto error;
>  
> @@ -2354,6 +2354,7 @@ error:
>  
>  static void reds_accept_ssl_connection(int fd, int event, void *data)
>  {
> +    RedsState *reds = data;
>      RedLinkInfo *link;
>      int socket;
>  
> @@ -2362,7 +2363,7 @@ static void reds_accept_ssl_connection(int fd, int
> event, void *data)
>          return;
>      }
>  
> -    if (!(link = reds_init_client_ssl_connection(socket))) {
> +    if (!(link = reds_init_client_ssl_connection(reds, socket))) {
>          close(socket);
>          return;
>      }
> @@ -2388,7 +2389,7 @@ SPICE_GNUC_VISIBLE int
> spice_server_add_client(SpiceServer *s, int socket, int s
>      RedLinkInfo *link;
>  
>      spice_assert(reds == s);
> -    if (!(link = reds_init_client_connection(socket))) {
> +    if (!(link = reds_init_client_connection(s, socket))) {
>          spice_warning("accept failed");
>          return -1;
>      }
> @@ -2405,7 +2406,7 @@ SPICE_GNUC_VISIBLE int
> spice_server_add_ssl_client(SpiceServer *s, int socket, i
>      RedLinkInfo *link;
>  
>      spice_assert(reds == s);
> -    if (!(link = reds_init_client_ssl_connection(socket))) {
> +    if (!(link = reds_init_client_ssl_connection(s, socket))) {
>          return -1;
>      }
>  

Same considerations for naming, use reds instead of s.

Frediano


More information about the Spice-devel mailing list