[vlc-commits] sap: remove SAPv0 support

Rémi Denis-Courmont git at videolan.org
Sat Apr 4 19:44:04 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Apr  4 20:20:48 2020 +0300| [5387e631dd7972ea8d6fc30f3bd7c8bc56e63eaf] | committer: Rémi Denis-Courmont

sap: remove SAPv0 support

This removes non-strict mode, in other words support for non-standard
version 0 of the protocol. This means releases of the session directory
tool (sdr) from before October 1996.

SAP was only standardized as version 2 in 2000. SAP support was added
to VLC in 2003; VLC and miniSAPserver have always sent packets following
the standard (except for the first 6 days of development where a
completely custom packet format was used, never seen in a release).

We retain backward compatibility with version 1 (sdr releases from 1996
to 2000) because there are no relevant differences with version 2.
Version 0 packets however lack the hash value, which *is* troublesome.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5387e631dd7972ea8d6fc30f3bd7c8bc56e63eaf
---

 modules/services_discovery/sap.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/modules/services_discovery/sap.c b/modules/services_discovery/sap.c
index f13dd3e3cc..6a2406ed60 100644
--- a/modules/services_discovery/sap.c
+++ b/modules/services_discovery/sap.c
@@ -91,10 +91,6 @@
        "This enables actual parsing of the announces by the SAP module. " \
        "Otherwise, all announcements are parsed by the \"live555\" " \
        "(RTP/RTSP) module." )
-#define SAP_STRICT_TEXT N_( "SAP Strict mode" )
-#define SAP_STRICT_LONGTEXT N_( \
-       "When this is set, the SAP parser will discard some non-compliant " \
-       "announcements." )
 
 /* Callbacks */
     static int  Open ( vlc_object_t * );
@@ -118,8 +114,7 @@ vlc_module_begin ()
                  SAP_TIMEOUT_TEXT, SAP_TIMEOUT_LONGTEXT, true )
     add_bool( "sap-parse", true,
                SAP_PARSE_TEXT,SAP_PARSE_LONGTEXT, true )
-    add_bool( "sap-strict", false,
-               SAP_STRICT_TEXT,SAP_STRICT_LONGTEXT, true )
+    add_obsolete_bool( "sap-strict" ) /* since 4.0.0 */
     add_obsolete_bool( "sap-timeshift" ) /* Redumdant since 1.0.0 */
 
     set_capability( "services_discovery", 0 )
@@ -223,7 +218,6 @@ typedef struct
     struct sap_announce_t **pp_announces;
 
     /* Modes */
-    bool  b_strict;
     bool  b_parse;
 
     vlc_tick_t i_timeout;
@@ -300,7 +294,6 @@ static int Open( vlc_object_t *p_this )
     p_sys->pi_fd = NULL;
     p_sys->i_fd = 0;
 
-    p_sys->b_strict = var_CreateGetBool( p_sd, "sap-strict");
     p_sys->b_parse = var_CreateGetBool( p_sd, "sap-parse" );
 
     p_sys->i_announces = 0;
@@ -683,11 +676,8 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
 
     uint16_t i_hash = U16_AT (buf + 2);
 
-    if( p_sys->b_strict && i_hash == 0 )
-    {
-        msg_Dbg( p_sd, "strict mode, discarding announce with null id hash");
+    if( i_hash == 0 )
         return VLC_EGENERIC;
-    }
 
     buf += 4;
     if( b_ipv6 )



More information about the vlc-commits mailing list