Merge pull request 'Fix udp sending ratio for tracker instead of server used' (#130) from fix-udp into master
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/head This commit looks good
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/head This commit looks good
This commit is contained in:
commit
b7fc61c440
@ -64,7 +64,7 @@ public class ClientDownloadUDP extends ClientDownload {
|
||||
* @param hostItem Hostitem of the server
|
||||
*/
|
||||
protected ClientDownloadPart createDownloadPart(HostItem hostItem) {
|
||||
return (ClientDownloadPart)new ClientDownloadPartUDP((ClientDownload)this, filename, hostItem.getUDPSocket(), partsSubdir, logger, client, tracker);
|
||||
return (ClientDownloadPart)new ClientDownloadPartUDP((ClientDownload)this, filename, hostItem.getUDPSocket(), partsSubdir, logger, client, hostItem);
|
||||
}
|
||||
|
||||
/** Implementation of writeLog
|
||||
|
@ -259,7 +259,11 @@ public abstract class TrackerManagement extends ServeErrors implements Runnable
|
||||
while(readLock.get() > 0) {
|
||||
this.wait();
|
||||
}
|
||||
if (!ratioDown.containsKey(updateRatioClient) || ! ratioUp.containsKey(updateRatioServer)) {
|
||||
if (!ratioDown.containsKey(updateRatioClient)) {
|
||||
writeLog("Unkwnow client host " + updateRatioClient, LogLevel.Debug);
|
||||
sendUnknownHost(pd);
|
||||
} else if (!ratioUp.containsKey(updateRatioServer)) {
|
||||
writeLog("Unkwnow server host " + updateRatioServer, LogLevel.Debug);
|
||||
sendUnknownHost(pd);
|
||||
} else {
|
||||
ratioDown.put(updateRatioClient, Long.valueOf(ratioDown.get(updateRatioClient).longValue() + ratioSize));
|
||||
|
Loading…
Reference in New Issue
Block a user