Re: [spice-gtk 08/13] openssl: learn to handle a new kind of BIO based on GIOStream

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

 



On Mon, Feb 03, 2014 at 07:02:39PM +0100, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> 
> Although reusing BIO_new_socket() once again is a hack, it seems
> to be the easiest way... The proper solution is certainly to start
> using GTls instead, but that will require a glib 2.28 dep bump.

Ah, much easier to review with git show -M (rename detection). 
> +
> +G_GNUC_INTERNAL
> +#if GLIB_CHECK_VERSION(2, 28, 0)
> +BIO* bio_new_giostream(GIOStream *stream)
> +{
> +    // TODO: make an actual new BIO type, or just switch to GTls already...
> +    BIO *bio = BIO_new_socket(-1, BIO_NOCLOSE);
> +#else
> +BIO* bio_new_gsocket(GSocket *gsocket)
> +{
> +    BIO *bio = BIO_new_socket(g_socket_get_fd(gsocket), BIO_NOCLOSE);
> +#endif

This #if block is not quite readable, I probably would have split that in a
helper function with the common code + 2 #ifdef'ed
bio_new_giostream/bio_new_gsocket calling that helper.

BIO_new_socket() will not mind having its fd set to -1 ?

ACK.

Christophe

Attachment: pgpq6xtDLNlQJ.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://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]