private DownloadSource getRandomSourceWithFreeSlot() 
	{
		DownloadSource s = null;
		int n = RandomGenerator.getInt(0, sources.size());
		for (int i = n; i < sources.size(); i++)
		{
			s = sources.get(i);
			if (s.couldRetryNow() && manager.acquireDirectoryDownloadSlot (s.getRemoteHost()))
			{
				break;
			}
			else
			{
				s = null;
			}
		}
		if (s == null)
		{
			// try again the others
			for (int i = 0; i < n; i++)
			{
				s = sources.get(i);
				if (s.couldRetryNow() && manager.acquireDirectoryDownloadSlot (s.getRemoteHost()))
				{
					break;
				}
				else
				{
					s = null;
				}
			}
		}
		
		return s;
		
		
	}