[freenet-dev] [freenet-cvs] r13562 - trunk/freenet/src/freenet/clients/http

Matthew Toseland toad at amphibian.dyndns.org
Thu Jun 14 19:58:33 UTC 2007


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 : http://emu.freenetproject.org/pipermail/devl/attachments/20070614/5b691d3b/attachment.pgp 


More information about the Devl mailing list