-
- msg_Dbg( p_input, "waiting for data connection..." );
- socket_desc.i_type = NETWORK_TCP;
- socket_desc.psz_server_addr = psz_ip;
- socket_desc.i_server_port = i_port;
- socket_desc.psz_bind_addr = "";
- socket_desc.i_bind_port = 0;
- socket_desc.i_ttl = 0;
- p_input->p_private = (void*)&socket_desc;
- if( !( p_network = module_Need( p_input, "network", "" ) ) )
- {
- msg_Err( p_input, "failed to connect with server" );
- return( -1 );
- }
- module_Unneed( p_input, p_network );
- p_access->socket_data.i_handle = socket_desc.i_handle;
- p_input->i_mtu = socket_desc.i_mtu;
- msg_Dbg( p_input,
- "connection with \"%s:%d\" successful",
- psz_ip, i_port );
-
- if( ftp_SendCommand( p_input, "RETR %s", p_access->url.psz_path ) < 0 )
- {
- msg_Err( p_input, "cannot retreive file" );
- return( -1 );
- }
- /* "1xx" message */
- if( ftp_ReadCommand( p_input, &i_answer, NULL ) > 2 )
- {
- msg_Err( p_input, "cannot retreive file" );
- return( -1 );
- }
-
- return( 0 );
-}
-
-static int ftp_StopStream ( input_thread_t *p_input)
-{
- access_t *p_access = (access_t*)p_input->p_access_data;
-
- int i_answer;
-
- NetClose( p_input, &p_access->socket_data );
-
- if( ftp_SendCommand( p_input, "ABOR" ) < 0 )
- {
- msg_Err( p_input, "cannot abord file" );
- }