Commit 59e1e3d6 authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/*: don't forget to reinitialize the timeout when looping around select().
parent 607b74b2
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ftp.c: * ftp.c:
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ftp.c,v 1.10 2003/03/24 17:15:29 gbazin Exp $ * $Id: ftp.c,v 1.11 2003/03/24 19:12:16 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -824,14 +824,17 @@ static ssize_t NetRead( input_thread_t *p_input, ...@@ -824,14 +824,17 @@ static ssize_t NetRead( input_thread_t *p_input,
FD_SET( p_socket->i_handle, &fds ); FD_SET( p_socket->i_handle, &fds );
/* We'll wait 1 second if nothing happens */ /* We'll wait 1 second if nothing happens */
timeout.tv_sec = 0; timeout.tv_sec = 1;
timeout.tv_usec = 1000000; timeout.tv_usec = 0;
/* Find if some data is available */ /* Find if some data is available */
while( (i_ret = select( p_socket->i_handle + 1, &fds, while( (i_ret = select( p_socket->i_handle + 1, &fds,
NULL, NULL, &timeout )) == 0 NULL, NULL, &timeout )) == 0
|| (i_ret < 0 && errno == EINTR) ) || (i_ret < 0 && errno == EINTR) )
{ {
timeout.tv_sec = 1;
timeout.tv_usec = 0;
if( p_input->b_die || p_input->b_error ) if( p_input->b_die || p_input->b_error )
{ {
return 0; return 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* http.c: HTTP access plug-in * http.c: HTTP access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: http.c,v 1.28 2003/03/24 17:15:29 gbazin Exp $ * $Id: http.c,v 1.29 2003/03/24 19:12:16 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -718,6 +718,9 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) ...@@ -718,6 +718,9 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len )
#endif #endif
) )
{ {
timeout.tv_sec = 0;
timeout.tv_usec = 500000;
if( p_input->b_die || p_input->b_error ) if( p_input->b_die || p_input->b_error )
{ {
return 0; return 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mms.c: MMS access plug-in * mms.c: MMS access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: mms.c,v 1.28 2003/03/24 17:15:29 gbazin Exp $ * $Id: mms.c,v 1.29 2003/03/24 19:12:16 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -1473,6 +1473,9 @@ static int NetFillBuffer( input_thread_t *p_input ) ...@@ -1473,6 +1473,9 @@ static int NetFillBuffer( input_thread_t *p_input )
NULL, NULL, &timeout )) == 0 NULL, NULL, &timeout )) == 0
|| (i_ret < 0 && errno == EINTR) ) || (i_ret < 0 && errno == EINTR) )
{ {
timeout.tv_sec = 0;
timeout.tv_usec = 500000;
if( p_input->b_die || p_input->b_error ) if( p_input->b_die || p_input->b_error )
{ {
return 0; return 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* udp.c: raw UDP & RTP access plug-in * udp.c: raw UDP & RTP access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: udp.c,v 1.16 2003/03/24 17:15:29 gbazin Exp $ * $Id: udp.c,v 1.17 2003/03/24 19:12:16 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Tristan Leteurtre <tooney@via.ecp.fr> * Tristan Leteurtre <tooney@via.ecp.fr>
...@@ -339,6 +339,9 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len ) ...@@ -339,6 +339,9 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len )
NULL, NULL, &timeout )) == 0 NULL, NULL, &timeout )) == 0
|| (i_ret < 0 && errno == EINTR) ) || (i_ret < 0 && errno == EINTR) )
{ {
timeout.tv_sec = 0;
timeout.tv_usec = 500000;
if( p_input->b_die || p_input->b_error ) if( p_input->b_die || p_input->b_error )
{ {
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment