/** * Restart a download. Caller should call ,false first, at which point we setStarted, and ,true * when it has actually started (a race condition means we don't setStarted at that point since * it's possible the success/failure callback might happen first). * * @param redirect If non-null, the request followed a redirect. */ public synchronized void updateStarted(String identifier, FreenetURI redirect) { DownloadRequestStatus status = (DownloadRequestStatus) requestsByIdentifier.get(identifier); if (status == null) return; // Can happen during cancel etc. status.restart(false); if (redirect != null) { downloadsByURI.remove(status.getURI()); status.redirect(redirect); downloadsByURI.put(redirect, status); } }