Commit Graph

2192 Commits

Author SHA1 Message Date
Nick Mathewson
3893b3c7ac Patch for task 133
svn:r4189
2005-05-10 22:33:45 +00:00
Nick Mathewson
d0c0d6c86a Apply patch from Geoff for bug 132. Clean it up a little to fix a memory leak and to avoid unnecessary parse/unparse code.
svn:r4188
2005-05-10 22:12:48 +00:00
Nick Mathewson
13126eeb0f Patch from goodell for task 131: Do not die on internal address if we are not publishing.
svn:r4186
2005-05-09 04:31:00 +00:00
Nick Mathewson
10b2208d93 Make Tor compile with no warnings with gcc4.0 on OSX
svn:r4184
2005-05-07 05:55:06 +00:00
Nick Mathewson
6567ec9ccf Functions work better when you call them. Resolve a bug which would prevent unreachable dirports from getting suppressed.
svn:r4183
2005-05-07 05:17:36 +00:00
Nick Mathewson
bc51c8b074 Implement --verify-config command-line option to fix bug 69.
svn:r4182
2005-05-07 04:49:09 +00:00
Roger Dingledine
cee7c5988c fix massive memory leak
(50 megabytes over a couple of days, on the dirservers)


svn:r4181
2005-05-06 08:53:23 +00:00
Roger Dingledine
cc0b19888d log buffer sizes on kill -usr1 too.
svn:r4180
2005-05-06 08:32:37 +00:00
Roger Dingledine
1f263bf6f5 whine at you if you're a server and you don't set your contactinfo
svn:r4178
2005-05-04 20:45:38 +00:00
Roger Dingledine
68ba303323 fix compile error if you're not multithreaded
svn:r4177
2005-05-03 18:44:20 +00:00
Roger Dingledine
6ea839265d remove archaic debugging aid that was probably unsafe
svn:r4176
2005-05-03 10:17:38 +00:00
Roger Dingledine
87850c47b0 cleanup now that 0.0.9pre1 is obsolete
svn:r4175
2005-05-03 10:12:08 +00:00
Roger Dingledine
5265bbd2b8 first iteration of scrubbing sensitive strings from logs.
also generally clean up log messages.


svn:r4174
2005-05-03 10:04:08 +00:00
Nick Mathewson
b35f7dacef Call tor_free_all instead of connections_free_all after forking
svn:r4173
2005-05-03 03:51:20 +00:00
Nick Mathewson
8b9ae25224 Change some >=s to >s in buf_resize, so that we do not denormalize buffers on resize.
svn:r4172
2005-05-03 03:25:04 +00:00
Nick Mathewson
4666b801fa If DataDir is ~/.tor, and that expands to /.tor, then default to LOCALSTATEDIR/tor instead.
svn:r4170
2005-05-03 00:36:57 +00:00
Nick Mathewson
14bac4dad4 Elaborate on buf_shrink comment.
svn:r4169
2005-05-02 23:41:39 +00:00
Roger Dingledine
aa6bcd50ca comment buf_shrink
svn:r4168
2005-05-02 23:39:09 +00:00
Nick Mathewson
ad547cbb8c Correct and simplify buf_shrink logic
svn:r4167
2005-05-02 23:36:13 +00:00
Nick Mathewson
d6a6c8785b When removing all bytes from a buffer, reset buf->cur=buf->mem
svn:r4166
2005-05-02 23:32:23 +00:00
Nick Mathewson
a312ce1d3b Change buffer shrinking strategy: only try to shrink once every 3 minutes. Do not try to read over buffer size unless buffer is nearly empty.
svn:r4165
2005-05-02 23:17:08 +00:00
Nick Mathewson
9c683c7613 Make buffer shrinking algorithm a little smarter.
svn:r4164
2005-05-02 22:49:24 +00:00
Nick Mathewson
830ac87611 Actually, dont send CREATE_FAST cells at all for now
svn:r4163
2005-05-02 22:39:59 +00:00
Nick Mathewson
ab34901263 New and frightening code to implement fast-path first-hop CREATE_FAST cells. Watch out when we bump the version to 0.1.0.6-rc!
svn:r4162
2005-05-02 22:35:18 +00:00
Roger Dingledine
978648bff8 also print the platform string for rejected descriptors
svn:r4160
2005-05-02 22:06:04 +00:00
Roger Dingledine
15c1853bd6 don't print nulls
svn:r4159
2005-05-02 21:54:16 +00:00
Roger Dingledine
c9e83eb1b4 when we refuse a router descriptor, log contactinfo and source address.
svn:r4156
2005-05-02 21:48:54 +00:00
Roger Dingledine
57b7427c2d reformat routerparse a bit
svn:r4155
2005-05-02 21:48:25 +00:00
Nick Mathewson
69dc4e1675 Remove support for looking at old directory/routerdesc elements; mark non-new elements optional; switch to new format for dir-signing-key; start accepting newer elements so we can mark them as non-opt later; make tor-spec say the right stuff.
svn:r4154
2005-05-02 21:22:31 +00:00
Roger Dingledine
729e720095 workaround for user error: some people were putting "Address " in their
torrc, and they had a buggy resolver that resolved " " to 0.0.0.0. Oops.


