vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sat Apr 4 20:28:00 2020 +0300| [914ca6ed437a03d99df7ce8db6cc15b0bd4f5902] | committer: Rémi Denis-Courmont
sap: remove now dead code > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=914ca6ed437a03d99df7ce8db6cc15b0bd4f5902 --- modules/services_discovery/sap.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c index 6a2406ed60..018ecf436a 100644 --- a/modules/services_discovery/sap.c +++ b/modules/services_discovery/sap.c @@ -252,7 +252,6 @@ typedef struct static const char *FindAttribute (const sdp_t *sdp, unsigned media, const char *name); - static bool IsSameSession( sdp_t *p_sdp1, sdp_t *p_sdp2 ); static int InitSocket( services_discovery_t *p_sd, const char *psz_address, int i_port ); static int Decompress( const unsigned char *psz_src, unsigned char **_dst, int i_len ); static void FreeSDP( sdp_t *p_sdp ); @@ -771,9 +770,8 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf, { sap_announce_t * p_announce = p_sys->pp_announces[i]; /* FIXME: slow */ - if( ( !i_hash && IsSameSession( p_announce->p_sdp, p_sdp ) ) - || ( i_hash && p_announce->i_hash == i_hash - && !memcmp(p_announce->i_source, i_source, sizeof(i_source)) ) ) + if (p_announce->i_hash == i_hash + && memcmp(p_announce->i_source, i_source, sizeof (i_source)) == 0) { /* We don't support delete announcement as they can easily * Be used to highjack an announcement by a third party. @@ -1574,27 +1572,6 @@ static int RemoveAnnounce( services_discovery_t *p_sd, return VLC_SUCCESS; } -/* - * Compare two sessions, when hash is not set (SAP v0) - */ -static bool IsSameSession( sdp_t *p_sdp1, sdp_t *p_sdp2 ) -{ - /* A session is identified by - * - username, - * - session_id, - * - network type (which is always IN), - * - address type (currently, this means IP version), - * - and hostname. - */ - if (strcmp (p_sdp1->username, p_sdp2->username) - || (p_sdp1->session_id != p_sdp2->session_id) - || (p_sdp1->orig_ip_version != p_sdp2->orig_ip_version) - || strcmp (p_sdp1->orig_host, p_sdp2->orig_host)) - return false; - - return true; -} - static inline attribute_t *MakeAttribute (const char *str) { attribute_t *a = malloc (sizeof (*a) + strlen (str) + 1); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
