static void OutClose( vlc_object_t * );
#endif
-#define USER_TEXT N_("FTP user name")
-#define USER_LONGTEXT N_("User name that will " \
- "be used for the connection.")
-#define PASS_TEXT N_("FTP password")
-#define PASS_LONGTEXT N_("Password that will be " \
- "used for the connection.")
+#define USER_TEXT N_("Username")
+#define USER_LONGTEXT N_("Username that will be used for the connection, " \
+ "if no username is set in the URL.")
+#define PASS_TEXT N_("Password")
+#define PASS_LONGTEXT N_("Password that will be used for the connection, " \
+ "if no username or password are set in URL.")
#define ACCOUNT_TEXT N_("FTP account")
#define ACCOUNT_LONGTEXT N_("Account that will be " \
"used for the connection.")
/* TLS/SSL handshake */
p_sys->cmd.p_tls = vlc_tls_ClientSessionCreate( p_sys->p_creds, fd,
p_sys->url.psz_host,
- psz_session_name );
+ psz_session_name,
+ NULL, NULL );
if( p_sys->cmd.p_tls == NULL )
{
msg_Err( p_access, "cannot establish FTP/TLS session on command channel" );
static int Login( vlc_object_t *p_access, access_sys_t *p_sys )
{
int i_answer;
- char *psz;
/* *** Open a TCP connection with server *** */
int fd = p_sys->cmd.fd = net_ConnectTCP( p_access, p_sys->url.psz_host,
msg_Dbg( p_access, "connection accepted (%d)", i_answer );
- if( p_sys->url.psz_username && *p_sys->url.psz_username )
- psz = strdup( p_sys->url.psz_username );
- else
- psz = var_InheritString( p_access, "ftp-user" );
- if( !psz )
- return -1;
-
/* Features check first */
if( ftp_SendCommand( p_access, p_sys, "FEAT" ) < 0
|| ftp_RecvAnswer( p_access, p_sys, NULL, NULL,
i_answer != 200 )
{
msg_Err( p_access, "Can't truncate Protection buffer size for TLS" );
- free( psz );
goto error;
}
i_answer != 200 )
{
msg_Err( p_access, "Can't set Data channel protection" );
- free( psz );
goto error;
}
}
/* Send credentials over channel */
+ char *psz;
+
+ if( p_sys->url.psz_username && *p_sys->url.psz_username )
+ psz = strdup( p_sys->url.psz_username );
+ else
+ psz = var_InheritString( p_access, "ftp-user" );
+ if( !psz )
+ goto error;
+
if( ftp_SendCommand( p_access, p_sys, "USER %s", psz ) < 0 ||
ftp_RecvCommand( p_access, p_sys, &i_answer, NULL ) < 0 )
{
switch( i_query )
{
- /* */
case ACCESS_CAN_SEEK:
pb_bool = (bool*)va_arg( args, bool* );
*pb_bool = !p_access->p_sys->directory;
*va_arg( args, uint64_t * ) = p_access->p_sys->size;
break;
- /* */
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = INT64_C(1000)
* var_InheritInteger( p_access, "network-caching" );
break;
- /* */
case ACCESS_SET_PAUSE_STATE:
pb_bool = (bool*)va_arg( args, bool* );
if ( !pb_bool )
return Seek( p_access, p_access->info.i_pos );
break;
- case ACCESS_GET_TITLE_INFO:
- case ACCESS_SET_TITLE:
- case ACCESS_SET_SEEKPOINT:
- case ACCESS_SET_PRIVATE_ID_STATE:
- case ACCESS_GET_CONTENT_TYPE:
- case ACCESS_GET_META:
- return VLC_EGENERIC;
-
default:
- msg_Warn( p_access, "unimplemented query in control: %d", i_query);
return VLC_EGENERIC;
}
p_sys->data.p_tls = vlc_tls_ClientSessionCreate( p_sys->p_creds,
p_sys->data.fd, p_sys->url.psz_host,
( p_sys->tlsmode == EXPLICIT ) ? "ftpes-data"
- : "ftps-data" );
+ : "ftps-data",
+ NULL, NULL );
if( p_sys->data.p_tls == NULL )
{
msg_Err( p_access, "cannot establish FTP/TLS session for data" \