@Override
    public void run() {
        try {
            try (MiniHttpClient htc = new MiniHttpClient("l3cdn.riotgames.com")) {
                htc.throwExceptionWhenNot200 = true;
                htc.setErrorHandler(defaultHttpErrorHandler);
                
                ManifestFile task;
                while(true){
                    synchronized(patcher.filesToPatch){
                        if(patcher.filesToPatch.isEmpty() || patcher.done || patcher.error != null){
                            break;
                        }
                        task = patcher.filesToPatch.remove(0);
                    }
                    startTime = System.currentTimeMillis();
                    current = task.name;
                    downloadFile(task, htc);
                    startTime = -1;
                }
            }

        } catch (IOException | NoSuchAlgorithmException ex) {
            Logger.getLogger(FileDownloadWorker.class.getName()).log(Level.SEVERE, null, ex);
            if(patcher.error == null){
                patcher.error = ex;
            }
        }
    }