[vlc-commits] [Git][videolan/vlc][master] nfs: fix libnfs API v2 support

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Dec 17 12:00:44 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a945944c by Steve Lhomme at 2024-12-17T11:46:08+00:00
nfs: fix libnfs API v2 support

Introduced in libnfs 6.0.0.

Co-authored-by: ronnie sahlberg <ronniesahlberg at gmail.com>
Co-authored-by: Thomas Guillem <thomas at gllm.fr>

- - - - -


1 changed file:

- modules/access/nfs.c


Changes:

=====================================
modules/access/nfs.c
=====================================
@@ -188,7 +188,8 @@ nfs_read_cb(int i_status, struct nfs_context *p_nfs, void *p_data,
     else
     {
         p_sys->res.read.i_len = i_status;
-        memcpy(p_sys->res.read.p_buf, p_data, i_status);
+        if (p_sys->res.read.p_buf != NULL && p_data != NULL)
+            memcpy(p_sys->res.read.p_buf, p_data, i_status);
     }
 }
 
@@ -208,9 +209,15 @@ FileRead(stream_t *p_access, void *p_buf, size_t i_len)
         return 0;
 
     p_sys->res.read.i_len = 0;
+#ifdef LIBNFS_API_V2
+    p_sys->res.read.p_buf = NULL;
+    if (nfs_read_async(p_sys->p_nfs, p_sys->p_nfsfh, p_buf, i_len, nfs_read_cb,
+                       p_access) < 0)
+#else
     p_sys->res.read.p_buf = p_buf;
     if (nfs_read_async(p_sys->p_nfs, p_sys->p_nfsfh, i_len, nfs_read_cb,
                        p_access) < 0)
+#endif
     {
         msg_Err(p_access, "nfs_read_async failed");
         return 0;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a945944c2d50cacfacdd5b16d4ea5e7b4766a9fc

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a945944c2d50cacfacdd5b16d4ea5e7b4766a9fc
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