Commit Graph

92 Commits

Author SHA1 Message Date
Roger Dingledine
ad5f5ddf7e remove a duplicate circuit_mark_for_close() when picking
a path for the circuit fails.


svn:r3822
2005-03-22 23:20:33 +00:00
Roger Dingledine
f1ba4296c1 clean up and refactor some more
svn:r3798
2005-03-22 01:01:15 +00:00
Roger Dingledine
35953edae0 Implement controller's "extendcircuit" directive.
Also refactor circuit building so we plan the whole path ahead
of time.


svn:r3797
2005-03-22 00:42:38 +00:00
Roger Dingledine
4a497e5030 if our clock jumps forward by 100 seconds or more, assume something
has gone wrong with our network and abandon all not-yet-used circs.


svn:r3792
2005-03-19 23:58:42 +00:00
Roger Dingledine
856ab90ca8 stop logging at -l notice every single time a create cell successfully
gets processed


svn:r3791
2005-03-19 23:04:15 +00:00
Nick Mathewson
b88c4ba11c Turn addr_policy_compare from a tristate to a quadstate; this should help address our "Ah, you allow 1.2.3.4:80. You are a good choice for google.com" problem.
svn:r3786
2005-03-19 06:57:16 +00:00
Roger Dingledine
229761465c re-enable reachability testing stuff.
also, consider your ORPort reachable after you've processed a
create cell from any non-local address.


svn:r3763
2005-03-15 01:44:46 +00:00
Nick Mathewson
97dad670ea Renormalize whitespace
svn:r3757
2005-03-14 03:18:35 +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
6e6d95b3db Change from inet_ntoa to a threadproof tor_inet_ntoa.
svn:r3656
2005-02-22 08:18:36 +00:00
Roger Dingledine
797419a62c remove unused code
svn:r3629
2005-02-16 02:06:54 +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
75d83827e0 fix another bug where general exit circs were looking at rendezvous
streams. consolidate the looking into one function so it doesn't
happen again.


svn:r3372
2005-01-19 17:59:37 +00:00
Roger Dingledine
ea24dc31bc remove some extra-verbose logs
svn:r3361
2005-01-17 18:49:13 +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
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
308ffa8a05 When listing circuits that are pending on an opening OR connection,
if we're an OR we were listing circuits that *end* at us as
being pending on every listener, dns/cpu worker, etc. Stop that.


svn:r3171
2004-12-17 23:17:00 +00:00
Roger Dingledine
011ad3cba5 clean up logging,
make it clearer which warns are bugs,
make the control log event match its specification,
point out a bug in how we deal with failure when renewing the tls context.


svn:r3138
2004-12-13 00:44:39 +00:00
Roger Dingledine
802d374a99 I'm a bad person.
Stop treating the uint16_t's as null-terminated strings,
and stop looking at the byte after them to see if it's null,
because sometimes you're not allowed to look there.


svn:r3108
2004-12-07 15:29:54 +00:00
Roger Dingledine
a2d80ec767 were we on crack??
svn:r3107
2004-12-07 09:18:25 +00:00
Roger Dingledine
d9f86e2782 and bust another memory leak
svn:r3105
2004-12-07 08:58:26 +00:00
Nick Mathewson
a6aa5eebd6 Fix some memory leaks and unlikely segfaults
svn:r3103
2004-12-07 07:48:16 +00:00
Roger Dingledine
5ba3328172 fix a minor leak in my recent commit
svn:r3081
2004-12-05 12:35:00 +00:00
Roger Dingledine
ef6c9d18e7 New circuit building strategy: keep a list of ports that we've used in the past 6 hours, and always try to have 2 circuits open or on the way
that will handle each such port. (We can extend this to include addresses
if exit policies shift to require that.) Seed us with port 80 so web
browsers won't complain that Tor is "slow to start up".

This was necessary because our old circuit building strategy just involved
counting circuits, and as time went by we would build up a big pile of
circuits that had peculiar exit policies (e.g. only exit to 9001-9100)
which would take up space in the circuit pile but never get used.

Fix router_compare_addr_to_addr_policy: it was not treating a port of *
as always matching, so we were picking reject *:* nodes as exit nodes too.

If you haven't used a clean circuit in an hour, throw it away, just to
be on the safe side.

This means after 6 hours a totally unused Tor client will have no
circuits open.


svn:r3078
2004-12-05 07:10:08 +00:00
Roger Dingledine
c644886c38 bugfix: When we were checking to see if an ap_conn should time out
waiting for its connected cell, we were calculating time from when the
ap_conn was created. So if it waited say 20 seconds before being attached,
then we would immediately decide that the circuit had timed out.

Also, make circuit_dump_by_conn() display actual circuit progress,
including circuits that haven't been attached to the conn yet but
hope to when it finishes connecting.


