Re: [PATCH spice-html5 v2 1/4] spiceconn: Add function to test channel capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Tomáš,

On 09/18/2017 05:58 AM, Tomáš Bohdálek wrote:
> This will be used in other commits.
> ---
>  spiceconn.js | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/spiceconn.js b/spiceconn.js
> index 33e7388..abe9a4a 100644
> --- a/spiceconn.js
> +++ b/spiceconn.js
> @@ -495,6 +495,28 @@ SpiceConn.prototype =
>          var e = new Error("Connection timed out.");
>          this.report_error(e);
>      },
> +
> +    test_capability: function(caps, cap)
> +    {
> +        var ret = (caps[cap >> 5] >> (cap & 31)) & 1;
> +        return ret;
> +    },
> +
> +    channel_test_capability: function(cap)
> +    {
> +        if (this.reply_link)
> +        {
> +            return this.test_capability(this.reply_link.channel_caps, cap);
> +        }

Thanks for adding this check, but I think it good to add an else return
0 or false here.

> +    },
> +
> +    channel_test_common_capability: function(cap)
> +    {
> +        if (this.reply_link)
> +        {
> +            return this.test_capability(this.reply_link.common_caps, cap);
> +        }

And here as well.

> +    }
>  }
>  
>  function spiceconn_timeout(sc)
> 

Cheers,

Jeremy

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]