I2P Address: [http://git.idk.i2p]

Verified Commit 99e9eb00 authored by Zlatin Balevsky's avatar Zlatin Balevsky
Browse files

reduce the request q size if the file has few pieces

parent 4cff6413
......@@ -107,7 +107,7 @@ public class Downloader {
queueSize++
if (pieceSizePow2 < 18)
queueSize++
this.queueSize = queueSize
this.queueSize = Math.min(this.nPieces - 1, queueSize)
}
public synchronized InfoHash getInfoHash() {
......@@ -427,7 +427,7 @@ public class Downloader {
sentAnyRequests = true
}
}
if (!sentAnyRequests)
if (!sentAnyRequests && queueSize > 0)
break;
endpoint.getOutputStream().flush()
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment