Commit Graph

2608 Commits

Author SHA1 Message Date
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
b004eda10c Enable NT service code by default
svn:r3780
2005-03-19 01:04:05 +00:00
Thomas Sjögren
7c29b65466 removing the warning about port 80.
svn:r3773
2005-03-18 16:34:56 +00:00
Thomas Sjögren
b1ceb1fb22 add "warning" about port 80 to torrc.sample.in
svn:r3772
2005-03-18 16:30:29 +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
be38e0a490 Fix a fun windows bug: apparently windows stat wants paths not to end with slash.
svn:r3766
2005-03-16 00:04:59 +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
Thomas Sjögren
932252f9b4 Show people where they can find the default exit policy.
svn:r3762
2005-03-14 23:26:41 +00:00
Roger Dingledine
316afb6d09 fix an assert trigger in cvs: if a resolve request fails, and the circuit
has vanished in the meantime, then we would both mark it for close
(i.e. put it on the closeable list) and also immediately free it.


svn:r3759
2005-03-14 04:42:52 +00:00
Nick Mathewson
0197b47ce9 Fix some more obscure compiler warnings
svn:r3758
2005-03-14 03:28:46 +00:00
Nick Mathewson
97dad670ea Renormalize whitespace
svn:r3757
2005-03-14 03:18:35 +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
cabb8624e2 bugfix: now that we don't do the client dns thing, our checks
to see if somebody was contradicting his exit policy were wrong.


svn:r3755
2005-03-13 05:53:17 +00:00
Roger Dingledine
01f0b31432 ShutdownWaitLength should be an interval, not a uint
svn:r3753
2005-03-12 20:16:52 +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
2b7907ef42 Increment step of a for loop should only happen once.
svn:r3746
2005-03-11 21:42:32 +00:00
Nick Mathewson
777d3dde0c Get address map resetting implemented.
svn:r3745
2005-03-11 21:39:39 +00:00
Nick Mathewson
b17bb918ac Remove unused macro; add a comment on remaining macros.
svn:r3744
2005-03-11 21:38:06 +00:00
Roger Dingledine
5254c4e63a remove duplicate function prototype
svn:r3743
2005-03-11 20:47:23 +00:00
Geoff Goodell
af15c711c9 redefining default exit policy as per or-talk discussion
svn:r3739
2005-03-11 05:07:31 +00:00
Nick Mathewson
99cc6bae0d Fix error codes to work on windows
svn:r3738
2005-03-10 18:48:13 +00:00
Nick Mathewson
6394f77edb Initialize msg_len
svn:r3737
2005-03-10 18:46:11 +00:00
Nick Mathewson
aaf70df3bd Fix signed/unsigned warning
svn:r3736
2005-03-10 18:45:42 +00:00
Nick Mathewson
37a478bd78 Tell windows how big time_t is.
svn:r3735
2005-03-10 18:45:18 +00:00
Nick Mathewson
a308353600 Fix const-ness warning
svn:r3733
2005-03-10 06:15:46 +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
4b5e213a0b Separate reverse-virtual-address-map entries into ipv4 and hostname slots. Otherwise if you ask me to map "some IPv4 address" to foo.onion, I might tell you that I already mapped "bar.virtual" to foo.onion
svn:r3730
2005-03-02 22:01:10 +00:00
Nick Mathewson
5315b61e13 Fix some log messages to refer to correct control type.
svn:r3729
2005-03-02 21:59:36 +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
e14f812a67 Still more code to make sure we send the right number and kind of RELAY END cells
svn:r3723
2005-03-02 03:13:05 +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
83743d64ab Change version parsing logic: a version is "obsolete" if it is not recommended and (1) there is a newer recommended version in the same series, or (2) there are no recommended versions in the same series, but there are some recommended versions in a newer series. A version is "new" if it is newer than any recommended version in the same series.
svn:r3716
2005-03-01 01:44:57 +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
b961d1c3bd disable the reachability detection stuff in cvs, so people can
run servers from cvs while i'm gone.


