[axel-commits] r94 - in /trunk: CHANGES axel.c

phihag-guest at users.alioth.debian.org phihag-guest at users.alioth.debian.org
Mon Feb 23 19:39:59 UTC 2009


Author: phihag-guest
Date: Mon Feb 23 19:39:59 2009
New Revision: 94

URL: http://svn.debian.org/wsvn/axel/?sc=1&rev=94
Log:
Fix thread hangups due to incorrect synchronization (Closes: #311469), thanks Yao Shi

Modified:
    trunk/CHANGES
    trunk/axel.c

Modified: trunk/CHANGES
URL: http://svn.debian.org/wsvn/axel/trunk/CHANGES?rev=94&op=diff
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Mon Feb 23 19:39:59 2009
@@ -1,3 +1,7 @@
+UNRELEASED:
+
+- Fix thread hangups due to incorrect synchronization (Closes: #311469), thanks Yao Shi
+
 Version 2.3
 
 - Wait for thread termination in axel.c:axel_do (Closes: #311255), thanks John Ripa

Modified: trunk/axel.c
URL: http://svn.debian.org/wsvn/axel/trunk/axel.c?rev=94&op=diff
==============================================================================
--- trunk/axel.c (original)
+++ trunk/axel.c Mon Feb 23 19:39:59 2009
@@ -238,8 +238,12 @@
 	if( axel->conn[i].currentbyte <= axel->conn[i].lastbyte )
 	{
 		if( axel->conf->verbose >= 2 )
+		{
 			axel_message( axel, _("Connection %i downloading from %s:%i using interface %s"),
 		        	      i, axel->conn[i].host, axel->conn[i].port, axel->conn[i].local_if );
+		}
+		
+		axel->conn[i].state = 1;
 		if( pthread_create( axel->conn[i].setup_thread, NULL, setup_thread, &axel->conn[i] ) != 0 )
 		{
 			axel_message( axel, _("pthread error!!!") );
@@ -248,7 +252,6 @@
 		else
 		{
 			axel->conn[i].last_transfer = gettime();
-			axel->conn[i].state = 1;
 		}
 	}
 	
@@ -397,9 +400,10 @@
 				if( axel->conf->verbose >= 2 )
 					axel_message( axel, _("Connection %i downloading from %s:%i using interface %s"),
 				        	      i, axel->conn[i].host, axel->conn[i].port, axel->conn[i].local_if );
+				
+				axel->conn[i].state = 1;
 				if( pthread_create( axel->conn[i].setup_thread, NULL, setup_thread, &axel->conn[i] ) == 0 )
 				{
-					axel->conn[i].state = 1;
 					axel->conn[i].last_transfer = gettime();
 				}
 				else




More information about the axel-commits mailing list