Commit Graph

260 Commits

Author SHA1 Message Date
Roger Dingledine
f10f24a61c avoid using uninitialized variable
svn:r3086
2004-12-06 06:07:57 +00:00
Roger Dingledine
0859d09352 don't use cache for resolving .foo.exit names, but do reply immediately
if we're asked to resolve an IP.foo.exit.


svn:r3085
2004-12-06 06:06:13 +00:00
Roger Dingledine
577665f608 fix indenting
svn:r3084
2004-12-06 05:26:19 +00:00
Roger Dingledine
1c9c813866 check if we have a cached resolve for a tor-resolve address *after*
we remove the .foo.exit part of the address.


svn:r3082
2004-12-05 12:47:46 +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
2532e9405e Now we allow writing to the buffer even when the stream if marked for
close, if we're planning to wait to flush it.

This is important because we were sending a socks reject back if we're
closing and hadn't already sent one, but it wasn't actually getting
written since the conn was already marked-for-close.


svn:r3074
2004-12-04 07:13:37 +00:00
Roger Dingledine
5a6e117caf React to eof immediately on non-open edge connections.
Stop keeping track of num_retries for apconns, since they expire
after 60 seconds anyway.

When warning about retrying or giving up, print the address, so
the user knows which one it's talking about.


svn:r3073
2004-12-04 03:26:35 +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
Nick Mathewson
fc87758ff3 Add function to check that addr_policy_t is okay; change struct addr_policy_t to addr_policy_t.
svn:r3070
2004-12-04 01:14:36 +00:00
Roger Dingledine
eb558d0a84 clean up the other "Tell Roger" log that dfc keeps getting
svn:r3042
2004-11-30 09:02:25 +00:00
Roger Dingledine
1d4af1930c Let resolve conns retry/expire also, rather than sticking around forever.
Put the check-if-requested-exitrouter-will-reject-us code in the
circuit_attach loop, so it gets checked periodically and not just
once at the beginning. This is useful in case the routerlist changes,
but also in case the address gets resolved into something that we learn
we'll reject.


svn:r3039
2004-11-30 08:39:14 +00:00
Roger Dingledine
d383c23e73 refuse .exit addresses immediately if the requested node would
refuse the request (e.g. due to exit policy or wrong version)


svn:r3038
2004-11-30 08:15:09 +00:00
Nick Mathewson
a5d3325c5c Fix last patch
svn:r3031
2004-11-30 06:12:21 +00:00
Nick Mathewson
c8abe1907d Rename parse_address to parse_extended_hostname (since we have other kinds of addresses); make its output an enum; support HEXDIGEST.exit hostnames.
svn:r3029
2004-11-30 03:44:10 +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
c1dc17e6e2 put in initial support for ".nickname.exit" addresses, to let alice
decide what exit node to use; based on a patch by geoff goodell.

needs more work: e.g. it goes bananas building new circuits when the
chosen exit node's exit policy rejects the connection.


svn:r3015
2004-11-29 08:34:54 +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
Roger Dingledine
7d55f3685e make tor-resolve work, uh, more. this time for sure!
svn:r2974
2004-11-24 06:16:36 +00:00
Roger Dingledine
cca469ec58 make tor-resolve work again
svn:r2973
2004-11-24 06:01:52 +00:00
Roger Dingledine
0eebfe3558 bugfix: let socks do multiple rounds of negotiation again
(which is needed for socks5)


svn:r2970
2004-11-24 04:35:28 +00:00
Nick Mathewson
22dba27d8d Normalize a few more kinds of whitespace. We now dislike:
- func (args)
  - if (x){
This doesn't normalize if(x), for(x); while(x), and friends.


svn:r2943
2004-11-22 23:28:26 +00:00
Roger Dingledine
4f2c2c9948 The crowning bugfix.
The problem was that with high load, circuit package window was
reaching 0. Whenever we got a circuit-level sendme, we were
reading a lot on each socket, but only writing out a bit. So we
would eventually reach eof. This would be noticed and acted on
even when there are still bytes sitting in the inbuf.


svn:r2932
2004-11-21 11:30:33 +00:00
Roger Dingledine
310a8da0d2 break reached_eof() out of process_inbuf()
svn:r2930
2004-11-21 10:14:57 +00:00
Roger Dingledine
671d84dc2f some more debugging aids
svn:r2929
2004-11-21 09:39:01 +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
Roger Dingledine
a4b1eb5630 allow StrictEntryNode and StrictExitNode to be singular
svn:r2922
2004-11-20 23:16:03 +00:00
Roger Dingledine
67aa3b66c5 clean up socks handling, refuse connections to port 0
svn:r2888
2004-11-15 07:50:15 +00:00
Nick Mathewson
4f835673be Remove redundant declaration
svn:r2855
2004-11-14 17:22:10 +00:00
Nick Mathewson
5109de5626 Rename exit_policy to addr_policy, since it gets used for SOCKS and directory connections too. Make all policies get validated in options_validate, and make SOCKS/directory policies get set in options_act.
svn:r2819
2004-11-12 19:39:13 +00:00
Roger Dingledine
ab951fc828 remove extraneous variable
svn:r2765
2004-11-10 00:19:18 +00:00
Nick Mathewson
5a5be93f80 Normalize whitespace; add a "tell me about all the unnormalized whitespace" target; fix a braino in dirserv.c
svn:r2758
2004-11-09 20:04:00 +00:00
Nick Mathewson
cd753df7bf Resolve many XXXs and all DOCDOCs
svn:r2755
2004-11-09 18:22:17 +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
a4753283dd better interface for connection_ap_handshake_socks_reply()
make --list-fingerprint print the fingerprint again


svn:r2668
2004-11-03 23:13:28 +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
984ffec105 implement first piece of hibernation
still need to track bandwidth, and make decisions based on bandwidth


svn:r2630
2004-10-31 20:28:41 +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
6980929e64 Use strlcpy, not strcpy.
svn:r2610
2004-10-27 06:48:16 +00:00
Nick Mathewson
44d4516155 Use tor_snprintf, not snprintf
svn:r2609
2004-10-27 06:37:34 +00:00
Nick Mathewson
c7151d8bed Add "pass" target for RedirectExit, to make it easier to break out of a sequence of rules
svn:r2566
2004-10-19 17:46:06 +00:00
Roger Dingledine
97a0a43511 start the process of making 0.0.7* obsolete
svn:r2565
2004-10-17 21:51:20 +00:00
Roger Dingledine
640544ae3e use connection_edge_is_rendezvous_stream() more
svn:r2564
2004-10-17 21:10:41 +00:00
Roger Dingledine
695cdb10fe whoops, resolve cells were probably broken
svn:r2562
2004-10-17 20:31:19 +00:00
Nick Mathewson
8d27385c23 Implement RedirectExit.
svn:r2550
2004-10-17 01:57:34 +00:00
Roger Dingledine
aebc3a03ba more int to size_t conversions, fixing one or more amd64 bugs
plus a whitespace patch on config.c from vicman


svn:r2482
2004-10-14 02:47:09 +00:00
Nick Mathewson
0383afac9a Use parse_addr_port() function instead of ad-hoc variants
svn:r2441
2004-10-12 15:52:09 +00:00
Roger Dingledine
6468e049be when a begin cell has an invalid port, give us a better hint of
what went wrong


svn:r2435
2004-10-10 01:47:24 +00:00