svn:r3712
2005-02-28 09:39:12 +00:00
Nick Mathewson
c5091e7134 When copying routerinfo, copy descriptor too to prevent later double-free.
svn:r3711
2005-02-28 03:37:27 +00:00
Nick Mathewson
97bc49bd72 Try a little harder to avoid openssl SSL* double-free reports.
svn:r3710
2005-02-28 02:52:51 +00:00
Nick Mathewson
0a2be3c9d8 Fix strmap_free to release memory actually held by the strmap.
svn:r3708
2005-02-28 02:21:40 +00:00
Roger Dingledine
b3177d509e free some more memory at shutdown
svn:r3707
2005-02-28 01:59:18 +00:00
Nick Mathewson
bed6c05453 give a better warning when tor points at an https server.
svn:r3706
2005-02-28 01:55:09 +00:00
Roger Dingledine
25ff3a5042 fix bug in control mapaddress
svn:r3705
2005-02-27 23:20:48 +00:00
Roger Dingledine
3cef60a0f7 fix a minor memory leak
svn:r3704
2005-02-27 22:08:01 +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
8efb2a957d Make sure that router_get_by_* can always return "me"
svn:r3702
2005-02-27 07:23:42 +00:00
Nick Mathewson
2be0508f0d Be specific about which "illegal character" we just saw in the cert.
svn:r3699
2005-02-25 21:05:42 +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
8396105d84 Implement some of GETINFO control message
svn:r3694
2005-02-25 06:37:07 +00:00
Nick Mathewson
81d2c2d8e5 Stub functions for new control-spec logic.
svn:r3693
2005-02-25 06:16:28 +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
6329811a88 fix a seg fault from tor_free_all
svn:r3690
2005-02-24 23:01:26 +00:00
Nick Mathewson
24d7ae6fe8 Insert missing ! in assert_connection_ok; test was accidentally reversed in revision 1.329 yesterday. Should fix bug 102
svn:r3685
2005-02-24 17:08:27 +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
8054f82992 stop a potential overflow (pointed out by ilja)
svn:r3681
2005-02-24 10:22:00 +00:00
Nick Mathewson
2adee31a26 Improve log message on unrecognized encoding to indicate that we can cope.
svn:r3676
2005-02-23 22:14:34 +00:00
Nick Mathewson
22c38b0f9b Clarify comment. Use CONN_IS_EDGE more. Try to be more zealous about calling connection_edge_end when things go bad with edge conns in connection.c
svn:r3671
2005-02-23 20:35:26 +00:00
Nick Mathewson
69a36e352e clarify comment
svn:r3667
2005-02-23 06:46:54 +00:00
Nick Mathewson
e0387d1322 Addressmap tweak: Make "addressmap x x" remove any mapping from the address x.
svn:r3666
2005-02-23 06:40:48 +00:00
Nick Mathewson
2ff6cfccd6 Forward-port fix to make dual-purpose NT executable work.
svn:r3665
2005-02-23 05:34:25 +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
6e6d95b3db Change from inet_ntoa to a threadproof tor_inet_ntoa.
svn:r3656
2005-02-22 08:18:36 +00:00
Nick Mathewson
e8da6b26b6 Note a non-bug in read_file_to_str as used. If we start to rely on it behaving differently, we need to change how it behaves. [Noticed by Chris Palmer]
svn:r3655
2005-02-22 07:18:46 +00:00
Nick Mathewson
d37f4dd8a9 But on windows, localtime and gmtime _are_ threadsafe.
svn:r3654
2005-02-22 07:09:17 +00:00
Nick Mathewson
70c3580f81 Patch to localtime/gmtime handling: use the _r variants where available. Use mutexes to fake _r where necessary. Make mutexes no-ops where no threading is enabled.
svn:r3653
2005-02-22 07:03:03 +00:00
Nick Mathewson
d01718841e Remove assumptions that maximum path length is anything like 1024. From comments by Chris Palmer
svn:r3652
2005-02-22 06:38:39 +00:00
Nick Mathewson
bb53a0bddd remove spurious semicolons
svn:r3650
2005-02-22 04:55:19 +00:00
Nick Mathewson
d060f845f2 Snarf some logic from python, adapted to our own needs, to handle gethostbyname_r correctly across platforms.
svn:r3649
2005-02-22 04:50:31 +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
Nick Mathewson
c2d5b67dd2 After we successfully connect, try handling pending stuff immediately, rather than waiting for the next call to connection_handle_write. Roger: is this right?
svn:r3647
2005-02-22 03:02:33 +00:00
Nick Mathewson
e673536e3f Print uname on start of unittests.
svn:r3646
2005-02-22 03:01:31 +00:00
Nick Mathewson
1a55422006 Fix windows build: juggle }s and #endifs around in main.c
svn:r3645
2005-02-22 02:57:43 +00:00
Nick Mathewson
6bd81c9ee2 Fix windows build: do not spuriously include openssl where not needed; handle lack of gethostbyname_r properly.
svn:r3644
2005-02-22 02:51:55 +00:00
Roger Dingledine
8991af604c make the addressmap internals less noisy
svn:r3643
2005-02-22 00:55:50 +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
Roger Dingledine
b5bddd8cfd bugfix: actually use the argument to strmap_free()
svn:r3640
2005-02-20 23:12:20 +00:00
Roger Dingledine
38f53cff41 forward-port the onion queue thing
svn:r3639
2005-02-20 09:27:48 +00:00
Roger Dingledine
596d65ec3b avoid case (not yet triggered) where smartlists could grow out
of control


