Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From line 194 of: https://github.com/freenet/plugin-WebOfTrust/blob/master/src/plugins/WebOfTrust/introduction/IntroductionServer.java
- private void downloadSolutions(final OwnIdentity inserter) throws FetchException {
- synchronized(mPuzzleStore) {
- final ObjectSet<OwnIntroductionPuzzle> puzzles = mPuzzleStore.getUnsolvedByInserter(inserter);
- Logger.normal(this, "Identity " + inserter.getNickname() + " has " + puzzles.size() + " unsolved puzzles stored. " +
- "Trying to fetch solutions ...");
- for(final OwnIntroductionPuzzle p : puzzles) {
- try {
- final FetchContext fetchContext = mClient.getFetchContext();
- fetchContext.maxArchiveLevels = 0; // Because archives can become huge and WOT does not use them, we should disallow them. See JavaDoc of the variable.
- // -1 means retry forever. Does make sense here: After 2 retries the fetches go into the cooldown queue, ULPRs are used. So if someone inserts
- // the puzzle solution during that, we might get to know it.
- fetchContext.maxSplitfileBlockRetries = -1;
- fetchContext.maxNonSplitfileRetries = -1;
- final ClientGetter g = mClient.fetch(
- p.getSolutionURI(), XMLTransformer.MAX_INTRODUCTION_BYTE_SIZE,
- this, fetchContext, RequestStarter.UPDATE_PRIORITY_CLASS);
- addFetch(g);
- if(logDEBUG) Logger.debug(this, "Trying to fetch captcha solution for " + p.getRequestURI() + " at " + p.getSolutionURI().toString());
- }
- catch(RuntimeException e) {
- Logger.error(this, "Error while trying to fetch captcha solution at " + p.getSolutionURI());
- }
- }
- Logger.normal(this, "Finishing with starting fetches for the puzzle solutions of " + inserter.getNickname());
- }
- }
Add Comment
Please, Sign In to add comment