[Bug 30460] Generate client side API for Chan.T.ServerTLSConnection and TLSCertificate

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu May 3 17:44:42 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=30460

--- Comment #20 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-05-03 08:44:42 PDT ---
> +<SUBSECTION>
> +tp_cli_authentication_tls_certificate_call_accept
> +tp_cli_authentication_tls_certificate_call_reject
> +tp_cli_authentication_tls_certificate_callback_for_accept
> +tp_cli_authentication_tls_certificate_callback_for_reject
> +tp_cli_authentication_tls_certificate_connect_to_accepted
> +tp_cli_authentication_tls_certificate_connect_to_rejected
> +tp_cli_authentication_tls_certificate_signal_callback_accepted
> +tp_cli_authentication_tls_certificate_signal_callback_rejected

Please undocument these. (Now there's something you don't hear every day... :-)

Changing it to <SUBSECTION Private> would do nicely.

> + * tp_tls_certificate_rejection_raise_error:

should also document:

Returns: %FALSE

> +_TP_AVAILABLE_IN_0_20
> +struct _TpTLSCertificateRejectionClass {

Not portable. In MSVC++, those macros expand to __declspec(deprecated) or
something, which can only be applied to extern symbols (functions/variables),
not to types.

If we really need it, we could add _TP_GNUC_AVAILABLE_IN_0_20 which only does
anything in gcc but can appear in more places - but we'd have to define it
ourselves, using G_UNAVAILABLE in gcc >= 4.5 and no expansion otherwise.

Or, we could just drop it. If you can't call any function that returns one of
these objects then in practice that'll be enough.

+      g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
+
+      rej = _tp_tls_certificate_rejection_new (error,
+          TP_TLS_CERTIFICATE_REJECT_REASON_UNKNOWN, TP_ERROR_STR_CERT_INVALID,
+          g_variant_builder_end (&builder));

g_variant_builder_end returns a new floating ref, and I was worried that
_tp_tls_certificate_rejection_new doesn't seem to sink the floating
reference... but g_object_new() probably uses a GValue, which sinks floating
variants automatically.

This seems a bit subtle, it might be better if
_tp_tls_certificate_rejection_new explicitly did:

g_variant_ref_sink (details);
ret = g_object_new (..., details, ...);
g_variant_unref (details);
return ret;

I think _tp_tls_certificate_rejection_new should certainly document that it
sinks floating references. (Assuming it does...)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.



More information about the telepathy-bugs mailing list