svn:r3636
2005-02-19 03:02:33 +00:00
Roger Dingledine
cbb4803ec8 forward-port some fixes
svn:r3631
2005-02-17 01:12:50 +00:00
Roger Dingledine
797419a62c remove unused code
svn:r3629
2005-02-16 02:06:54 +00:00
Nick Mathewson
0289144229 Fix another crash bug found by Jaroslaw--it is possible for dns_resolve to mark a connection to be freed, if the circuit it was attached to fails for some reason.
svn:r3623
2005-02-14 21:16:27 +00:00
Nick Mathewson
aac97a3c6a Tell openssl how to use locks and how to find thread ids -- this may prevent race conditions surrounding the error queue.
svn:r3622
2005-02-13 22:32:25 +00:00
Nick Mathewson
427e246a10 Add a missing prototype to or.h
svn:r3621
2005-02-13 22:31:26 +00:00
Nick Mathewson
d90ab823ea remove redundant unpack in critical path
svn:r3620
2005-02-13 16:17:32 +00:00
Nick Mathewson
f6221b695f Apply windows patch from Dmitri Bely
svn:r3617
2005-02-12 21:03:37 +00:00
Nick Mathewson
58540dde50 Do not try to double-aquire lock when rotating keys. May fix deadlock bug found by weasel.
svn:r3616
2005-02-11 07:56:10 +00:00
Nick Mathewson
5d836c8140 Free tls resources on exit too
svn:r3615
2005-02-11 01:41:19 +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
33569e40d7 if we're hibernating and we get a sigint, exit immediately.
closes bug 91.


svn:r3611
2005-02-10 07:34:19 +00:00
Roger Dingledine
236aa86ae7 stop picking unverified dir mirrors, ever.
it only leads to misery.


svn:r3610
2005-02-10 07:00:23 +00:00
Roger Dingledine
37ca621301 when a client asks us for a dir mirror and we don't have one,
launch an attempt to get a fresh one.


svn:r3609
2005-02-10 06:31:34 +00:00
Roger Dingledine
07a3307460 remove redundant lines
svn:r3607
2005-02-09 23:54:30 +00:00
Nick Mathewson
89d422914a Patch from adam langley: always remove sockets from libevent before closing them. Should fix epoll-related bugs.
svn:r3606
2005-02-09 23:16:31 +00:00
Roger Dingledine
c5c46d6fb6 don't list version in the win32 service display name or service name,
since they'll keep changing and people will get messed up about which
one is installed.


svn:r3592
2005-02-09 02:26:24 +00:00
Nick Mathewson
a64b03a4fd Avoid double-free on tor-resolve failure
svn:r3567
2005-02-05 23:55:21 +00:00
Nick Mathewson
bb32fa86d7 Re-normalize whitespace; make "make check-spaces" happy
svn:r3566
2005-02-05 21:42:46 +00:00
Nick Mathewson
24ad6542c9 forward-port NT service patch
svn:r3565
2005-02-05 21:40:25 +00:00
Nick Mathewson
322c728e97 Fix tor-resolve implementation to prevent crashes and send resolves when we should.
svn:r3561
2005-02-05 21:03:24 +00:00
Roger Dingledine
56d4b99491 forward-port the logic skew and double-free thing
svn:r3549
2005-02-04 01:49:58 +00:00
Nick Mathewson
915202048e Handle return value from getaddrinfo properly
svn:r3526
2005-02-03 23:13:36 +00:00
Roger Dingledine
efa9bb5535 fix the latest bug: don't explode when some router declares a
bandwidthburst of 500 gigabytes.

this bug seems to have taken down most of the network. oops.


