[Bug 34931] Add a "meta porter"

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Mar 16 10:15:18 CET 2011


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

--- Comment #6 from Jonny Lamb <jonny.lamb at collabora.co.uk> 2011-03-16 02:15:17 PDT ---
(In reply to comment #4)
> If I were a pedant I would ask for the documentation to not talk about
> references, given that the functions no longer talk about references. But NBD.

You *are* a pedant! Fixed

> Yes. The GIO convention is that _finish() functions return new refs. (If
> existing Wocky code gets this wrong, it's wrong too!) I think this would mean
> you wouldn't need the new non-copying macro.

I opened bug #35351 about WockyConnector.

The macro is used in the link-local connector which returns a new ref (the only
ref) to the connection is creates but doesn't reference it anywhere else so
won't disappear when you free the connector. So this is fine.

The macro is also used in the meta porter's send_iq_finish function as it
passes the new reply stanza down. This is fine too.

> I'd call the connector functions wocky_ll_connector_new_incoming_async(),
> wocky_ll_connector_new_outgoing_async(), wocky_ll_connector_new_finish().

So I implemented the three functions, as you probably saw, but I don't like
_new_ because we don't actually want a WockyLLConnector object. As a result,
you never actually get the said object anywhere. Ignoring function names,
what's wrong with this:

void wocky_ll_connector_incoming_async (
    GIOStream *stream,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data);

void wocky_ll_connector_outgoing_async (
    WockyXmppConnection *connection,
    const gchar *local_jid,
    const gchar *remote_jid,
    GCancellable *cancellable,
    GAsyncReadyCallback callback,
    gpointer user_data);

WockyXmppConnection * wocky_ll_connector_finish (
    WockyLLConnector *connector,
    GAsyncResult *result,
    gchar **from,
    GError **error);

The finish returns a new ref to the connection, of course.

> As we discussed on IRC — maybe we should just document that you should only
> call this once, and warn if it's called more than once. :)

OK, done.

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


More information about the telepathy-bugs mailing list