Fix client not registering when no file in directory #122

Merged
louis_royer merged 1 commits from fix-not-registering into master 2020-04-12 16:53:47 +02:00
2 changed files with 1 additions and 19 deletions

View File

@ -50,6 +50,7 @@ public abstract class FileWatcher implements Runnable {
this.server = server;
this.tracker = tracker;
this.baseDirectory = baseDirectory;
force = true;
}
/** FileList getter

View File

@ -316,25 +316,6 @@ public abstract class TrackerManagement extends ServeErrors implements Runnable
closeHostItemSocket(host);
} catch (EmptyDirectory e) {
writeLog("Empty Directory", LogLevel.Debug);
try {
synchronized (this) {
while(writeLock.getAndSet(true)) {
this.wait();
}
while(readLock.get() > 0) {
this.wait();
}
if (!hostList.contains(host)) {
hostList.add(host);
}
hostList.remove(host);
writeLock.getAndSet(false);
this.notifyAll();
}
} catch(InterruptedException e2) {
throw new InternalError();
}
writeLog("Received EMPTY DIRECTORY from host " + pd.getHostItem() + ". Aborting.", LogLevel.Action);
} catch (Exception e) {
// remove from list because list request could not be send
try {