svn:r3072
2004-12-04 02:51:11 +00:00
Roger Dingledine
8d69dc472b make circuit building and router parsing less noisy
svn:r3068
2004-12-04 00:25:54 +00:00
Roger Dingledine
3929f58018 clean obsolete circuit_log_path code
svn:r3046
2004-11-30 10:47:48 +00:00
Nick Mathewson
7fbd297532 Suggestion from weasel: Make tor --version --version dump the cvs Id of every file.
svn:r3019
2004-11-29 22:25:31 +00:00
Roger Dingledine
22727b4edc wrong is ok, and right is fine, but in between is apparently
totally unacceptable to me.


svn:r3005
2004-11-28 11:39:53 +00:00
Nick Mathewson
6f5dbefa7e Normalize space: add one between every control keyword and control clause.
svn:r3003
2004-11-28 09:05:49 +00:00
Roger Dingledine
7c9a707900 remove emacs droppings, since nick says he doesn't need them anymore
svn:r2989
2004-11-26 04:00:55 +00:00
Nick Mathewson
f5319a010d Dr. Seuss on iterating circular lists: "It's fun to have fun, but you
have to know how."


svn:r2948
2004-11-23 06:08:08 +00:00
Nick Mathewson
0a58bbe0dd Fix critical bug in circuit_list_path: cpath is a circular list! (Also reimplement circuit_log_cpath using circuit_list_cpath).
svn:r2946
2004-11-23 00:11:36 +00:00
Roger Dingledine
6a516dfdd3 be more greedy about filling up all relay cells.
this may have some bugs in it still.
and it may end up not being what we want to do.


svn:r2928
2004-11-21 07:43:12 +00:00
Nick Mathewson
647c076c8f add a TODO item and some comment changes.
svn:r2904
2004-11-16 03:32:01 +00:00
Nick Mathewson
60880cda84 Resolve a bunch of FIXME items; mark a lot more for attention; ask for clarification on some. Turn all XXXX008 ("showstopper for 0.0.8 release") items into XXXX009 or XXXX, since plainly they were not showstoppers for 0.0.8. Add/clean some docs.
svn:r2808
2004-11-12 16:39:03 +00:00
Nick Mathewson
5d92fbe30e Use autoconf to enable largefile support where necessary. Use ftello where available, since ftell can fail at 2GB.
svn:r2806
2004-11-12 05:05:41 +00:00
Nick Mathewson
e69d9647ed Remove XXXX009 comment telling us to do the last (circID-related) fix
svn:r2798
2004-11-10 20:19:45 +00:00
Nick Mathewson
954570486f Resolve a FIXME: use identity comparison, not nickname comparison, to
choose circuit ID types.  This is important because our view of "the
nickname of the router on the other side of this connection" is
skewed, and depends on whether we think the other rotuer is
verified--and there's no way to know whether another router thinks you
are verified.

For backward compatibility, we notice when the other router chooses
the same circuit ID type as us (because it's running an old version),
and switch our type to be polite.


svn:r2797
2004-11-10 20:14:37 +00:00
Nick Mathewson
fde4129ac3 Resolve FIXME items: clarify two XXXX comments for 009
svn:r2791
2004-11-10 14:27:26 +00:00
Roger Dingledine
394554cfbf Clean up copyrights.
Break connection_consider_empty_buckets() out of
connection_read_bucket_decrement().


svn:r2698
2004-11-07 01:33:06 +00:00
Roger Dingledine
6c61ed4fb5 Make options no longer a global variable.
Now we can try setting an option but back out if it fails to parse, or
  if it's disallowed (e.g. changing RunAsDaemon from 1 to 0).
Use parse_line_from_str rather than parse_line_from_file.


svn:r2692
2004-11-06 05:18:11 +00:00
Roger Dingledine
2ba3a9de16 make the default default options.FirewallPorts be the default
svn:r2683
2004-11-04 23:39:57 +00:00
Roger Dingledine
f7a30fa73e break out validate_options
leave options.FirewallPorts NULL if it's NULL


svn:r2673
2004-11-04 10:23:30 +00:00
Nick Mathewson
451f8b5045 - Implement all of control interface except authentication, setconfig,
and actually making the sockets.
- Make sure that identity-based nicknames start with $.
- Use new string_join interface.


svn:r2661
2004-11-03 18:33:07 +00:00
Roger Dingledine
e541319dcb lay the groundwork for a default value for each config option.
tolerate null exitnodes, entrynodes, etc config options.


svn:r2655
2004-11-03 10:08:44 +00:00
Roger Dingledine
51e16233cb Fix paul gardner's assert bug. Turns out when circuit_launch_by_nickname()
failed at the first hop, it would try to relaunch another circ right
then, even though the first circuit hadn't been populated yet with its
pending_final_cpath.


svn:r2624
2004-10-30 05:04:52 +00:00
Nick Mathewson
2fbf31533b Tricksy compiler warnings! We hates them, hates them forever, my precious!
svn:r2615
2004-10-27 21:14:11 +00:00
Nick Mathewson
44d4516155 Use tor_snprintf, not snprintf
svn:r2609
2004-10-27 06:37:34 +00:00
Nick Mathewson
bc62f8e983 Replace sprintf with snprintf
svn:r2602
2004-10-27 05:53:07 +00:00