Bug 36110 - Add util functions for determining socket address type and access control
Summary: Add util functions for determining socket address type and access control
Status: RESOLVED MOVED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-10 02:43 UTC by Morten Mjelva
Modified: 2019-12-03 20:38 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Morten Mjelva 2011-04-10 02:43:38 UTC
TpStreamTubeChannel currently does this internally, but by moving these to util-internal they can be used by other classes as well, such as TpFileTransferChannel.
Comment 1 Guillaume Desmottes 2011-04-11 01:21:47 UTC
Agreed. Would be cool if you could provide a separated branch so we can review/merge that without blocking on the whole TpFileTransferChannel.
Comment 2 Will Thompson 2011-06-13 08:39:14 UTC
+  // Find best socket address type

Please use /* C89 comments */ rather than // C99 comments (despite it being 2011).

This kind of comment belongs in a block above the function:

/*
 * _tp_determine_socket_address_type:
 *
 * Determines the best-available socket address type.
 */
TpSocketAddressType
_tp_determine_socket_address_type (GHashTable *supported_sockets,
    GError **error)

or similar.

I notice that you've actually moved these functions over almost verbatim from telepathy-glib/stream-tube-channel.c but changed the commenting style and removing the pre-function block comment from find_best_access_control() which had slightly more information. :) I'd personally prefer patches that move code to be joined together, to make it clear that the code's been moved, rather than apparently being written from scratch and then later discovering that the same code was removed from another file.

The branching in the code is a bit weird: both _tp_determine_socket_address_type and _tp_determine_access_control_type have a lot of duplication.

+  self->priv->socket_type = _tp_determine_socket_address_type (
+      supported_sockets, &error);
+  self->priv->access_control = _tp_determine_access_control_type (
+      supported_sockets, self->priv->socket_type, &error);

This is wrong: you can't pass 'error' to the second function without having checked that the first function returned success.

Any particular reason for removing the more-specific DEBUG() output from the error paths of create_client_socket? Previously the message told the developer immediately at what stage the error occurred; now it does not.
Comment 3 GitLab Migration User 2019-12-03 20:38:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/61.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.