[Mplayer-cvslog] CVS: main/libmpdemux network.c,1.48,1.49

Bertrand Baudet bertrand at mplayerhq.hu
Fri Jun 21 09:06:48 CEST 2002


Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var/tmp.root/cvs-serv30465

Modified Files:
	network.c 
Log Message:
Here I go again, another fix for the timeout.
Note that we shouldn't rely on the value of the timeval struct
after select returns.


Index: network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- network.c	21 Jun 2002 06:28:24 -0000	1.48
+++ network.c	21 Jun 2002 07:06:46 -0000	1.49
@@ -168,16 +168,16 @@
 			return -1;
 		}
 	}
-	tv.tv_sec = 5;
-	tv.tv_usec = 0;
+	tv.tv_sec = 0;
+	tv.tv_usec = 500000;
 	FD_ZERO( &set );
 	FD_SET( socket_server_fd, &set );
 	// When the connection will be made, we will have a writable fd
 	while((ret = select(socket_server_fd+1, NULL, &set, NULL, &tv)) == 0) {
 	      if( ret<0 ) mp_msg(MSGT_NETWORK,MSGL_ERR,"select failed\n");
 	      else if(ret > 0) break;
-	      else if(count > 15 || mpdemux_check_interrupt(500)) {
-		if(count > 15)
+	      else if(count > 30 || mpdemux_check_interrupt(500)) {
+		if(count > 30)
 		  mp_msg(MSGT_NETWORK,MSGL_ERR,"Connection timeout\n");
 		else
 		  mp_msg(MSGT_NETWORK,MSGL_V,"Connection interuppted by user\n");
@@ -186,6 +186,8 @@
 	      count++;
 	      FD_ZERO( &set );
 	      FD_SET( socket_server_fd, &set );
+	      tv.tv_sec = 0;
+	      tv.tv_usec = 500000;
 	}
 
 	// Turn back the socket as blocking





More information about the MPlayer-cvslog mailing list