svn:r3523
2005-02-03 22:58:22 +00:00
Nick Mathewson
a035032f09 Use getaddrinfo and gethostbyname_r where available. Note that these are not necessarily threadsafe: this needs more thinking. Perhaps we should back down on this multithreading idea.
svn:r3522
2005-02-03 21:31:04 +00:00
Nick Mathewson
e4b21c97f7 Forward-port SGI Compatibility patches from Jan Schaumann
svn:r3517
2005-02-03 19:59:10 +00:00
Roger Dingledine
051cda803e point out a potential thread/process leak problem when we're out of memory
svn:r3512
2005-02-03 07:35:24 +00:00
Roger Dingledine
bcece3d8a7 another minor fix
svn:r3511
2005-02-03 07:30:00 +00:00
Peter Palfrader
ddd724ef94 Add --with-dmalloc configure option
svn:r3508
2005-02-03 07:25:10 +00:00
Peter Palfrader
dfa3a0220f Write a function header for Roger so he can fill it with life
svn:r3507
2005-02-03 07:23:48 +00:00
Roger Dingledine
f3b74a2adb http://www.erlenstar.demon.co.uk/unix/faq_2.html says we
should call _exit, not exit, from child processes.


svn:r3506
2005-02-03 06:40:06 +00:00
Roger Dingledine
f575d29a59 note a bug that wmf just found
svn:r3503
2005-02-02 06:28:45 +00:00
Roger Dingledine
c1656f41b4 bugfix: tor-resolve requests were ignoring .exit if there was
a working circuit they could use instead.


svn:r3502
2005-02-02 06:26:52 +00:00
Roger Dingledine
0551e3a814 reject more default filesharing ports by default.
svn:r3500
2005-02-02 04:15:40 +00:00
Roger Dingledine
976bee4a3f only check if exit_policy_implicitly_allows if you're a server.
also, put a comment next to an interesting undocumented 'feature'.


svn:r3499
2005-02-02 01:59:16 +00:00
Roger Dingledine
0f5a198028 sometimes, a conn on the closeable_lst gets absolutely
clobbered. maybe this will help me find out why.


svn:r3498
2005-02-02 00:19:09 +00:00
Roger Dingledine
850c300e46 bump the default rate limit to 1 MB
svn:r3494
2005-02-01 13:44:10 +00:00
Roger Dingledine
b90983e44f reject odd-looking addresses at the client, rather than having
the server drop them because they're malformed.


svn:r3493
2005-02-01 12:19:44 +00:00
Roger Dingledine
1447145470 give a bit more load to servers that claim to be able to
handle a whole lot.


svn:r3489
2005-02-01 02:56:31 +00:00
Roger Dingledine
1e847aebb1 Go into soft hibernation after 95% of the bandwidth is used,
not 99%. This is especially important for daily hibernators who
have a small accounting max. Hopefully it will result in fewer
cut connections when the hard hibernation starts.


svn:r3488
2005-02-01 02:45:28 +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
e7e77d6d8e fix an edge case in parsing config options (thanks weasel)
svn:r3486
2005-02-01 00:05:57 +00:00
Peter Palfrader
d19aaa9a46 Fix arma's fix for my leak
svn:r3485
2005-01-31 23:47:25 +00:00
Roger Dingledine
ab8691c343 fix a minor memory leak found by weasel
svn:r3484
2005-01-31 20:38:57 +00:00
Roger Dingledine
d232831135 stop a sigpipe.
apparently when we get an eof, at least sometimes it *does* mean
you'd better not try writing.


svn:r3481
2005-01-31 08:12:30 +00:00
Roger Dingledine
9856e328c4 stop logging loudly when a client tries an old onion key. it's
time to give up on that issue, at least for now.


svn:r3479
2005-01-31 04:03:57 +00:00
Roger Dingledine
a7138f2535 fix another rogue connection_free that was causing us troubles
there are no doubt more lurking.


svn:r3478
2005-01-31 03:47:38 +00:00
Roger Dingledine
a0312f3590 don't double-detach a closing exit conn that's waiting for dns resolve
svn:r3477
2005-01-31 01:27:49 +00:00
Roger Dingledine
692a57c8e8 but don't spring the trip on worker children, because it turns
out they don't actually remove anything before freeing the conns.


svn:r3476
2005-01-31 01:02:20 +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
75b45bcd4d stop the infinite loop of freeing the same connection_t over and
over when it's not linked into the connection_array


svn:r3474
2005-01-31 00:26:09 +00:00
Roger Dingledine
c53c7a0b4c clarify what smartlist_remove promises, since we rely on it.
svn:r3473
2005-01-31 00:24:59 +00:00
Roger Dingledine
5d8659429e be less noisy about complaining when a jap client tries to connect
and we refuse him.


svn:r3472
2005-01-30 23:52:47 +00:00
Roger Dingledine
3969b6066e Stop crashing when we're asking to close_if_marked a conn that
hasn't been connection_added yet. This happens when an exit conn
is in dns_wait and we get a relay end cell for it before it finishes.

We were silently leaking each of these marked conns in 0.0.9.x. Now
we actually free them.


svn:r3470
2005-01-30 21:47:47 +00:00
Roger Dingledine
20ecfc757b be safe: if you got a resolvefailed end cell but you're not an AP, bail.
svn:r3469
2005-01-30 21:46:42 +00:00
Roger Dingledine
7ddeb7fae7 try to find the corrupt closeable_connection_lst entry early
svn:r3468
2005-01-30 20:31:08 +00:00
Roger Dingledine
e432d2ceea we should handle the case where the client has no cert, for
backwards compatibility with jap clients.


svn:r3466
2005-01-30 08:02:33 +00:00
Roger Dingledine
cab0138e4c give a better log message when we don't have a good mirror of
the directory yet and somebody asks for it.


svn:r3464
2005-01-30 06:08:42 +00:00
Roger Dingledine
8e7fc8d259 comment about a bug wrt clock skew
svn:r3461
2005-01-30 00:07:31 +00:00
Roger Dingledine
d273891107 if we fetch the dir from a mirror that has a wildly skewed
clock, then don't bother checking recommended-versions: it will
just make us sad.

as a side effect, people running obsolete versions and whose
clocks are wildly skewed will not be auto-shut-down. but they
will still get warns about their clock skew.


svn:r3459
2005-01-29 11:48:37 +00:00
Roger Dingledine
191e52179c distinguish between "well-formed and rejected" and "not well
formed", when parsing server descriptors.


svn:r3458
2005-01-29 11:23:34 +00:00
Roger Dingledine
7fd8dfe6ea accept LDAP (389/tcp) and LDAPS (636/tcp) in default exit policy
svn:r3457
2005-01-29 11:16:23 +00:00
Roger Dingledine
82d3894f3e don't let a corrupt directory cache keep us from starting
svn:r3456
2005-01-29 11:07:35 +00:00
Roger Dingledine
0b9b97aaf4 forward-port the shutting up
svn:r3450
2005-01-28 10:00:29 +00:00
Roger Dingledine
b2fbd834f0 forward-port the dns and maxconn fixes
svn:r3448
2005-01-28 08:53:47 +00:00
Roger Dingledine
d7cee9dbf4 make the example log-to-file line use log-level notice rather than
log-level warn.


svn:r3441
2005-01-28 05:40:41 +00:00
Nick Mathewson
083b67cda5 Add rudimentary pthread support that needs more testing.
svn:r3439
2005-01-27 22:34:48 +00:00
Nick Mathewson
e03f571ee3 Forward-port win32 service patch; try to clean it a touch.
svn:r3438
2005-01-27 21:45:32 +00:00
Roger Dingledine
8ebe85333c comment SocksPort better as it pertains to servers
svn:r3413
2005-01-22 06:51:31 +00:00
Nick Mathewson
fbb7f869c5 fwd-port win32 isprint fix
svn:r3410
2005-01-22 00:42:58 +00:00
Nick Mathewson
1dc4d9a0ce Fix dumb bug in unittests.
svn:r3409
2005-01-22 00:42:40 +00:00
Roger Dingledine
2a908e5180 forward-port: fix win32 compile
svn:r3406
2005-01-22 00:35:09 +00:00
Nick Mathewson
de9b46ad64 clean a couple of messages
svn:r3401
2005-01-21 23:16:07 +00:00
Roger Dingledine
4826718eac special case so we don't yell when an empty http body doesn't specify a
content-encoding


svn:r3397
2005-01-21 03:18:49 +00:00
Roger Dingledine
b137f6d19f if we get an incredibly skewed timestamp from a dirserver mirror that
isn't a verified OR, don't complain very loudly -- it's probably him
that's wrong.


