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) 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)) 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)+"]..."); 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 public synchronized String getDownloadUrlForWorker() throws IOException
{ {
if(_last_download_url != null && checkMegaDownloadUrl(_last_download_url)) { if(_last_download_url != null && checkMegaDownloadUrl(_last_download_url)) {
@ -951,12 +951,7 @@ public final class Download implements Transference, Runnable, SecureNotifiable
} }
} }
public synchronized boolean chunkDownloadersRunning()
{
return !getChunkworkers().isEmpty();
}
@Override @Override
public void updateProgress(int reads) public void updateProgress(int reads)
{ {

View File

@ -187,7 +187,7 @@ public final class KissVideoStreamServer implements HttpHandler, SecureNotifiabl
} }
} }
String status="Kissvideostreamer on localhost:"+STREAMER_PORT+" Info: "+conta_info+" / Conn: "+conta_connect+" / Stream: "+conta_stream+" / Retry: "+conta_retry; String status="Kissvideostreamer on localhost:"+STREAMER_PORT+" Info: "+conta_info+" / Conn: "+conta_connect+" / Stream: "+conta_stream+" / Retry: "+conta_retry;
swingReflectionInvoke("setText", _main_panel.getView().getKiss_server_status(), status); swingReflectionInvoke("setText", _main_panel.getView().getKiss_server_status(), status);
} }

View File

@ -858,11 +858,7 @@ public final class Upload implements Transference, Runnable, SecureNotifiable {
System.out.println("Uploader BYE BYE"); System.out.println("Uploader BYE BYE");
} }
public synchronized boolean chunkUploadersRunning()
{
return !_chunkworkers.isEmpty();
}
public synchronized void pause_worker() { public synchronized void pause_worker() {
if(++_paused_workers >= _chunkworkers.size() && !_exit) { if(++_paused_workers >= _chunkworkers.size() && !_exit) {

View File

@ -123,7 +123,7 @@ public final class UploadMACGenerator implements Runnable, SecureNotifiable {
String temp_file_data = ""; String temp_file_data = "";
boolean new_chunk=false; 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)) while(_chunk_queue.containsKey(_last_chunk_id_read+1))
{ {
@ -187,7 +187,7 @@ public final class UploadMACGenerator implements Runnable, SecureNotifiable {
new_chunk = false; 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..."); System.out.println("METAMAC wait...");
secureWait(); secureWait();