mirror of https://github.com/zlatinb/muwire
reduce the request q size if the file has few pieces
parent
4cff64133e
commit
99e9eb00a1
|
@ -107,7 +107,7 @@ public class Downloader {
|
||||||
queueSize++
|
queueSize++
|
||||||
if (pieceSizePow2 < 18)
|
if (pieceSizePow2 < 18)
|
||||||
queueSize++
|
queueSize++
|
||||||
this.queueSize = queueSize
|
this.queueSize = Math.min(this.nPieces - 1, queueSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized InfoHash getInfoHash() {
|
public synchronized InfoHash getInfoHash() {
|
||||||
|
@ -427,7 +427,7 @@ public class Downloader {
|
||||||
sentAnyRequests = true
|
sentAnyRequests = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sentAnyRequests)
|
if (!sentAnyRequests && queueSize > 0)
|
||||||
break;
|
break;
|
||||||
endpoint.getOutputStream().flush()
|
endpoint.getOutputStream().flush()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue