This commit is contained in:
tonikelope 2016-10-03 01:35:58 +02:00
parent 74fab46c01
commit 3658ff03dd
5 changed files with 8 additions and 17 deletions

View File

@ -137,7 +137,7 @@ public final class ChunkWriter implements Runnable, SecureNotifiable {
if(_file_size > 0)
{
while(!_exit && (!_download.isStopped() || _download.chunkDownloadersRunning()) && _bytes_written < _file_size)
while(!_exit && (!_download.isStopped() || !_download.getChunkworkers().isEmpty()) && _bytes_written < _file_size)
{
while(_chunk_queue.containsKey(_last_chunk_id_written+1))
{
@ -160,7 +160,7 @@ public final class ChunkWriter implements Runnable, SecureNotifiable {
}
if(!_exit && (!_download.isStopped() || _download.chunkDownloadersRunning()) && _bytes_written < _file_size)
if(!_exit && (!_download.isStopped() || !_download.getChunkworkers().isEmpty()) && _bytes_written < _file_size)
{
System.out.println("Filewriter waiting for chunk ["+(_last_chunk_id_written+1)+"]...");

View File

@ -853,7 +853,7 @@ public final class Download implements Transference, Runnable, SecureNotifiable
}
/* OJO!! -> ESTO ESTÁ CAMBIADO Y NO COMPROBADO!! */
public synchronized String getDownloadUrlForWorker() throws IOException
{
if(_last_download_url != null && checkMegaDownloadUrl(_last_download_url)) {
@ -951,11 +951,6 @@ public final class Download implements Transference, Runnable, SecureNotifiable
}
}
public synchronized boolean chunkDownloadersRunning()
{
return !getChunkworkers().isEmpty();
}
@Override
public void updateProgress(int reads)

View File

@ -858,10 +858,6 @@ public final class Upload implements Transference, Runnable, SecureNotifiable {
System.out.println("Uploader BYE BYE");
}
public synchronized boolean chunkUploadersRunning()
{
return !_chunkworkers.isEmpty();
}
public synchronized void pause_worker() {

View File

@ -123,7 +123,7 @@ public final class UploadMACGenerator implements Runnable, SecureNotifiable {
String temp_file_data = "";
boolean new_chunk=false;
while(!_exit && (!_upload.isStopped() || _upload.chunkUploadersRunning()) && (_bytes_read < _upload.getFile_size() || (_upload.getFile_size() == 0 && _last_chunk_id_read < 1)))
while(!_exit && (!_upload.isStopped() || !_upload.getChunkworkers().isEmpty()) && (_bytes_read < _upload.getFile_size() || (_upload.getFile_size() == 0 && _last_chunk_id_read < 1)))
{
while(_chunk_queue.containsKey(_last_chunk_id_read+1))
{
@ -187,7 +187,7 @@ public final class UploadMACGenerator implements Runnable, SecureNotifiable {
new_chunk = false;
}
if(!_exit && (!_upload.isStopped() || _upload.chunkUploadersRunning()) && (_bytes_read < _upload.getFile_size() || (_upload.getFile_size() == 0 && _last_chunk_id_read < 1)))
if(!_exit && (!_upload.isStopped() || !_upload.getChunkworkers().isEmpty()) && (_bytes_read < _upload.getFile_size() || (_upload.getFile_size() == 0 && _last_chunk_id_read < 1)))
{
System.out.println("METAMAC wait...");
secureWait();