svn:r4150
2005-04-29 18:52:05 +00:00
Nick Mathewson
fe65e57ca1 Re-do fragmented control message handling to work with new buf_t system.
svn:r4144
2005-04-27 22:01:34 +00:00
Nick Mathewson
d0a9a8bdd3 Appease VC7. It has a strangely puritanical attitude about what programmers are allowed to do a consenting void*.
svn:r4140
2005-04-27 20:02:52 +00:00
Nick Mathewson
53607d3bb3 Turn SENTINELS back on; give NOINLINE a name and turn it off.
svn:r4139
2005-04-27 19:40:31 +00:00
Roger Dingledine
4c4a14e3cb turn off the mongo debugging stuff, for performance tests
svn:r4137
2005-04-27 17:21:42 +00:00
Roger Dingledine
543d31c89a bump the default bandwidthrate from 1mb to 2mb
svn:r4131
2005-04-27 04:13:59 +00:00
Nick Mathewson
52376dc9e8 Rename buf->start to buf->cur; fix bug in read_to_buf; still debug with paranoia.
svn:r4130
2005-04-27 02:55:21 +00:00
Nick Mathewson
746768df5d Add even more debugging code; temporarily disable inlines in buffers.c
svn:r4129
2005-04-27 00:53:44 +00:00
Roger Dingledine
914ee87e07 stop re-reading and re-parsing the directory as soon as we make it.
it was nice for checking if we've got bugs, but it's really quite
expensive too. it was also nice for updating our routerinfo's
immediately, but we'll update them like everybody else when we fetch
a new dir from somebody else.


svn:r4128
2005-04-27 00:48:05 +00:00
Roger Dingledine
adaf3d31e6 hidden service client connections were using some of their
60 seconds fetching the hidserv descriptor, which made them
more likely to fail on the first attempt, yet they work fine
on the second. so now give them extra time for the first try.


svn:r4127
2005-04-26 22:36:00 +00:00
Roger Dingledine
2a7aec0ffd fix function prototype, fix typo
svn:r4126
2005-04-26 21:29:20 +00:00
Nick Mathewson
ecc76d8245 Avoid overflow on wrapping a TLS read.
svn:r4125
2005-04-26 21:20:22 +00:00
Nick Mathewson
e6794e5808 Fix unit tests for buffers.
svn:r4124
2005-04-26 21:10:31 +00:00
Nick Mathewson
9ba2dd7ea1 Clean/renormalize whitespace
svn:r4122
2005-04-26 20:55:32 +00:00
Nick Mathewson
ef2409e4ed Change the implementation of buf_t a lot: make it a ring buffer to minimize memmove on flush. This may break the universe, but it is probably Necessary For Perfomance.
svn:r4121
2005-04-26 20:53:22 +00:00
Roger Dingledine
4eb3cf9330 a bit more debug info
svn:r4119
2005-04-26 20:05:15 +00:00
Roger Dingledine
953cf91ecd add more debugging info to help us find the weird dns freebsd pthreads bug.
svn:r4117
2005-04-26 19:08:06 +00:00
Roger Dingledine
509405a5f7 clean up this TOR_FRAGILE business
svn:r4116
2005-04-26 18:52:16 +00:00
Roger Dingledine
5e86e87124 Add basic HttpsProxyAuthenticator support, based on patch
from Adam Langley.


svn:r4115
2005-04-26 18:33:33 +00:00
Roger Dingledine
4fafa81f32 help debug: when we close a conn due to timeout, tell us its
file descriptor, not its connectionarray index.


svn:r4113
2005-04-25 17:24:16 +00:00
Roger Dingledine
662cfc976d only call the connection open once we've decided we like the cert.
svn:r4112
2005-04-25 17:23:52 +00:00
Roger Dingledine
f3ea883ccd bugfix: stop trying to print a null pointer if an OR conn fails
because we didn't like its cert.


svn:r4111
2005-04-25 15:43:37 +00:00
Roger Dingledine
12ea3a26b2 bugfix: make a debug log stop lying
svn:r4110
2005-04-25 15:43:05 +00:00
Roger Dingledine
92b970d2a6 only complain about wedged cpuworkers after an hour, not 100 secs
svn:r4100
2005-04-23 20:58:44 +00:00
Roger Dingledine
6128cdead0 let NumCpus be singular without whining
svn:r4097
2005-04-23 19:29:09 +00:00
Nick Mathewson
5827e2e216 Fix "JAP-client" hideous ASN1 bug, twice. (Fix1: check more thoroughly for TLS errors when handling certs. Fix2: stop assert(0)ing on uncaught TLS errors.)
svn:r4085
2005-04-23 14:26:02 +00:00
Roger Dingledine
ad4eca60ec add geoff's NoPublish patch
svn:r4084
2005-04-21 10:40:48 +00:00
Nick Mathewson
ce9995a579 Replace an infinite-stack-recursion bug with a generate-infinite-debug-messages bug. Maybe it isnt such a good idea to send LOG_DEBUG messages to the controller after all?
svn:r4082
2005-04-17 22:52:02 +00:00
Nick Mathewson
cf84759b4b zero-out errno before calling event_dispatch, just in case we have misdiagnosed poll(2)/EINVAL bug.
svn:r4081
2005-04-17 22:38:39 +00:00
Roger Dingledine
769541ff7e be willing to load balance over up to 2mB, not 1mB, of advertised capacity
svn:r4080
2005-04-12 22:09:47 +00:00
Roger Dingledine
bf79b5266f those should be notices, not warns
svn:r4079
2005-04-12 22:09:04 +00:00
Nick Mathewson
f1dfa30064 Fix postdescriptor behavior: on non-complete success, only say "done" once.
svn:r4073
2005-04-11 02:52:09 +00:00
Roger Dingledine
e2cdc87485 remove some redundant code
svn:r4062
2005-04-08 06:16:09 +00:00
Nick Mathewson
656e31ba33 If it has not been 100 seconds since we told the cpuworker about an onion, complain! Oh, wait...
svn:r4059
2005-04-08 04:59:34 +00:00
Nick Mathewson
74dc7eedc5 Add kludgy function to force controllers to flush EVENT_ERR_MSG events.
svn:r4057
2005-04-08 03:36:39 +00:00
Nick Mathewson
31c12e265f Move a quote, fix a log.
svn:r4056
2005-04-08 03:26:44 +00:00
Nick Mathewson
c6769a80fb Fixs a signed/unsigned comparison
svn:r4055
2005-04-08 03:26:23 +00:00
Nick Mathewson
6face4f482 Add missing "char"
svn:r4054
2005-04-08 03:07:07 +00:00
Roger Dingledine
97637549bb tie MAX_DIR_SIZE to MAX_BUF_SIZE
resolve bug 80


svn:r4052
2005-04-07 22:13:17 +00:00
Roger Dingledine
dabafddb82 fix format bug
svn:r4051
2005-04-07 22:03:56 +00:00
Roger Dingledine
ec3650f00f only whine about clock skew from the dirserver if he's a trusted
dirserver.


svn:r4048
2005-04-07 21:09:19 +00:00
Nick Mathewson
8cc3307e0d Improve conn_*_to_string; add circuit_state_to_string; make skewed-descriptor messages better.
svn:r4047
2005-04-07 21:07:19 +00:00
Roger Dingledine
dd98412ce1 allow servers to publish descriptors from 12 hours in the future.
hopefully this will allow more slack and let crummier servers help
out too.


svn:r4046
2005-04-07 21:01:00 +00:00
Nick Mathewson
b897cb1ec3 Change conn_(type|state)_to_string from const arrays to switch functions so we (I) will not make Tor crash the next time we (I) add a new state.
svn:r4045
2005-04-07 20:25:22 +00:00
Roger Dingledine
6bdfd97272 add function comment
svn:r4043
2005-04-07 20:07:34 +00:00
Roger Dingledine
ab8a0bb52c We have a bug that I can't find. Sometimes, very rarely, cpuworkers get
stuck in the 'busy' state, even though the cpuworker process thinks of
itself as idle. I don't know why. But here's a workaround to kill any
cpuworker that's been busy for more than 100 seconds.


svn:r4042
2005-04-07 20:02:00 +00:00
Nick Mathewson
c92a2620d4 Try RB_TREE instead of SPLAY_TREE, but with a single-entry caching optimization.
svn:r4041
2005-04-07 05:09:19 +00:00
Nick Mathewson
a035b8e3c3 Make compare_orconn_circid_entries marginally faster and inlined, if that helps
svn:r4040
2005-04-07 04:50:25 +00:00
Nick Mathewson
7709547c08 When we connect and finish TLS negotiation with address:port, it is obvious that any other key or nickname we might know about (as an authdirserver) does not actually exist at address:port.
svn:r4036
2005-04-06 21:09:47 +00:00
Roger Dingledine
03720b39fd stop wasting time doing a case insensitive comparison for every dns name
every time we do any lookup. canonicalize the names to lowercase and be
done with it.


svn:r4035
2005-04-06 20:25:21 +00:00
Roger Dingledine
46089c49c4 blow away most calls to assert_all_pending_dns_resolves_ok, since
they're eating our cpu.


svn:r4034
2005-04-06 20:05:34 +00:00
Roger Dingledine
652dde72f1 bugfix: chdir to your datadirectory at the *end* of the
daemonize process, not the beginning. this was a problem
because the first time you run tor, if your datadir isn't
there, and you have runasdaemon set to 1, it will try to
chdir to it before it tries to create it. oops.


svn:r4033
2005-04-06 19:07:38 +00:00
Roger Dingledine
8596947ee2 quiet another instance where we whine to an innocent OR operator's
logs when some other server switches keys unexpectedly.


svn:r4032
2005-04-06 18:55:14 +00:00
Roger Dingledine
620419b421 oh, and accept() into the right place, too.
svn:r4029
2005-04-06 16:16:31 +00:00
Roger Dingledine
70f3b3ef86 Forward-port the checking of
sin_addr.s_addr == 0 || sin->sin_port == 0.
This just happened on moria2, so I guess it happens rarely
on Linux as well as OS X.
We can't afford to accept OR conns from 0.0.0.0:0, since we
send created cells back to the first addr:port that matches,
and we'd better not send them to the wrong place.
So, let's drop them all for now, and see if we can find a pattern
later.


svn:r4028
2005-04-06 15:42:35 +00:00
Roger Dingledine
9cbaf4603d fix an assert trigger: when we have the rare case of accepting
a conn on 0.0.0.0:0, then when we look through the connection array,
we'll find any of the workers. this is no good.


svn:r4027
2005-04-06 15:19:32 +00:00
Nick Mathewson
88dc243bb5 Rename circuit_get_by_stream to circuit_get_by_edge_conn, and actually start using it. Watch out, kids!
svn:r4026
2005-04-06 06:43:21 +00:00
Roger Dingledine
716d9bc99a when using preferred entry or exit nodes, ignore whether
the circuit wants uptime or capacity. they asked for the
nodes, they get the nodes.


svn:r4025
2005-04-06 06:17:35 +00:00
Nick Mathewson
4453e3794a Add a pointer from edge connections to their corresponding circuit (ulp!); add some debugging sanity-checking for cirid_orconn_map stuff
svn:r4024
2005-04-06 06:13:49 +00:00
Nick Mathewson
2a0b1025e5 Fix bug in last commit when no circid can be found
svn:r4023
2005-04-06 05:45:07 +00:00
Nick Mathewson
b34d9adb59 Fix format warning
svn:r4022
2005-04-06 05:44:05 +00:00
Roger Dingledine
94cecc712d note some features we intend to add.
svn:r4021
2005-04-06 05:35:06 +00:00
Nick Mathewson
b7cdcf3462 Hopefully, this will make ORs much faster, and not break them: keep a big splay tree of (circid,orconn)->circuit mappings to make circuit_get_by_circid_conn much faster.
svn:r4020
2005-04-06 05:33:32 +00:00
Roger Dingledine
712d05c19a a bit more data on gene's dns threading bug
svn:r4019
2005-04-06 05:32:24 +00:00
Roger Dingledine
5f0a84cbe2 update conn-type-state-strings to handle https states for ORs
svn:r4018
2005-04-06 04:55:17 +00:00
Nick Mathewson
3014b03b67 Add missing comma. Oops
svn:r4017
2005-04-06 03:20:06 +00:00
Nick Mathewson
88fe4d6292 Handle changed router status correctly when reloading fingerprint file
svn:r4016
2005-04-06 01:09:26 +00:00
Nick Mathewson
1b5e2182fa Log msg spelling fix
svn:r4015
2005-04-06 00:53:13 +00:00
Roger Dingledine
f860b490be When we're connecting to an OR and he's got a different nickname/key
than we were expecting, only complain loudly if we're an OP or an
authdirserver. Complaining loudly to OR admins just confuses people.


svn:r4014
2005-04-06 00:50:40 +00:00
Nick Mathewson
ac268a8340 Fix Tor for no-threading compilation: move connection_unregister from _connection_free to connection_free.
svn:r4013
2005-04-06 00:46:57 +00:00
Nick Mathewson
374edd356e Change replacement semantics for directory entries: fix bug 121.
svn:r4012
2005-04-06 00:01:35 +00:00