Re: Stable glibmm and gtkmm releases soon



On Mon, 2013-03-25 at 22:16 -0400, José Alburquerque wrote:
On Tue, 2013-03-19 at 10:23 +0100, Murray Cumming wrote:
I will do the .0 releases of the current glibmm and gtkmm series in the
next few days, to try to be in sync with GNOME, who have their .0
release on March 27th:
https://live.gnome.org/ThreePointSeven

So, if you have added new API, please take an extra moment to make sure
that you don't need to fix it quickly, because you probably can't break
it later.


The not so extensive newly added Tls* API is pretty much complete.

Many thanks for that work.

  I
just thought that I would point out a couple of things that struck me as
unusual which I think would be good to be aware of before the stable
release goes out.  Also I have one final question.

1) The C documentation for GTlsConnection says that the
GTlsClientConnection and the GTlsServerConnection classes derive from it
[1][2][3][4].  In fact, in the C API the classes both derive from
GInterface.

Well, they are listed as "derived Interfaces", because they "require"
the GTlsConnection type. Or, in other words, it is a "Prerequisite". See
the G_DEFINE_INTERFACE() lines. Looking at all these made me notice some
similar things we should fix some time:
https://git.gnome.org/browse/glibmm/commit/?id=c43ced750b04b8ae0556e8dfe317a4dbb6da327f

For GTlsConnection it's a bit odd, because GTlsConnection is not an
interface, though GTlsClientConnection and GTlsServerConnection are. I
guess the glib developers are aware of the oddness of this, having
consciously chosen to give their interfaces some default implementation.

  In glibmm, the two classes in like manner presently derive
from Glib::Interface but they also derive from the base class
Gio::TlsConnection.  I hope that's okay.

Yes, that seems to be correct. I considered just deriving from
TlsConnection, but I guess we will need the Glib::Interface subclass to
"implement" those interfaces sometime. 


2) The *_new() functions of the two derived classes also create
GIOStreams.  It seems that the reason for that is that GTlsConnection
derives from it.  In glibmm, the create() method of the two derived
classes return Glib::RefPtr<>'s to each of the derived class types.  I
hope that's also fine.

Yes, that seems good. It's common for the G* APIs to return base types,
which we then change to specific types in *mm We like type safety.

[1]
https://developer.gnome.org/gio/stable/GTlsConnection.html#GTlsConnection.description
[2]
https://developer.gnome.org/gio/stable/GTlsConnection.html#GTlsConnection.derived-interfaces
[3]
https://developer.gnome.org/gio/stable/GTlsClientConnection.html#GTlsClientConnection.description
[4]
https://developer.gnome.org/gio/stable/GTlsServerConnection.html#GTlsServerConnection.description

3) From the GTlsFileDatabase docs [5] (see the description and the class
details), it seems that the interface derives from the GTlsDatabase
class.  In glibmm it therefore presently derives from Gio::TlsDatabase.
I just want to make sure that the derivation of the interface in glibmm
should not be changed.

This is also odd. GTlsFileDatabase is an interface, that requires the
GTlsDatabase object type (not an interface).

You have GTlsDatabase deriving from, and implementing, TlsFileDatabase
(and Object), which seems wrong, so I have corrected that:
https://git.gnome.org/browse/glibmm/commit/?id=6b966ecb0435775f6a7f84dece93b779b7ee42d3
(Please check that you agree.)

Actually, GTlsFileDatabase does not seem to be used in any public glib
or glibmm API (though TlsDatabase is). I suggest that we do not wrap it
just yet, to avoid us getting it wrong before we know how it should
really be used.

4) Finally, in the C API there are two constants
(G_TLS_DATABASE_PURPOSE_AUTHENTICATE_SERVER [6] and
G_TLS_DATABASE_PURPOSE_AUTHENTICATE_CLIENT [7]) used to depict certain
certificate purposes (see g_tls_database_verify_chain() [8]).  Should
those be wrapped in glibmm?

We could, but we could also do that later.

[5]
https://developer.gnome.org/gio/stable/GTlsFileDatabase.html#GTlsFileDatabase.description
[6]
https://developer.gnome.org/gio/stable/GTlsDatabase.html#G-TLS-DATABASE-PURPOSE-AUTHENTICATE-SERVER:CAPS
[7]
https://developer.gnome.org/gio/stable/GTlsDatabase.html#G-TLS-DATABASE-PURPOSE-AUTHENTICATE-CLIENT:CAPS
[8]
https://developer.gnome.org/gio/stable/GTlsDatabase.html#g-tls-database-verify-chain



-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



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