[vlc-commits] [Git][videolan/vlc][master] 4 commits: dsm: forward the vlc_interrupt_unregister() return value

Thomas Guillem (@tguillem) gitlab at videolan.org
Tue Jun 7 11:35:57 UTC 2022



Thomas Guillem pushed to branch master at VideoLAN / VLC


Commits:
26af6121 by Thomas Guillem at 2022-06-07T09:10:49+02:00
dsm: forward the vlc_interrupt_unregister() return value

- - - - -
bdc351df by Thomas Guillem at 2022-06-07T09:10:49+02:00
dsm: handle missing smb_session interruptions

- - - - -
30eb1b27 by Thomas Guillem at 2022-06-07T09:10:49+02:00
dsm: abort if netbios_ns_inverse is interrupted

- - - - -
7ea6ce34 by Thomas Guillem at 2022-06-07T09:10:49+02:00
contrib: libdsm: update to 0.4.3

Fix connect() not interruptible on Linux.

Fixes #27027

- - - - -


3 changed files:

- contrib/src/libdsm/SHA512SUMS
- contrib/src/libdsm/rules.mak
- modules/access/dsm/access.c


Changes:

=====================================
contrib/src/libdsm/SHA512SUMS
=====================================
@@ -1 +1 @@
-9ee82c8812a807054ebe3ceb2a6ba37c36d188052cfbd7f5ba5b435ede8f6bee09690fb0d0c94e1e4d0022bbbdfa2837f09c69ccc00d17f79efe002cc158825a  libdsm-0.4.2.tar.xz
+4abe2318aa5d63397404ce87fc42be30d364dffef3bdf6e081a2bb3ac4f011f39fa8acb5ba06361e94795a308df321b077e7a3cf2ec10d5e1e6c9b912cbbd8ba  libdsm-0.4.3.tar.xz


=====================================
contrib/src/libdsm/rules.mak
=====================================
@@ -1,6 +1,6 @@
 # libdsm
 
-LIBDSM_VERSION := 0.4.2
+LIBDSM_VERSION := 0.4.3
 LIBDSM_URL := https://github.com/videolabs/libdsm/releases/download/v$(LIBDSM_VERSION)/libdsm-$(LIBDSM_VERSION).tar.xz
 
 ifeq ($(call need_pkg,"libdsm >= 0.2.0"),)


=====================================
modules/access/dsm/access.c
=====================================
@@ -160,10 +160,10 @@ smb_session_interrupt_register( access_sys_t *sys )
     vlc_interrupt_register( smb_session_interrupt_callback, sys->p_session );
 }
 
-static inline void
+static inline int
 smb_session_interrupt_unregister( void )
 {
-    vlc_interrupt_unregister();
+    return vlc_interrupt_unregister();
 }
 
 static void
@@ -178,18 +178,37 @@ netbios_ns_interrupt_register( netbios_ns *ns )
     vlc_interrupt_register( netbios_ns_interrupt_callback, ns );
 }
 
-static inline void
+static inline int
 netbios_ns_interrupt_unregister( void )
 {
-    vlc_interrupt_unregister();
+    return vlc_interrupt_unregister();
 }
 
 #else
 
-#define smb_session_interrupt_register( sys ) do {} while (0)
-#define smb_session_interrupt_unregister() do {} while(0)
-#define netbios_ns_interrupt_register( ns ) do {} while (0)
-#define netbios_ns_interrupt_unregister() do {} while (0)
+static inline void
+smb_session_interrupt_register( access_sys_t *sys )
+{
+    (void) sys;
+}
+
+static inline int
+smb_session_interrupt_unregister( void )
+{
+    return 0;
+}
+
+static inline void
+netbios_ns_interrupt_register( netbios_ns *ns )
+{
+    (void) ns;
+}
+
+static inline int
+netbios_ns_interrupt_unregister( void )
+{
+    return 0;
+}
 
 #endif
 
@@ -250,11 +269,13 @@ static int Open( vlc_object_t *p_this )
     if( smb_stat_get( st, SMB_STAT_ISDIR ) )
     {
         smb_fclose( p_sys->p_session, p_sys->i_fd );
-        smb_session_interrupt_unregister();
+        if (smb_session_interrupt_unregister() == EINTR)
+            goto error;
         return BrowserInit( p_access );
     }
 
-    smb_session_interrupt_unregister();
+    if (smb_session_interrupt_unregister() == EINTR)
+        goto error;
 
     msg_Dbg( p_access, "Successfully opened smb://%s", p_access->psz_location );
 
@@ -337,7 +358,11 @@ static int get_address( stream_t *p_access )
 
         int ret = netbios_ns_resolve( p_ns, p_sys->url.psz_host,
                                       NETBIOS_FILESERVER, &ip4_addr);
-        netbios_ns_interrupt_unregister();
+        if (netbios_ns_interrupt_unregister() == EINTR)
+        {
+            netbios_ns_destroy( p_ns );
+            return -EINTR;
+        }
         netbios_ns_destroy( p_ns );
 
         if( ret == 0 )
@@ -374,6 +399,11 @@ static int get_address( stream_t *p_access )
     const char *psz_nbt = netbios_ns_inverse( p_ns, p_sys->addr.s_addr );
 
     netbios_ns_interrupt_unregister();
+    if (netbios_ns_interrupt_unregister() == EINTR)
+    {
+        netbios_ns_destroy( p_ns );
+        return -EINTR;
+    }
     netbios_ns_destroy( p_ns );
 
     if( psz_nbt != NULL )
@@ -511,7 +541,8 @@ static int login( stream_t *p_access )
         goto error;
     }
 
-    smb_session_interrupt_unregister();
+    if (smb_session_interrupt_unregister() == EINTR)
+        goto error;
 
     if( connect_err == EACCES )
     {
@@ -676,7 +707,8 @@ static ssize_t Read( stream_t *p_access, void *p_buffer, size_t i_len )
 
     smb_session_interrupt_register( p_sys );
     i_read = smb_fread( p_sys->p_session, p_sys->i_fd, p_buffer, i_len );
-    smb_session_interrupt_unregister();
+    if (smb_session_interrupt_unregister() == EINTR)
+        errno = EINTR;
 
     if( i_read < 0 )
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/329bd3c8a3d73b77263b5d98e4e0d2a9e3f9e638...7ea6ce343341a4170234364f80987bbd7f64d005

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/329bd3c8a3d73b77263b5d98e4e0d2a9e3f9e638...7ea6ce343341a4170234364f80987bbd7f64d005
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list