[vlc-devel] [PATCH] Accept port specifications in smb2, now that the underlying library supports them.

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Jun 3 14:17:12 CEST 2019


On Mon, Jun 3, 2019, at 1:31 PM, Michael Young wrote:
> ---
>  modules/access/smb2.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/modules/access/smb2.c b/modules/access/smb2.c
> index 41864ccfa8..7374956dea 100644
> --- a/modules/access/smb2.c
> +++ b/modules/access/smb2.c
> @@ -58,8 +58,6 @@
>  
>  #include "smb_common.h"
>  
> -#define CIFS_PORT 445
> -
>  static int Open(vlc_object_t *);
>  static void Close(vlc_object_t *);
>  
> @@ -583,10 +581,6 @@ Open(vlc_object_t *p_obj)
>      if (vlc_UrlParseFixup(&sys->encoded_url, access->psz_url) != 0)
>          return VLC_ENOMEM;
>  
> -    if (sys->encoded_url.i_port != 0 && sys->encoded_url.i_port != CIFS_PORT)
> -        goto error;
> -    sys->encoded_url.i_port = 0;
> -
>      sys->smb2 = smb2_init_context();
>      if (sys->smb2 == NULL)
>      {
> @@ -598,10 +592,10 @@ Open(vlc_object_t *p_obj)
>          sys->encoded_url.psz_path = (char *) "/";
>  
>      char *resolved_host = vlc_smb2_resolve(access, sys->encoded_url.psz_host,
> -                                           CIFS_PORT);
> +                                           sys->encoded_url.i_port);
>  
>      /* smb2_* functions need a decoded url. Re compose the url from the
> -     * modified sys->encoded_url (without port and with the resolved host). */
> +     * modified sys->encoded_url (with the resolved host). */
>      char *url;
>      if (resolved_host != NULL)
>      {

Hi,

AFAICS there is no libsmb2 release including this feature, what happens when a port is provided to an old version of the library?

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list