- if( *psz_parser == '/' )
- {
- *psz_parser = '\0';
- psz_parser++;
- p_url->psz_path = psz_parser;
- }
-
- if( *psz_server_port )
- {
- p_url->i_server_port = strtol( psz_server_port, &psz_parser, 10 );
- }
- else
- {
- p_url->i_server_port = 0;
- }
-}
-
-/*****************************************************************************
- * Read: read on a file descriptor, checking b_die periodically
- *****************************************************************************/
-static ssize_t NetRead( input_thread_t *p_input,
- input_socket_t *p_socket,
- byte_t *p_buffer, size_t i_len )
-{
-#ifdef UNDER_CE
- return -1;
-
-#else
- struct timeval timeout;
- fd_set fds;
- ssize_t i_recv;
- int i_ret;
-
- /* Initialize file descriptor set */
- FD_ZERO( &fds );
- FD_SET( p_socket->i_handle, &fds );
-
- /* We'll wait 1 second if nothing happens */
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-
- /* Find if some data is available */
- while( (i_ret = select( p_socket->i_handle + 1, &fds,
- NULL, NULL, &timeout )) == 0
- || (i_ret < 0 && errno == EINTR) )
- {
- FD_ZERO( &fds );
- FD_SET( p_socket->i_handle, &fds );
- timeout.tv_sec = 1;
- timeout.tv_usec = 0;
-
- if( p_input->b_die || p_input->b_error )
- {
- return 0;
- }
- }
-
- if( i_ret < 0 )
- {
- msg_Err( p_input, "network select error (%s)", strerror(errno) );
- return -1;
- }
-
- i_recv = recv( p_socket->i_handle, p_buffer, i_len, 0 );
-
- if( i_recv < 0 )
- {
- msg_Err( p_input, "recv failed (%s)", strerror(errno) );
- }
-
- return i_recv;
-
-#endif
-}
-
-static void NetClose( input_thread_t *p_input, input_socket_t *p_socket )
-{
-#if defined( UNDER_CE )
- CloseHandle( (HANDLE)p_socket->i_handle );
-#elif defined( WIN32 )
- closesocket( p_socket->i_handle );
-#else
- close( p_socket->i_handle );
-#endif