On Wednesday 13 June 2007 17:37, swatig0 at freenetproject.org wrote: > + public void handleGet(HTTPRequest request, ToadletContext context) > throws > IOException, ToadletContextClosedException { + String action = > request.getParam("action"); > + PageMaker pageMaker = context.getPageMaker(); > + if ((action == null) || (action.length() == 0)) { > + MultiValueTable responseHeaders = new MultiValueTable(); > + responseHeaders.put("Location", "?action=list"); > + context.sendReplyHeaders(301, "Redirect", > responseHeaders, "text/html; > charset=utf-8", 0); + return; > + } else if ("list".equals(action)) { > + > + String listName = request.getParam("listName", null); > + HTMLNode pageNode = pageMaker.getPageNode("The XML > Spider", context); > + HTMLNode contentNode = > pageMaker.getContentNode(pageNode); > + /* create copies for multi-threaded use */ > + if (listName == null) { > + Map runningFetches = new > HashMap(runningFetchesByURI); > + List queued = new ArrayList(queuedURIList); > + Set visited = new HashSet(visitedURIs); > + Set failed = new HashSet(failedURIs);
Copying should be done synchronized, presumably? And if you're just listing them, probably to a FreenetURI[] or something? Alternatively, just hold the lock over this whole sub-block? > + contentNode.addChild(createNavbar(pageMaker, > runningFetches.size(), > queued.size(), visited.size(), failed.size())); > + contentNode.addChild(createAddBox(pageMaker, > context)); > + contentNode.addChild(createList(pageMaker, > "Running FetcheIIIs", > "running", runningFetches.keySet(), maxShownURIs)); What's a Fetchelll? :) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20070614/5b691d3b/attachment.pgp>