svn:r3395
2005-01-21 00:45:18 +00:00
Nick Mathewson
8115ca5f99 Log the offending policy, not the first policy
svn:r3394
2005-01-20 20:42:45 +00:00
Nick Mathewson
6704093c0d Appease another 64-bit warning
svn:r3392
2005-01-20 20:21:34 +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
5b45527851 Appease weasel's paranoid 64-bit compiler.
svn:r3389
2005-01-20 20:16:48 +00:00
Roger Dingledine
a2e441da06 give a header file for ntohs
svn:r3388
2005-01-20 20:15:14 +00:00
Roger Dingledine
67f0babfd4 start to fix http status stuff, more work needed
svn:r3387
2005-01-20 20:07:36 +00:00
Nick Mathewson
80e8359ccf Give better reason phrases in HTTP status lines. Start resolving task #67. (Messages still need to be better.)
svn:r3386
2005-01-20 19:46:02 +00:00
Nick Mathewson
29b6637a62 Compilation fixes for win32 version detection.
svn:r3385
2005-01-20 19:03:09 +00:00
Nick Mathewson
432e313c81 Make zlib detection happy on little-endian platforms; fix unit tests.
svn:r3384
2005-01-20 19:02:35 +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
a6e91f8157 The crowning hidden-service patch: prefer non-internal circuits
for normal connections, so we don't spend our internal circs on
other stuff and not have them when we need them.


svn:r3380
2005-01-20 07:02:24 +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
Roger Dingledine
ff48179372 make cannibalizing for rend circs prey on the pleb circs first
if possible, rather than the elite ones.


svn:r3378
2005-01-19 23:13:20 +00:00
Nick Mathewson
f8c14bbf1f Detect windows platform correctly
svn:r3377
2005-01-19 23:10:16 +00:00
Nick Mathewson
2c803bff9a Make detect_compression_method work on platforms with more evil chars.
svn:r3376
2005-01-19 23:07:43 +00:00
Nick Mathewson
1eddb28f82 Add unittests for compression detection. Make all rendezvous descriptors "plausible".
svn:r3375
2005-01-19 22:47:48 +00:00
Nick Mathewson
69fa5be7b6 Workaround for webservers that lie about Content-Encoding: Tor now tries to autodetect compressed directories and compression itself. (resolves bug 65)
svn:r3374
2005-01-19 22:40:33 +00:00
Nick Mathewson
e0bf597665 Give more useful log messages when the tor process closes dns/cpuworker connections. "Error: Success!" makes us seem like crazy people."
svn:r3373
2005-01-19 21:34:42 +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
f2a7ff6801 better comments for exit policies in torrc.sample
svn:r3371
2005-01-19 17:26:40 +00:00
Roger Dingledine
cfcc93296c bugfix for cvs: we were needing a rendezvous circ, so we cannibalized
a general circ, and called rend_client_rendcirc_has_opened(), which
called connection_ap_attach_pending(), which was needing a rendezvous
circ, so it cannibalized a general circuit, and called ...


svn:r3370
2005-01-19 17:13:11 +00:00
Roger Dingledine
bd2d740b49 make it clearer why FooPort and FooBindAddress are separate
svn:r3369
2005-01-19 06:06:04 +00:00
Nick Mathewson
7d4a167c81 Basic windows libevent fixes
svn:r3366
2005-01-18 23:44:55 +00:00
Roger Dingledine
4e369bc9e8 allow bandwidthburst to be smaller, but whine if it's small.
svn:r3364
2005-01-18 19:34:22 +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
372832d8fe make tor-resolve print the Tor version on --version too
svn:r3358
2005-01-16 02:21:14 +00:00
Roger Dingledine
c6771e5ce4 reset published uptime when you wake up from hibernation,
since if you hibernate daily a published uptime of >1day
will be misleading.


svn:r3356
2005-01-14 17:49:25 +00:00
Roger Dingledine
dcf8b18215 when the hidden service launches a rendezvous circ, make sure it
provides good uptime if any virtual_port of the service wants that.


svn:r3355
2005-01-14 04:35:53 +00:00
Nick Mathewson
a38bccdca7 Move call to event_init() immediately after start_daemon(); move start_daemon earlier. This should fix using libevent with RunAsDaemon.
svn:r3354
2005-01-13 21:32:08 +00:00
Roger Dingledine
0aff4ff4cb get rid of 0.0.8 backwards compatibility
svn:r3353
2005-01-13 20:22:38 +00:00
Roger Dingledine
22f7934718 start generating version 1 style introduce cells
svn:r3352
2005-01-13 20:21:11 +00:00
Roger Dingledine
49fe4cba74 when deciding if a port is handled and the port demands uptime, don't
consider it handled if there's a circ that fits but isn't high-uptime.


svn:r3349
2005-01-13 07:23:19 +00:00
Roger Dingledine
abea142665 more cleanup
svn:r3347
2005-01-12 12:22:25 +00:00
Roger Dingledine
bafb3e4a5b fix another integer underflow caused by buckets going negative
svn:r3346
2005-01-12 12:19:00 +00:00
Roger Dingledine
24a97d2c55 fix up some comments
svn:r3345
2005-01-12 12:18:46 +00:00
Roger Dingledine
3809c0ab91 tolerate bandwidtch buckets going negative (i hope)
svn:r3344
2005-01-12 10:00: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
9b578f2fe2 add more chat and interactive protocols to LongLivedPorts
svn:r3340
2005-01-12 05:18:14 +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
51f47d746e clean up smartlist_string_isin so callers don't have to manage bufs
themselves


svn:r3338
2005-01-12 04:53:53 +00:00
Roger Dingledine
70b3208f0a if somebody starts his tor server in jan 2004 and then fixes his
clock, don't make his published uptime be a year.


svn:r3337
2005-01-11 11:54:11 +00:00
Roger Dingledine
45eb8d9660 if you're a server and the auth dirservers are down, go to any other
server. only give up hope on network reachability when no other servers
are reachable either.


svn:r3335
2005-01-10 17:39:41 +00:00
Roger Dingledine
74bc4e5af0 help avoid overflow from len_in + (len_in/n)*len_ins
nick, do you think this does it? if so, we should maybe backport too.


svn:r3334
2005-01-10 16:30:51 +00:00
Roger Dingledine
4b6d55afdf separate time_of_process_start from stats_n_seconds_uptime:
now we reset uptime when a dir fetch entirely fails. this
hopefully has something to do with stability of being on the
network.


svn:r3333
2005-01-10 05:10:22 +00:00
Roger Dingledine
3370f53010 it helps to use the correct name for the struct
svn:r3331
2005-01-10 04:32:59 +00:00
Roger Dingledine
10a81ccf18 when pruning circuit-wait streams when a dir fetch failed,
refer in logs to the destination address, not the address of the
application connection.


svn:r3330
2005-01-10 02:47:50 +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
608caffc64 fix unit tests: address has to be a non-private IP, and socksport
needs to be 0.


svn:r3324
2005-01-07 01:12:30 +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
Roger Dingledine
f8b517fa97 finish marking my comment in main.c
svn:r3318
2005-01-06 19:20:54 +00:00
Roger Dingledine
1f51809e65 clean up string printing in relay logs
svn:r3317
2005-01-06 19:19:13 +00:00
Roger Dingledine
6d2859c2e5 fix trivial typo in log entry
svn:r3316
2005-01-06 19:17:01 +00:00
Nick Mathewson
a6e587305f typo spotted by chris
svn:r3308
2005-01-05 06:48:39 +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
e99f79fa4d Remove broken and undocumented wart where multiple CSV config lines are appended rather than replaced. Resolves bug #49
svn:r3301
2005-01-05 02:51:04 +00:00
Roger Dingledine
814dd946f0 fix duplicate dns_cancel_pending_resolve reported by Giorgos Pallas
svn:r3293
2005-01-04 11:26:08 +00:00
Roger Dingledine
ba7c74e742 bandaid: make Giorgos Pallas's dns assert bug not actually crash on him.
one day we should try to figure out what's actually going on here.


svn:r3280
2005-01-04 06:21:06 +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
e6c1ab2daf post 0.0.9.x, demand that servers declare at least 20000 bytes/s
for bandwidthrate


svn:r3277
2005-01-04 03:46:50 +00:00
Nick Mathewson
4d30e2f4b8 Make sequence of log messages when starting on win32 with no config file more reasonable.
svn:r3275
2005-01-04 02:25:36 +00:00
Roger Dingledine
1f3e77bf92 make the initial temp log only notice-err, not info-err
svn:r3274
2005-01-04 02:25:18 +00:00
Roger Dingledine
82c5381ecb forward-port the fix for the compiler warning
svn:r3273
2005-01-04 01:16:20 +00:00
Roger Dingledine
d7a0f1a629 update print_usage to use new url
svn:r3267
2005-01-03 23:21:32 +00:00
Roger Dingledine
a005509c9d update url for when users try to use socksport as an http proxy
svn:r3265
2005-01-03 23:19:15 +00:00
Roger Dingledine
9e6d6c6096 Bugfix: we've been using openssl's BIO_get_mem_data incorrectly.
We assumed the pem-encoded data written by PEM_write_bio_RSAPrivateKey
is nul-terminated, and at least sometimes, it's not.


