mirror of https://github.com/zlatinb/muwire
fix constructor
parent
85466a8e80
commit
40410eba63
|
@ -228,6 +228,7 @@ public class Downloader {
|
||||||
private volatile Thread downloadThread
|
private volatile Thread downloadThread
|
||||||
private Endpoint endpoint
|
private Endpoint endpoint
|
||||||
private volatile DownloadSession currentSession
|
private volatile DownloadSession currentSession
|
||||||
|
private final Set<Integer> available = new HashSet<>()
|
||||||
|
|
||||||
DownloadWorker(Destination destination) {
|
DownloadWorker(Destination destination) {
|
||||||
this.destination = destination
|
this.destination = destination
|
||||||
|
@ -248,7 +249,8 @@ public class Downloader {
|
||||||
currentState = WorkerState.DOWNLOADING
|
currentState = WorkerState.DOWNLOADING
|
||||||
boolean requestPerformed
|
boolean requestPerformed
|
||||||
while(!pieces.isComplete()) {
|
while(!pieces.isComplete()) {
|
||||||
currentSession = new DownloadSession(eventBus, me.toBase64(), pieces, getInfoHash(), endpoint, incompleteFile, pieceSize, length)
|
currentSession = new DownloadSession(eventBus, me.toBase64(), pieces, getInfoHash(),
|
||||||
|
endpoint, incompleteFile, pieceSize, length, available)
|
||||||
requestPerformed = currentSession.request()
|
requestPerformed = currentSession.request()
|
||||||
if (!requestPerformed)
|
if (!requestPerformed)
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue