From cd255bddc7fa0ddae056b5358a22b380c4eefc42 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 4 Apr 2017 15:24:43 -0400 Subject: [PATCH] udp-turn: Add some const to internal APIs --- agent/component.c | 2 +- socket/udp-turn.c | 10 +++++----- socket/udp-turn.h | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/agent/component.c b/agent/component.c index 32f7463..a679b30 100644 --- a/agent/component.c +++ b/agent/component.c @@ -380,7 +380,7 @@ nice_component_restart (NiceComponent *cmp) for (i = cmp->remote_candidates; i; i = i->next) { NiceCandidate *candidate = i->data; - /* note: do not remove the local candidate that is + /* note: do not remove the remote candidate that is * currently part of the 'selected pair', see ICE * 9.1.1.1. "ICE Restarts" (ID-19) */ if (candidate == cmp->selected_pair.remote) { diff --git a/socket/udp-turn.c b/socket/udp-turn.c index a9c57e5..190a9ea 100644 --- a/socket/udp-turn.c +++ b/socket/udp-turn.c @@ -174,8 +174,8 @@ priv_send_data_queue_destroy (gpointer user_data) NiceSocket * nice_udp_turn_socket_new (GMainContext *ctx, NiceAddress *addr, - NiceSocket *base_socket, NiceAddress *server_addr, - gchar *username, gchar *password, + NiceSocket *base_socket, const NiceAddress *server_addr, + const gchar *username, const gchar *password, NiceTurnSocketCompatibility compatibility) { UdpTurnPriv *priv; @@ -1184,7 +1184,7 @@ nice_udp_turn_socket_parse_recv_message (NiceSocket *sock, NiceSocket **from_soc gsize nice_udp_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock, NiceAddress *from, gsize len, guint8 *buf, - NiceAddress *recv_from, guint8 *_recv_buf, gsize recv_len) + const NiceAddress *recv_from, const guint8 *_recv_buf, gsize recv_len) { UdpTurnPriv *priv = (UdpTurnPriv *) sock->priv; @@ -1194,8 +1194,8 @@ nice_udp_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock, ChannelBinding *binding = NULL; union { - guint8 *u8; - guint16 *u16; + const guint8 *u8; + const guint16 *u16; } recv_buf; /* In the case of a reliable UDP-TURN-OVER-TCP (which means MS-TURN) diff --git a/socket/udp-turn.h b/socket/udp-turn.h index b1eeeb4..df10a1c 100644 --- a/socket/udp-turn.h +++ b/socket/udp-turn.h @@ -59,15 +59,16 @@ nice_udp_turn_socket_parse_recv_message (NiceSocket *sock, NiceSocket **from_soc gsize nice_udp_turn_socket_parse_recv (NiceSocket *sock, NiceSocket **from_sock, NiceAddress *from, gsize len, guint8 *buf, - NiceAddress *recv_from, guint8 *recv_buf, gsize recv_len); + const NiceAddress *recv_from, const guint8 *recv_buf, gsize recv_len); gboolean nice_udp_turn_socket_set_peer (NiceSocket *sock, NiceAddress *peer); NiceSocket * nice_udp_turn_socket_new (GMainContext *ctx, NiceAddress *addr, - NiceSocket *base_socket, NiceAddress *server_addr, - gchar *username, gchar *password, NiceTurnSocketCompatibility compatibility); + NiceSocket *base_socket, const NiceAddress *server_addr, + const gchar *username, const gchar *password, + NiceTurnSocketCompatibility compatibility); void nice_udp_turn_socket_set_ms_realm(NiceSocket *sock, StunMessage *msg); -- 2.7.4