svn:r3263
2005-01-03 22:35:40 +00:00
Roger Dingledine
53c522ee1c make it clearer you can have multiple SocksBindAddress directives
svn:r3262
2005-01-03 21:47:59 +00:00
Nick Mathewson
d1fc7ad94b Log when we retry a directory connection
svn:r3258
2005-01-03 21:14:09 +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
Nick Mathewson
858eda4736 Fix an unused function warning
svn:r3255
2005-01-03 20:03:49 +00:00
Nick Mathewson
5f40d6bf72 Make directory fail-and-retry logic happen in connection_about_to_close(); fixes win32 bug.
svn:r3253
2005-01-03 19:51:10 +00:00
Nick Mathewson
b50263f740 More work on task #43: fix race conditions on multithreaded (win32) servers.
svn:r3251
2005-01-03 19:07:25 +00:00
Nick Mathewson
ead52e0bdc Possible fix for task #43: when running on a multithreaded environment (currently only windows), threads should not close opposite sides of their socketpairs, and workers should not call connection_free_all(). This may fix win32 servers.
svn:r3247
2005-01-03 18:06:51 +00:00
Nick Mathewson
fca7ba9777 Resolve task 42: find where 19-char nicknames were getting truncated when read from certs, and fix it. Also audit use of MAX_NICKNAME_LEN; no other badness found, but some docs/code cleaned up a touch.
svn:r3244
2005-01-03 17:53:20 +00:00
Roger Dingledine
59504f4831 bugfix: if a server uploads a descriptor that's unapproved, actually
tell him so.


svn:r3243
2005-01-03 17:47:32 +00:00
Roger Dingledine
70075933c6 stop checking for clock skew, even for servers.
this means we are vulnerable to an attack where somebody recovers
and uses a really old certificate. however, if they do that, they
probably can get our identity key just as easily.


svn:r3241
2005-01-03 17:10:32 +00:00
Roger Dingledine
fdf8c55f30 clarify the comments about logs in the torrc
svn:r3239
2005-01-02 06:34:58 +00:00
Roger Dingledine
b4dad0e6a4 fix the assert bug reported by bassclef@163.com
svn:r3237
2005-01-02 06:16:46 +00:00
Roger Dingledine
0d7e8660c7 add a comment to explain what ContactInfo is for
svn:r3236
2005-01-01 23:58:16 +00:00
Roger Dingledine
a4ad47df86 Fix a double-mark-for-close bug, where we were finding a conn
for a cell even if that conn is already marked for close.

Don't back-port to 0.0.9.x, since this fix could have weird implications.


svn:r3235
2005-01-01 07:54:01 +00:00
Roger Dingledine
35d5a5b712 when a dirserver causes you to give a warn, mention which dirserver it was
svn:r3234
2005-01-01 07:40:59 +00:00
Roger Dingledine
e29d7329b3 ...but only if you're a server
svn:r3233
2004-12-31 21:49:20 +00:00
Roger Dingledine
95f3e6161b require BandwidthRate to be at least 10kB/s
svn:r3232
2004-12-31 21:47:54 +00:00
Roger Dingledine
717fe4993e actually make it stop keeping track of times. whoops.
svn:r3230
2004-12-25 07:19:48 +00:00
Roger Dingledine
e1ac30c2bb stop calling assert_connection_ok(conn, time(NULL)) on every single
conn on every single loop.


svn:r3229
2004-12-25 06:43:40 +00:00
Roger Dingledine
288f2ed59e stop telling win32 folks they have a bug just because we haven't finished
making tor work on win32 yet.


svn:r3227
2004-12-25 06:42:15 +00:00
Roger Dingledine
be72937ab0 initial profiling by phobos says we spend a whole lot of time
measuring how long each cell takes to process. make that optional.


svn:r3226
2004-12-25 06:10:34 +00:00
Roger Dingledine
53105cdae5 when you're loading the rendezvous service keys in options_act(),
don't call it 'reloading'.


svn:r3225
2004-12-24 20:45:45 +00:00
Roger Dingledine
3a572fcffa don't connection_edge_end() on eof if we're already marked for close,
because if we are then it's because we already got an end.


svn:r3223
2004-12-24 09:43:57 +00:00
Nick Mathewson
ded8e79979 remove sentence-fragment comment refering to a design that never happened.
svn:r3220
2004-12-24 02:50:27 +00:00