int fd_data;
char sz_epsv_ip[NI_MAXNUMERICHOST];
+ bool out;
};
#define GET_OUT_SYS( p_this ) \
((access_sys_t *)(((sout_access_out_t *)(p_this))->p_sys))
/* Init p_access */
STANDARD_READ_ACCESS_INIT
p_sys->fd_data = -1;
+ p_sys->out = false;
if( parseURL( &p_sys->url, p_access->psz_path ) )
goto exit_error;
/* Init p_access */
p_sys->fd_data = -1;
+ p_sys->out = true;
if( parseURL( &p_sys->url, p_access->psz_path ) )
goto exit_error;
int i_read;
assert( p_sys->fd_data != -1 );
- assert( p_access->i_object_type == VLC_OBJECT_ACCESS );
+ assert( !p_sys->out );
if( p_access->info.b_eof )
return 0;
/* "1xx" message */
if( ftp_SendCommand( p_access, p_sys, "%s %s",
- (p_access->i_object_type == VLC_OBJECT_ACCESS)
- ? "RETR" : "STOR",
+ p_sys->out ? "STOR" : "RETR",
p_sys->url.psz_path ) < 0 ||
ftp_ReadCommand( p_access, p_sys, &i_answer, NULL ) > 2 )
{
return VLC_EGENERIC;
}
- shutdown( p_sys->fd_data,
- ( p_access->i_object_type == VLC_OBJECT_ACCESS ) );
+ shutdown( p_sys->fd_data, p_sys->out ? SHUT_RD : SHUT_WR );
return VLC_SUCCESS;
}