﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
270	new Tor connection handler: with_control_protocol_maker()	Brian Warner		"To help with [https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2490 tahoe#2490], I think we need a connection-handler that accepts a ""protocol maker"" function. When called, this function returns a Deferred that fires with a `txtorcon.TorControlProtocol` object. The handler will then ask that object for the SOCKS port and make hint connectors using that port.

When Tahoe is configured to listen on an onion service, it needs to talk to Tor to allocate one. There's not much point (and a lot of inefficiency) to running multiple Tor daemons. So we'd like Tahoe and Foolscap to use the same one. The tahoe.cfg will have controls to specify how Tor should be reached (either `control.port=` or `launch = true`), which gives it the ability to spin up a (singleton) `TorControlProtocol` when necessary.

We can have Tahoe create a `TorProvider` object, with a `get_control_protocol` method (which returns a Deferred, which fires with a `TorControlProtocol` object). Internally this will use an Observer, and it will only create a single protocol object. Then the foolscap handler can ask it for the protocol object, and if it's the only one asking, a new one will be spun up. But if Tahoe has already spun one up (for onion-service listening purposes), it will get the existing one.
"	enhancement	closed	major	0.12.4	network	0.12.3	fixed	tor	
