summaryrefslogtreecommitdiff
path: root/socket/socket.h
diff options
context:
space:
mode:
authorJakub Adam <jakub.adam@ktknet.cz>2016-04-04 21:52:29 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2016-04-04 21:54:02 +0100
commite0ed4fb3a236710846d9129438e0077782569633 (patch)
tree269ec37b2454e95139091403facac1133541effb /socket/socket.h
parent38268e53fde8cd97055d88d2066c0016fe04b31b (diff)
downloadlibnice-e0ed4fb3a236710846d9129438e0077782569633.tar.gz
socket: refactor nice_socket_is_base_of()
• rename to nice_socket_is_based_on() and swap the order of arguments accordingly; the implementation doesn't have to use the confusing 'return other->is_base_of()' pattern anymore • fix potential NULL dereferences The argument order in agent_recv_message_unlocked() was already wrongly swapped in 1732c7d6 and thus this commit isn't changing it back because that order has become the correct one. Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk> Differential Revision: https://phabricator.freedesktop.org/D866
Diffstat (limited to 'socket/socket.h')
-rw-r--r--socket/socket.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/socket/socket.h b/socket/socket.h
index f324f0c..fadcbc1 100644
--- a/socket/socket.h
+++ b/socket/socket.h
@@ -88,7 +88,7 @@ struct _NiceSocket
gboolean (*can_send) (NiceSocket *sock, NiceAddress *addr);
void (*set_writable_callback) (NiceSocket *sock,
NiceSocketWritableCb callback, gpointer user_data);
- gboolean (*is_base_of) (NiceSocket *sock, NiceSocket *other);
+ gboolean (*is_based_on) (NiceSocket *sock, NiceSocket *other);
void (*close) (NiceSocket *sock);
void *priv;
};
@@ -126,19 +126,21 @@ nice_socket_set_writable_callback (NiceSocket *sock,
NiceSocketWritableCb callback, gpointer user_data);
/**
- * nice_socket_is_base_of:
+ * nice_socket_is_based_on:
* @sock: a #NiceSocket
* @other: another #NiceSocket
*
- * Check whether @sock is equal to, or a base socket of, @other or one of
- * @other's base sockets.
+ * Checks whether @sock wraps @other as a source and destination of its read and
+ * write operations. The function traverses the whole chain of @sock's base
+ * sockets until @other is found or the end is reached.
*
- * Returns: %TRUE if @sock is a base socket of @other, %FALSE otherwise
+ * Returns: %TRUE if @sock is based on @other or if @sock and @other are
+ * the same socket, %FALSE otherwise.
*
* Since: UNRELEASED
*/
gboolean
-nice_socket_is_base_of (NiceSocket *sock, NiceSocket *other);
+nice_socket_is_based_on (NiceSocket *sock, NiceSocket *other);
void
nice_socket_free (NiceSocket *sock);