On Mon, Feb 03, 2014 at 07:02:39PM +0100, Marc-André Lureau wrote: > From: Marc-André Lureau <marcandre.lur...@redhat.com> > > 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
pgptDOVvN1nce.pgp
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel