Commit Graph

556 Commits

Author SHA1 Message Date
Nick Mathewson
11aa682812 Split version info into separate spec doc.
svn:r3783
2005-03-19 05:07:19 +00:00
Roger Dingledine
ec7f232b24 make hidden services more likely to work from the server-side
svn:r3781
2005-03-19 04:38:59 +00:00
Nick Mathewson
df9c8feac7 Commit fixes for several pending tor core tasks: document all DOCDOCed functions; time out uncontrolled unattached streams; feed reasons to SOCKS5 (refactoring connection_ap_handshake_socks_reply in the process); change DirFetchPeriod/StatusFetchPeriod to have a special "Be smart" value.
svn:r3769
2005-03-17 12:38:37 +00:00
Nick Mathewson
fd150459b3 Raise common code for "detach this stream and try it with a different circuit" into a separate function; make that function handle controller-managed streams right.
svn:r3756
2005-03-14 03:12:59 +00:00
Roger Dingledine
fe768d1d2a change SHUTDOWN_WAIT_LENGTH from a fixed 30 secs to a config option
svn:r3752
2005-03-12 20:13:38 +00:00
Nick Mathewson
115271f65e Implement the common case of ATTACHSTREAM.
svn:r3751
2005-03-12 04:22:01 +00:00
Nick Mathewson
777d3dde0c Get address map resetting implemented.
svn:r3745
2005-03-11 21:39:39 +00:00
Roger Dingledine
5254c4e63a remove duplicate function prototype
svn:r3743
2005-03-11 20:47:23 +00:00
Nick Mathewson
c185825585 Finish implementing GETINFO; make it easy to query address maps.
svn:r3732
2005-03-03 06:37:54 +00:00
Nick Mathewson
f90ccf5648 Implement new controller events for changed descriptors and new (not-yet-attached) streams.
svn:r3731
2005-03-02 22:29:58 +00:00
Nick Mathewson
5f8e2c2bc4 Rename unused-address functions to virtual address; this is more accurate. Also, include almost-right implementation of reusing dont-care mappings. (It is still kind of wrong because it does not take type into account.)
svn:r3728
2005-03-02 21:02:11 +00:00
Nick Mathewson
b494c2223d Specify and implement fragmented control messages to allow for (among other things) long GETINFO replies. Otherwise we could hit the 64K barrier on questions like "please dump your client-side DNS cache."
svn:r3726
2005-03-02 20:22:10 +00:00
Nick Mathewson
65230fd39f Implement "Dont-Care" from addresses to MapAddress control message. For safety, refuse to launch connections to unmapped addresses in the dont-care range.
svn:r3725
2005-03-02 19:26:46 +00:00
Nick Mathewson
afe414f070 Revise all calls to connection_edge_end to avoid sending MISC, and to take errno into account where possible.
svn:r3720
2005-03-01 22:42:31 +00:00
Nick Mathewson
4ddf768a4f Forward-port new reasons; clean up code more; add code to convert new reasons to SOCKS5 reply codes; add code to convert errnos to reasons. New code still needs to get invoked.
svn:r3719
2005-03-01 22:16:15 +00:00
Nick Mathewson
b7b05dc1b2 make control interface stream IDs monotonically increasing to prevent possible races
svn:r3715
2005-03-01 01:15:01 +00:00
Nick Mathewson
349ee1abea Clean up rend cache on shutdown
svn:r3714
2005-02-28 22:38:00 +00:00
Roger Dingledine
a1f1fa6ab2 Checkpoint in-progress fixes:
Add 'testing' circuit purpose, for reachability testing.
Notice when our IP changes, and reset stats.
Try to pull down a directory via Tor to see if our DirPort is working.
Try to extend a circuit back to us to see if our ORPort is working.
Only publish a descriptor if they're both reachable.

These mostly work, and I'd better get them in before I cause conflicts.


svn:r3703
2005-02-27 09:47:01 +00:00
Nick Mathewson
bbaa3c7792 Implement more control spec functionality
- Mapaddress
- Postdescriptor
- GetInfo on descriptors

Required changes elsewhere:
- Keep the most recent running_routers_t in the routerlist_t. That way we
  can learn about new routers and remember whether we were last told that
  they were up or down.  Also enables more simplifications.
- Keep the signed descriptor inside routerinfo_t.  This makes
  descriptor_entry_t in dirservers.c unneeded.
- Rename AddressMap (the verb) to MapAddress. Keep AddressMap as a noun.
- Check addresses for plausibility before mapping them.


svn:r3696
2005-02-25 20:46:13 +00:00
Nick Mathewson
26e6eb7539 Check returns from libevent calls better; stop poking at internals of events to see if they are live.
svn:r3691
2005-02-25 05:42:01 +00:00
Roger Dingledine
5b24ca6cde cache .exit address better (i think)
svn:r3684
2005-02-24 11:44:08 +00:00
Roger Dingledine
6faaac2706 add support for CONNECTing through https proxies.
not sure if it works. i don't have an https proxy.


svn:r3682
2005-02-24 10:56:55 +00:00
Roger Dingledine
55c3f15ed1 Forward-port the trick to bump up ConnLimit as far as it can
go, but not past MAXCONNECTIONS. Also throw away the FAKE_POLL
caveats since 0.1.0 doesn't need it any more.


svn:r3657
2005-02-22 23:52:44 +00:00
Nick Mathewson
a68fcbf807 Initial IRIX compatibility fixes: check for inttypes.h; check for platform cell_t.
svn:r3648
2005-02-22 04:26:45 +00:00
Roger Dingledine
8727acf2f1 Add a new AddressMap directive to rewrite incoming socks addresses.
Add a new TrackHostExits directive to trigger addressmaps for
certain incoming socks addresses, for sites that break when your exit
keeps changing.
Redo the client-side dns cache so it's just an addressmap too.


svn:r3641
2005-02-22 00:53:08 +00:00
Nick Mathewson
427e246a10 Add a missing prototype to or.h
svn:r3621
2005-02-13 22:31:26 +00:00
Nick Mathewson
f672577bc6 Free even more things on shutdown. Temporarily move tor_free_all out from #ifdef so it gets tested more.
svn:r3614
2005-02-11 01:26:47 +00:00
Nick Mathewson
60f234f42b Add more functions to free things to help dmalloc allong.
svn:r3613
2005-02-10 23:18:39 +00:00
Roger Dingledine
2e97593d25 define TOR_FRAGILE if you want tor to give you a core when
something goes wrong. this should only be used by people actively
tracking bugs.


svn:r3487
2005-02-01 00:37:16 +00:00
Roger Dingledine
d6489d8e41 lay a trap for situations where we connection_free something
that's still on one of the lists.

in particular, this will detect situations where we mark-for-close
and then free it ourselves.


svn:r3475
2005-01-31 00:33:32 +00:00
Roger Dingledine
b2fbd834f0 forward-port the dns and maxconn fixes
svn:r3448
2005-01-28 08:53:47 +00:00
Nick Mathewson
fd41cbcadf Have reason string for serverdesc post requests contain actual serverdesc status. Also fix return values of dirserv_add_descriptor to work as advertised.
svn:r3391
2005-01-20 20:18:32 +00:00
Nick Mathewson
129e754ae4 Warn when exit policy implicitly allows local addresses.
svn:r3383
2005-01-20 18:39:48 +00:00
Roger Dingledine
38be533c69 Handle unavailable hidden services better. We try each intro point
until none are left, then we try to refetch the descriptor. If it's
the same one we had before, then close streams right then. Whenever
a new stream arrives, even if it's right after, optimistically try
refetching the descriptor, just in case.


svn:r3379
2005-01-19 23:15:59 +00:00
Nick Mathewson
7d4a167c81 Basic windows libevent fixes
svn:r3366
2005-01-18 23:44:55 +00:00
Roger Dingledine
d2400a5afd Introduce a notion of 'internal' circs, which are chosen without regard
to the exit policy of the last hop. Intro and rendezvous circs must
be internal circs, to avoid leaking information. Resolve and connect
streams can use internal circs if they want.

New circuit pooling algorithm: make sure to have enough circs around
to satisfy any predicted ports, and also make sure to have 2 internal
circs around if we've required internal circs lately (with high uptime
if we've seen that lately).

Split NewCircuitPeriod config option into NewCircuitPeriod (30 secs),
which describes how often we retry making new circuits if current ones
are dirty, and MaxCircuitDirtiness (10 mins), which describes how long
we're willing to make use of an already-dirty circuit.

Once rendezvous circuits are established, keep using the same circuit as
long as you attach a new stream to it at least every 10 minutes. (So web
browsing doesn't require you to build new rend circs every 30 seconds.)

Cannibalize GENERAL circs to be C_REND, C_INTRO, S_INTRO, and S_REND
circ as necessary, if there are any completed ones lying around when
we try to launch one.

Re-instate the ifdef's to use version-0 style introduce cells, since
there was yet another bug in handling version-1 style. We'll try switching
over again after 0.0.9 is obsolete.

Bugfix: when choosing an exit node for a new non-internal circ, don't take
into account whether it'll be useful for any pending x.onion addresses --
it won't.

Bugfix: we weren't actually publishing the hidden service descriptor when
it became dirty. So we only published it every 20 minutes or so, which
means when you first start your Tor, the hidden service will seem broken.


svn:r3360
2005-01-17 18:13:09 +00:00
Roger Dingledine
0aff4ff4cb get rid of 0.0.8 backwards compatibility
svn:r3353
2005-01-13 20:22:38 +00:00
Nick Mathewson
324b192f68 Make Tor use Niels Provos's libevent instead of it's current
poll-but-sometimes-select mess.  This will let us use faster async cores
(like epoll, kpoll, and /dev/poll), and hopefully work better on Windows
too.

There are some fairly nasty changes to main.c here; this will almost
certainly break something.  But hey, that's what alphas are for.


svn:r3341
2005-01-12 06:42:32 +00:00
Roger Dingledine
84c81e0783 Annotate circuits w/ whether they aim to contain high uptime nodes and/or
high capacity nodes. When building circuits, choose appropriate nodes.

New config option LongLivedPorts to indicate application streams
that will want high uptime circuits.

When attaching a stream to a circuit, pay attention to its requirements.

This means that every single node in an intro rend circuit, not just
the last one, will have a minimum uptime.

Boost the min uptime from an hour to 24 hours.


svn:r3339
2005-01-12 04:58:23 +00:00
Roger Dingledine
f468ff04ea when we haven't fetched a directory yet, or the last time we
tried they were all unreachable, assume we are not connected to
the network.

when an application request comes in during this state, be
optimistic and assume we just reconnected. fetch a new directory
and if it works, begin making circuits.


svn:r3327
2005-01-07 15:57:57 +00:00
Roger Dingledine
cd1f50d2f0 new config option DirAllowPrivateAddresses for authdirservers.
now by default they refuse router descriptors that have non-IP
or private-IP addresses.


svn:r3321
2005-01-06 21:03:27 +00:00
Nick Mathewson
91bafc476e Fix a fun bug: do not rewrite a cached directory back to the cache; otherwise we will think it is recent and not fetch a newer one.
svn:r3319
2005-01-06 20:11:52 +00:00
Nick Mathewson
dcd228585d Implement SIGNAL control command.
svn:r3307
2005-01-05 06:40:47 +00:00
Nick Mathewson
b4fedc7f14 Stop reversing and re-reversing config lines: keep them in order all the time. Removes needless confusion and fixes bug #50.
svn:r3305
2005-01-05 06:05:37 +00:00
Nick Mathewson
6dd91de3bd Nothing actually _uses_ socks_port, so why publish it? For backward compatibility, publish a socks_port of 0, and never read socks_port.
svn:r3279
2005-01-04 05:46:54 +00:00
Roger Dingledine
82c5381ecb forward-port the fix for the compiler warning
svn:r3273
2005-01-04 01:16:20 +00:00
Nick Mathewson
0c4186d6ee Use correct logic to decide whether there are more directory servers to retry.
svn:r3257
2005-01-03 20:51:24 +00:00
Nick Mathewson
65c4fa2614 Split mark-dir-failed-and-retry logic into separate function; make it retry runningrouters as well as directory fetches; note that the do-we-need-to-give-up test is wrong.
svn:r3256
2005-01-03 20:07:07 +00:00
Roger Dingledine
95f3e6161b require BandwidthRate to be at least 10kB/s
svn:r3232
2004-12-31 21:47:54 +00:00
Nick Mathewson
e8585dfe97 Remove length restriction when generating directories.
svn:r3218
2004-12-24 02:17:32 +00:00