logger.warn("rejecting leecher" + nick + " " + filename);
u.reject();
return;
}
UploadQueue uq = UploadQueue.getInstance();
logger.debug("upload: " + nick + " " + filename);
boolean added = uq.add(u);
if (added) {
// give the download queue a chance to start the download
// right away to avoid sending local queued responses
try {
Thread.currentThread().sleep(20);
}
catch (InterruptedException e) {
}
}
int pos = uq.getLocalQueuePos(u);
if (pos == -1 && !added) {
if (uq.isRunning(u)) {
// some clients need two confirmations before they start
// downloading
MessageHandler.send
(server, new UploadAckMessage(nick, filename));
}