Commit Graph

3310 Commits

Author SHA1 Message Date
Roger Dingledine
868d456c3b make it so there is one place to edit for new dirservers, not two.
svn:r6186
2006-03-18 22:37:27 +00:00
Roger Dingledine
cc37c2f71e fix some typos
svn:r6185
2006-03-18 09:29:05 +00:00
Roger Dingledine
67b61fe475 authdirs shouldn't complain about unreachability when they
fetch a descriptor from somebody else. this is not the right
time to increment the failure count.


svn:r6184
2006-03-18 05:37:15 +00:00
Roger Dingledine
581795f41d auth dir servers were only modifying a server's is_running field
when they created a network status. so if nobody asked for a
network status, they would never discover that any servers are
is_running, so they could never build a circuit.


svn:r6183
2006-03-18 01:24:04 +00:00
Roger Dingledine
cf6ba3e76f let an authdir that's not a naming authdir start even
if it doesn't have an approved-routers file. if it does,
read it and parse it as usual.


svn:r6182
2006-03-18 00:22:23 +00:00
Roger Dingledine
4f14826cb3 Actually, only v1 auth dir servers need to define recommendedversions.
But versioning dirservers do need to cause recommendclientversions
and recommendedserverversions to somehow be non-empty.


svn:r6181
2006-03-17 23:25:40 +00:00
Roger Dingledine
c7839a17f5 when we're an auth dir server but don't claim to be a versioning
auth dir server, don't demand that we define RecommendedVersions.


svn:r6180
2006-03-17 23:21:42 +00:00
Roger Dingledine
51fc6799ad right now we don't support entryguards on auth dirservers,
but that doesn't mean we need to remind them every time
they start up.


svn:r6179
2006-03-17 23:19:51 +00:00
Roger Dingledine
817556315a Implement router purposes, and don't choose a non-general
purpose router when picking random nodes for a circuit.

Also implement SETROUTERPURPOSE and modify +POSTDESCRIPTOR.

This concludes bug 250 assuming it all works.


svn:r6178
2006-03-17 22:08:59 +00:00
Roger Dingledine
7d141c6776 but i made the line too long
svn:r6176
2006-03-17 19:25:36 +00:00
Roger Dingledine
f1bcc2d6f8 stop tricking server operators into thinking they got their
torrc perfect, just because tor could build a circuit.


svn:r6175
2006-03-17 19:20:07 +00:00
Nick Mathewson
053411e827 Comments: cleanups and additions.
svn:r6174
2006-03-17 05:50:41 +00:00
Nick Mathewson
0f0e14c6e3 normalize whitespace.
svn:r6173
2006-03-17 04:43:37 +00:00
Nick Mathewson
215e377224 Only warn about lack of name binding for self if we have tried downloading every networkstatus.
svn:r6172
2006-03-17 04:41:57 +00:00
Roger Dingledine
9a5df4cef5 resume being printist: if the hostname contains non-printable
characters, then fail. this time don't even bother telling the
server operator about these cases, because what's he going to do?

if it turns out that some significant population somewhere in the
world uses non-printable hostnames and wants to use tor, then i
hereby assume that they will contact us.


svn:r6171
2006-03-15 23:36:57 +00:00
Roger Dingledine
8d1f65a222 quiet another entry guard log message
svn:r6169
2006-03-15 22:48:48 +00:00
Roger Dingledine
e8fd871d8b Stop being printist: just because our local platform doesn't
consider an alleged destination to be printable doesn't mean
nobody in the world will want to use it.


svn:r6167
2006-03-15 19:17:34 +00:00
Nick Mathewson
13cf54b9c1 Interim fix for 272: Only warn that we are not named if we have status docs from some naming authorities.
svn:r6166
2006-03-15 05:37:27 +00:00
Nick Mathewson
fb7b5545ce Implement GETINFO(dir/server/foo); status will be harder.
svn:r6165
2006-03-15 05:06:56 +00:00
Nick Mathewson
d0f24b1e46 (Missing header change) Do not warn about unknown servers in our family when they are given as hex digests.
svn:r6164
2006-03-15 05:06:26 +00:00
Nick Mathewson
3c0a5f6365 Do not warn about unknown servers in our family when they are given as hex digests.
svn:r6163
2006-03-15 05:04:11 +00:00
Roger Dingledine
903183ea28 if we as a directory mirror don't know of any v1 directory
authorities, then don't try to cache any v1 directories.


svn:r6162
2006-03-15 00:10:13 +00:00
Peter Palfrader
a4ec555228 change INET_NTOA_BUF_LEN+1 to INET_NTOA_BUF_LEN
add a comment in a few places where we add weird numbers to buffer lengths


svn:r6161
2006-03-14 23:40:37 +00:00
Peter Palfrader
866f6293ff I wonder what an internal internet protocol is
svn:r6159
2006-03-14 22:52:20 +00:00
Peter Palfrader
86a964d868 When we try to be a server and Address is not explicitly set
and our hostname resolves to a private IP address, try
to use an interface address if it has a public address.


svn:r6158
2006-03-14 22:51:15 +00:00
Peter Palfrader
2ef8f772a1 Fix an off-by-one buffer size in dirserv.c that magically never hit our
three authorities but broke sjmurdoch's own tor network.


svn:r6157
2006-03-14 22:43:52 +00:00
Roger Dingledine
499eeced44 when event_add or event_del fail, tell us why.
svn:r6156
2006-03-13 19:33:46 +00:00
Peter Palfrader
ebfb3fea6d Fix minor semantic error with no real effect:
we were doing "is_internal_IP(htonl(in.s_addr))" but in.s_addr is
in network order and is_internal_IP wants host order.  Change to
"is_internal_IP(ntohl(in.s_addr))".


svn:r6155
2006-03-13 19:09:52 +00:00
Nick Mathewson
dad60905a8 Be a little more careful when our calculated bandwidth is so high that we could never ever exhaust our bandwidth limit. This should resolve bug 130.
svn:r6146
2006-03-13 01:06:55 +00:00
Nick Mathewson
bd8ffccae7 More cleanups noticed by weasel; also, remove macros that nobody uses.
svn:r6143
2006-03-12 23:31:16 +00:00
Nick Mathewson
474c60b743 Cleanup on time-relaqted constants. New conventions:
1) Surround all constants by (parens), whether we'll be using them
     in a denominator or not.
  2) Express all time periods as products (24*60*60), not as multiplied-out
     constants (86400).
  3) Comments like "(60*60) /* one hour */" are as pointless as comments
     like "c = a + b; /* set c to the sum of a and b */".  Remove them.
  4) All time periods should be #defined constants, not given inline.
  5) All time periods should have doxygen comments.
  6) All time periods, unless specified, are in seconds.  It's not necessary
     to say so.

To summarize, the old (lack of) style would allow:

  #define FOO_RETRY_INTERVAL 60*60 /* one hour (seconds) */
  next_try = now + 3600;

The new style is:

  /** How often do we reattempt foo? */
  #define FOO_RETRY_INTERVAL (60*60)

  next_try = now + RETRY_INTERVAL;


svn:r6142
2006-03-12 22:48:18 +00:00
Roger Dingledine
b67a5ba498 lower the reachability timeout, so we're more likely to act
quickly if a server stops being reachable.


svn:r6141
2006-03-12 21:24:03 +00:00
Roger Dingledine
1fc5eb329b We screwed up in anticipating how to add new dirservers:
Old servers won't realize they're supposed to stay connected
to the new dirservers, so they'll expire connections to them,
but that means the dirservers will list them as unreachable.

So the fix is to stop requiring an open connection when deciding
if a server is reachable. This makes us slightly less accurate,
but at least it will work.


svn:r6140
2006-03-12 20:57:52 +00:00
Roger Dingledine
ef447507ff a better clean-up
svn:r6139
2006-03-12 20:51:02 +00:00
Roger Dingledine
a98b25137c and another fix
svn:r6138
2006-03-12 20:48:59 +00:00
Roger Dingledine
98476c71d2 make tor --verify-config closer to working
svn:r6137
2006-03-12 20:46:00 +00:00
Roger Dingledine
a4da44c2b9 Now do address rewriting when the controller asks us to attach
to a particular circuit too. This will let Blossom specify
"moria2.exit" without having to learn what moria2's IP address is.

It may also cause other controller authors some angst. Let us know.


svn:r6136
2006-03-12 05:04:16 +00:00
Roger Dingledine
d80d5370e0 when we get funny-looking lines on our dirport, shut up about it.
svn:r6135
2006-03-12 04:36:17 +00:00
Roger Dingledine
b5c6a990d3 fix assert while attachstream'ing a connect-wait or
resolve-wait stream.


svn:r6134
2006-03-12 04:33:29 +00:00
Roger Dingledine
80f0492a65 avoid shadowing a variable so we don't get sad later.
svn:r6133
2006-03-12 04:07:21 +00:00
Roger Dingledine
0bd46086c3 fix bug reported by gozu: if we get a linelist or linelist_s
config option from the torrc and it has no value, warn and
skip rather than silently resetting it to its default.


svn:r6125
2006-03-11 18:40:33 +00:00
Roger Dingledine
c8e2a051ac huge warning sign for esc_router_info()
svn:r6124
2006-03-11 17:52:55 +00:00
Nick Mathewson
4d3e709c4b Use escaped() for remaining cases.
svn:r6117
2006-03-11 02:21:30 +00:00
Roger Dingledine
86a72f73b9 make entry guard logs even quieter
svn:r6116
2006-03-10 16:51:26 +00:00
Roger Dingledine
e11f900a2a stop printing a log message at every iteration through the
event loop when holding open a conn for flushing but it
doesn't want to flush any more bytes yet.


svn:r6114
2006-03-09 06:34:33 +00:00
Roger Dingledine
5f8d26496d Let the controller attachstream conns that are in connect_wait
or resolve_wait: we detach them first and then act as before.
Resolves bug 264.


svn:r6112
2006-03-09 06:29:53 +00:00
Roger Dingledine
82d1fdbaea don't abandon entry guards until they've been dead a whole month.
make entry guard log messages quieter.


svn:r6106
2006-03-09 00:55:55 +00:00
Roger Dingledine
44107f6ec4 Implement NEWNYM. Nick, did I do a bad thing?
svn:r6105
2006-03-09 00:18:16 +00:00
Roger Dingledine
0f39033b9f clean up typo
svn:r6103
2006-03-09 00:10:28 +00:00
Roger Dingledine
946317ae13 start using OR_CONN_EVENT_NEW.
also fixes a seg fault in tor (bug 261).


svn:r6101
2006-03-08 22:29:08 +00:00
Roger Dingledine
8db1e363c9 remove some redundant code now that we compress exit policies
after parsing them


svn:r6099
2006-03-08 19:34:34 +00:00
Nick Mathewson
1ce3713889 Possible bug 265 fix: authorities must be more strict than clients about age of acceptable routers; make routers publish every 12 hours; client ROUTER_MAX_AGE must be greater than NETWORKSTATUS_MAX_AGE+authoirty ROUTER_MAX_AGE.
svn:r6095
2006-03-08 06:29:52 +00:00
Roger Dingledine
a2d71f917e mark bug 261
svn:r6089
2006-03-06 19:47:54 +00:00
Nick Mathewson
5dc5380984 Add some "to-be-safe" escaped() wrappers to log statements in rend*.c, though I am not 100% sure that each one is necessary.
svn:r6088
2006-03-06 00:25:39 +00:00
Nick Mathewson
5777ee0e1a Add some functions to escape values from the network before sending them to the log. Use them everywhere except for routerinfo->plaftorm, routerinfo->contact_info, and rend*.c. (need sleep now)
svn:r6087
2006-03-05 09:50:26 +00:00
Nick Mathewson
6a4e304d9e Allow private:* in routerdescs; not generated yet (because older Tors do not understand it); needs testing.
svn:r6086
2006-03-05 05:27:59 +00:00
Roger Dingledine
329af979e0 Add a new circuit purpose 'controller' to let the controller
ask for a circuit that Tor won't try to use.

Extend the EXTENDCIRCUIT controller command to let you specify
the purpose if you're starting a new circuit.

Add a new SETCIRCUITPURPOSE controller command to let you
change a circuit's purpose after it's been created.


svn:r6075
2006-02-23 06:51:09 +00:00
Roger Dingledine
2bfd2a2400 clean up a log message
svn:r6074
2006-02-21 17:54:56 +00:00
Roger Dingledine
25ed4b66e3 be quieter about hidserv descriptors that are too old or too new.
we can't do anything about them anyway.


svn:r6073
2006-02-21 06:23:57 +00:00
Roger Dingledine
89b07b458b i missed the other half of that grammar fix
svn:r6058
2006-02-21 03:55:47 +00:00
Roger Dingledine
16f265fa0d when saveconf fails in controller v1, we were returning a malformed
error string.


svn:r6053
2006-02-20 01:24:26 +00:00
Roger Dingledine
498c13b4df make the NoPublish option obsolete.
svn:r6052
2006-02-20 01:21:48 +00:00
Roger Dingledine
0408adb728 tweak
svn:r6051
2006-02-20 01:15:38 +00:00
Roger Dingledine
276a7bd038 the other half of fixing bug 257. catch an error in more places.
svn:r6050
2006-02-20 01:06:27 +00:00
Roger Dingledine
57bcdcecf1 try to address bug 257: if rename() fails during saveconf, tell
the controller.


svn:r6049
2006-02-19 23:12:26 +00:00
Roger Dingledine
6a52867846 New config options to address bug 251:
FetchServerDescriptors and FetchHidServDescriptors for whether
to fetch server info and hidserv info or let the controller do it,
and also PublishServerDescriptor and PublishHidServDescriptors.

Add AllDirActionsPrivate undocumented option -- if you set it, you'll
need the controller to bootstrap you enough to build your first circuits.


svn:r6047
2006-02-19 22:02:02 +00:00
Peter Palfrader
c4f389420c Improve the "we have been waiting for 1140377851 seconds" log
svn:r6046
2006-02-19 19:44:09 +00:00
Roger Dingledine
266254f42b clean up the Reachable*Addresses changes
svn:r6041
2006-02-19 08:31:47 +00:00
Roger Dingledine
a9fcf4ced2 this is why you're not supposed to cut-and-paste code
svn:r6037
2006-02-18 06:46:01 +00:00
Peter Palfrader
aa5443551d Make it compile with VC7. It does not yet link.
svn:r6033
2006-02-18 02:02:21 +00:00
Roger Dingledine
42cd0dcde8 fix typo found in phobos's logs
svn:r6020
2006-02-15 03:47:38 +00:00
Roger Dingledine
f6d80d60e0 don't warn when we get a server descriptor from the controller
but it's too old. that's not something tor should fix.


svn:r6019
2006-02-15 03:01:53 +00:00
Peter Palfrader
c7f2970777 Just because both are obsolete does not mean we prefer the newer
svn:r6016
2006-02-14 17:48:51 +00:00
Peter Palfrader
0bab094d5d Explain why we only expire open connections
svn:r6015
2006-02-14 17:30:04 +00:00
Roger Dingledine
ae249fc5a3 document the frequency for reachability testing by the
directory authorities.


svn:r6014
2006-02-14 04:33:59 +00:00
Peter Palfrader
84295f9f43 Do not mark connections obsolete before they have done their TLS handshake or are at least 60 seconds old
svn:r6013
2006-02-14 04:23:05 +00:00
Peter Palfrader
761da5b97f Our connection_or_get_by_identity_digest() was slightly wrong. If best
didn't have any circuits on it, but conn had circuits, we would not make
conn our new best unless it was also newer.  Also, restructure the code
a bit to maybe make it clearer.


svn:r6012
2006-02-14 00:08:19 +00:00
Peter Palfrader
0cc2390f8c Warn if ReachableAddresses is set when also ReachableDirAddresses and ReachableORAddresses are set.
svn:r6010
2006-02-13 22:29:37 +00:00
Peter Palfrader
5eea6c76df Split ReachableAddresses into ReachableDirAddresses and ReachableORAddresses
svn:r6009
2006-02-13 21:17:20 +00:00
Roger Dingledine
259c65ab08 the last of the log convention conversion. finally.
svn:r6005
2006-02-13 10:33:00 +00:00
Roger Dingledine
aa63a84fe1 the things we do for our windows users.
i hope they appreciate it.


svn:r6004
2006-02-13 09:37:53 +00:00
Roger Dingledine
d113b75da6 more log conversions.
whee.


svn:r6003
2006-02-13 09:02:35 +00:00
Roger Dingledine
36484f873a convert some more source files to the new log convention
svn:r6002
2006-02-13 08:28:42 +00:00
Roger Dingledine
7d80921afa resolve too-long-lines
svn:r6001
2006-02-13 08:22:57 +00:00
Nick Mathewson
2a4555fedd Style on config_addr_policy_intersectes, which looks ok to me.
svn:r5998
2006-02-13 07:16:32 +00:00
Roger Dingledine
350313d77a Let the users set ControlListenAddress in the torrc.
This can be dangerous, but there are some cases (like a secured
LAN) where it makes sense.


svn:r5997
2006-02-13 06:25:16 +00:00
Peter Palfrader
6c4d873591 Compress exit policies even more. please review
svn:r5995
2006-02-13 01:54:31 +00:00
Nick Mathewson
2cc66125b8 try to fix bug with spurious "everything is broken" warning
svn:r5994
2006-02-13 00:26:43 +00:00
Roger Dingledine
b7781ea208 bugfix: we were ignoring the IS_FAST flag in the directory
status, meaning we were willing to pick trivial-bandwidth nodes
for "fast" connections.


svn:r5992
2006-02-13 00:09:30 +00:00
Nick Mathewson
dba155ecff Generate 18.0.0.0/8 address policy format in descs when we can; warn when the mask is not reducible to a bit-prefix.
svn:r5991
2006-02-12 23:58:22 +00:00
Roger Dingledine
b99f903e34 and don't warn when it happens here either, unless the user
wants to hear it.


svn:r5990
2006-02-12 23:44:02 +00:00
Roger Dingledine
97571a1cb4 don't tell ordinary users about broken directory servers.
it's a shame that they're broken, but most people are just
confused by the warning.


svn:r5988
2006-02-12 23:31:47 +00:00
Nick Mathewson
98ec124c6a Drop redundant exit policy entries, not just identical ones.
svn:r5987
2006-02-12 22:59:38 +00:00
Nick Mathewson
e7b2d5cd47 Retain unrecognized options in state file, so that we can be forward-compatible.
svn:r5985
2006-02-12 22:28:30 +00:00
Nick Mathewson
ae4f0467c8 enforce whitespace style
svn:r5984
2006-02-12 22:27:09 +00:00
Roger Dingledine
3c4e68488b Clients now honor the "guard" flag in the router status when
picking entry guards, rather than looking at is_fast or is_stable.

Now dirservers can change how they define it and clients will
automatically use their new definition.


svn:r5979
2006-02-12 03:43:39 +00:00
Roger Dingledine
b5ac6fc707 more helpful log message when running servers on obsolete windows.
svn:r5975
2006-02-12 00:14:58 +00:00
Roger Dingledine
094ccd34a9 bump up the period for forcing a hidden service descriptor upload
from 20 minutes to 1 hour.


svn:r5972
2006-02-12 00:12:36 +00:00
Roger Dingledine
981815146a compress exit policies even more -- look for duplicate lines
and remove them.


svn:r5971
2006-02-12 00:03:06 +00:00
Roger Dingledine
6c093a17a9 bugfix in config_cmp_addr_policies() -- we were treating a pair
of exit policies if they were equal even if one said accept and
the other said reject.


svn:r5970
2006-02-11 23:47:24 +00:00
Roger Dingledine
fdf18fbbdb stop leaking that
svn:r5969
2006-02-11 23:16:13 +00:00
Roger Dingledine
e847085c04 When a client asks for an old-style directory and our write bucket
is empty, don't give it to him. This way small servers can continue
to serve the directory *sometimes*, without getting overloaded.


svn:r5968
2006-02-11 23:15:40 +00:00
Nick Mathewson
f1b91924b2 Keep running if we ask for an impossible stdout log; just warn.
svn:r5964
2006-02-11 21:56:03 +00:00
Nick Mathewson
1dc90be4f0 Retry pending server downloads as well as pending networkstatus downloads when we unexpectedly get an app connection
svn:r5962
2006-02-11 21:29:12 +00:00
Nick Mathewson
91847124bf Warn if running obsolete windows as a server.
svn:r5961
2006-02-11 21:26:40 +00:00
Roger Dingledine
85a64b4fd0 get our grammar right when complaining about un-recommended versions
svn:r5950
2006-02-09 06:08:59 +00:00
Roger Dingledine
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +00:00
Roger Dingledine
fd0fcdf17c stop calling it a "libevent poll" -- the word "poll" has
other meaning in this context that are confusing.


svn:r5936
2006-02-09 03:09:52 +00:00
Roger Dingledine
dbea401305 correct the comments that don't realize it's the opposite
svn:r5934
2006-02-09 02:59:26 +00:00
Roger Dingledine
31f2705d9a and make sure that never happens again
svn:r5932
2006-02-09 02:42:33 +00:00
Roger Dingledine
2c221dd8db fix bug 245: When modifying the orconn_circid_map map, we would
sometimes decrement conn->n_circuits even when there was no circuit
originally. This caused conn->n_circuits to go negative.

We noticed this because we were checking if connections can be
closed based on conn->n_circuits == 0, so we were never closing
any connection that had ever had a circuit on it.


svn:r5931
2006-02-09 02:42:15 +00:00
Roger Dingledine
1c596156aa tweak comment
svn:r5930
2006-02-09 00:08:23 +00:00
Nick Mathewson
e5a574ce2e Move "sort list of versions" logic into routerparse.c; make version-checking code say which versions it would have accepted. (not tested.)
svn:r5927
2006-02-06 05:04:27 +00:00
Nick Mathewson
2bb4fd24de char *x = "y"; is not good C.
svn:r5926
2006-02-06 05:01:44 +00:00
Nick Mathewson
50e1005327 Only v1 authorities get hidden service descriptors with current protocol
svn:r5924
2006-02-06 04:56:18 +00:00
Nick Mathewson
97bff8edaa Fix a const-non-const warning
svn:r5923
2006-02-06 04:55:27 +00:00
Roger Dingledine
a9c87fe251 more typos and nits
svn:r5918
2006-02-05 05:28:52 +00:00
Nick Mathewson
157e6a025a Stupid cut-and-paste bug.
svn:r5917
2006-02-05 05:11:24 +00:00
Roger Dingledine
555a64e06d as soon as we've fetched some more directory info, that's time
to think about downloading more server descriptors. this way
we don't have a 10 second pause in initial bootstrapping.


svn:r5916
2006-02-05 03:42:34 +00:00
Roger Dingledine
d602d0d298 cosmetic fix
svn:r5915
2006-02-05 03:42:04 +00:00
Roger Dingledine
640882c76c clean up tabs and wide-lines from weasel's commit
svn:r5914
2006-02-05 03:23:16 +00:00
Roger Dingledine
6535087845 when building v2 statuses or v1 running-routers, don't admit the
existence of descriptors older than a day.

we still cache them in case anybody asks, but we don't actively
mention them.


svn:r5913
2006-02-05 02:33:40 +00:00
Roger Dingledine
53f86cdf5d fix bug: we were caching the newest descriptor for each server,
well, forever. i imagine this just keeps growing in size.


svn:r5912
2006-02-05 02:07:28 +00:00
Roger Dingledine
4c1fa73c7e typos and nits
svn:r5911
2006-02-05 01:57:27 +00:00
Roger Dingledine
a53a73a782 forward-port the part where ordinary users try to fetch directories
less often. not critical but might as well stay in sync with stable.


svn:r5910
2006-02-05 01:57:07 +00:00
Roger Dingledine
640c555f02 Fix a major load balance bug: we were round-robining in 16 KB chunks, and
servers with bandwidthrate of 20 KB, while downloading a 600 KB directory,
would starve their other connections. Now we try to be a bit more fair.


svn:r5906
2006-02-04 08:58:51 +00:00
Peter Palfrader
94fb3f06b3 Fix compiler warning on 64 bit archs
svn:r5903
2006-02-03 22:26:43 +00:00
Peter Palfrader
390bbb0a0c Try to make tor work better through squid: Limit number of descriptors we fetch
to 96 (was 128 previously).

We limit this number even when we do not have a http proxy explicitly
configured as some people mistakenly believe transparent proxies are a neat
idea.


svn:r5901
2006-02-03 15:17:48 +00:00
Roger Dingledine
a1dd751f30 when we fail to bind a listener, try to provide a more useful log msg.
svn:r5900
2006-02-03 12:26:10 +00:00
Roger Dingledine
1800fbe486 don't warn when we receive a 503 from a dirserver/cache -- this
will pave the way for them being able to tell us to screw off
if they're busy.


svn:r5898
2006-02-03 12:08:31 +00:00
Roger Dingledine
0fadf0aad6 Fix bug 225: now "attachstream 0" treats conn like it just connected,
doing address remapping, handling .exit and .onion idioms, and so on.

Now we are more uniform in making sure that the controller hears about
all new connections, and making sure it hears when they close.


svn:r5897
2006-02-03 11:37:19 +00:00
Roger Dingledine
92ef9e37e7 Add a new config option ExitPolicyRejectPrivate which defaults to 1.
This means all exit policies will begin with rejecting private addresses,
unless the server operator explicitly turns it off.

Also, make our code to remove redundancies in the exit policy smarter,
so it can detect "reject foo, reject bar, reject *" patterns.

Lastly, we can get rid of the "exit policy implicitly accepts" code,
since we make everything more explicit now.


svn:r5888
2006-02-01 03:53:52 +00:00
Roger Dingledine
bdba6e42dc avoid a minor confusing log message
svn:r5887
2006-02-01 03:05:52 +00:00
Peter Palfrader
bf514e5dc5 Try to fix policy_includes_addr_mask_implicitly()
svn:r5886
2006-02-01 02:52:55 +00:00
Peter Palfrader
61ea27620a Also catch 0/8 in exit_policy_implicitly_allows_local_networks()
svn:r5885
2006-02-01 02:31:27 +00:00
Roger Dingledine
686508a04a don't try to upload hidden service descriptors until we have
established a circuit.


svn:r5884
2006-02-01 02:19:46 +00:00
Roger Dingledine
e05d4e45d2 provide a more useful warn message when our onion queue
gets full.


svn:r5881
2006-01-31 08:17:00 +00:00
Roger Dingledine
8fc44169e5 only start testing reachability once we've established a circuit.
this will make startup on dirservers less noisy.
it may also break things in subtle ways.


svn:r5878
2006-01-29 01:11:41 +00:00
Roger Dingledine
f8b9a8d457 bump the default bandwidthrate to 3 MB, and burst to 6 MB
svn:r5874
2006-01-28 08:28:15 +00:00
Roger Dingledine
35f91db15f a slightly more useful message when you get a sighup
svn:r5869
2006-01-26 19:11:06 +00:00
Nick Mathewson
bfe285be61 Add a missing printf arg
svn:r5861
2006-01-24 04:01:13 +00:00
Roger Dingledine
2eabf190e9 make it louder when we're running an unrecommended version.
also, we need to tell them what versions *are* recommended.
i'll add that to the todo.


svn:r5859
2006-01-24 03:45:58 +00:00
Nick Mathewson
9f42c9d650 Make dirservers generate a separate "guard" flag to mean, "would make a good entry guard". Make clients parse it and vote on it.
svn:r5856
2006-01-24 00:31:16 +00:00
Roger Dingledine
1756ebdd4e Jan 23 02:39:44.856 [warn] rend_mid_rendezvous(): Rejecting RENDEZVOUS1 cell with unrecognized rendezvous cookie AFC097FD.
This is not anything that the server admin can deal with, so don't
complain this loudly.


svn:r5851
2006-01-23 09:26:22 +00:00
Roger Dingledine
de13ddd26f Stop complaining loudly whenever some poor client falls off
the network before we finish writing to him.


svn:r5850
2006-01-23 09:23:04 +00:00
Roger Dingledine
b9540285af remove unused code
svn:r5847
2006-01-20 20:54:42 +00:00
Roger Dingledine
f6084cf831 Jan 18 18:42:05.671 [debug] Encountered eof
Jan 18 18:42:05.671 [debug] Got data, not eof. Leaving on inbuf.

that's not very smart.


svn:r5843
2006-01-19 11:21:28 +00:00
Roger Dingledine
4a66f5a896 when the controller asks for a signal we don't recognize, don't
include the whitespace/newline/etc in our complaint.


svn:r5841
2006-01-19 02:21:24 +00:00
Roger Dingledine
d682c84e79 attempted patch for bug 220: don't assert when we've tried all the
intro points for a hidden service and we try fetching the service
descriptor again.


svn:r5838
2006-01-17 04:16:59 +00:00
Roger Dingledine
d5acef191c add another assert to make sure we're not scribbling on the stack.
svn:r5837
2006-01-17 04:14:04 +00:00
Roger Dingledine
cca9a2f7b0 oh, and the other bits of the commit
svn:r5836
2006-01-17 04:03:23 +00:00
Roger Dingledine
21be9dc3c0 when you tried to set orport through the controller, it would
trigger an assert because you hadn't made your onion keys yet
you wanted to launch cpu workers.

now init keys first, reset uptime, and tell the user that we're
starting the reachability testing.


svn:r5835
2006-01-17 04:01:32 +00:00
Roger Dingledine
76f1b7415b try to detect an assert error earlier
svn:r5834
2006-01-17 02:31:04 +00:00
Nick Mathewson
1057516a07 Clients should not download descriptors for non-running descriptors.
svn:r5830
2006-01-16 20:52:30 +00:00
Roger Dingledine
f0d4b3d18f turn crypto hardware acceleration off by default, until we find
somebody smart who can test it for us.


svn:r5829
2006-01-16 20:08:33 +00:00
Nick Mathewson
2dd566d5d5 Indirect access to the signed_descriptor field to make it easier to keep them lazily on disk.
svn:r5827
2006-01-12 18:04:17 +00:00
Roger Dingledine
0e51d5d274 When the controller was submitting a descriptor, we were checking to make
sure some network-status we had referred to it, and refusing it if not.
This is bad for people who want to insert descriptors that aren't part of
the current Tor network. Now we accept them, and also give a more useful
warn message if we ask a dir mirror for a given descriptor and it gives us
one we weren't expecting.


svn:r5824
2006-01-12 03:43:39 +00:00
Roger Dingledine
54a7285e99 oh hey. we were hanging up on every tor client because he
was obsolete as soon as he started. big oops.


svn:r5807
2006-01-11 22:34:07 +00:00
Nick Mathewson
c562ca494a add missing warning
svn:r5806
2006-01-11 20:09:37 +00:00
Nick Mathewson
fefa34d525 Fix double-free of torrc_fname
svn:r5805
2006-01-11 20:01:47 +00:00
Nick Mathewson
adbe0f0ada Fix bug 240: dont dump descriptions when not dumping actual config lines.
svn:r5804
2006-01-11 19:43:14 +00:00
Nick Mathewson
099b9ce2f9 Fix bug 230: add a rollback function to reverse all changes since the last mark_logs_temp(), and move log initialization into the two-phase part of option setting.
svn:r5803
2006-01-11 19:40:14 +00:00
Roger Dingledine
5ca40affeb we were leaking a smartlist every time we built a circuit
svn:r5795
2006-01-11 04:14:10 +00:00
Nick Mathewson
d60faa7c93 Fix another memleak. I love you, valgrind!
svn:r5794
2006-01-11 04:09:40 +00:00
Nick Mathewson
8907391ad6 Fix wide lines
svn:r5793
2006-01-11 04:04:42 +00:00
Nick Mathewson
5c78c89471 Appease verbose gcc warning: make dirserv_compute_stable_uptime() static.
svn:r5792
2006-01-11 03:59:55 +00:00
Roger Dingledine
284fe9cad5 if we learn that a down entry guard is up, count our working entry
guards correctly when logging.


svn:r5791
2006-01-11 03:58:59 +00:00
Nick Mathewson
eb78295e4e Fix memory leak in routerlist_remove_old_routers().
svn:r5790
2006-01-11 03:58:07 +00:00
Nick Mathewson
6a9ca9e790 Convert some more ints to long longs in rephist.c, as suggested by windows compiler.
svn:r5789
2006-01-11 03:57:01 +00:00
Roger Dingledine
d1baa0c4a6 we were leaking 3KB every time the entry guards changed, every time
the controller called saveconf, and every 20 minutes.


svn:r5788
2006-01-11 03:20:53 +00:00
Roger Dingledine
8f271f2f5a we changed the name of AccountingBytesReadInInterval
change its state file description too


svn:r5785
2006-01-10 23:26:59 +00:00
Roger Dingledine
7d1f675c85 entry nodes are now entry guards.
this is our last easy chance for a wholesale change. heave ho.


svn:r5782
2006-01-10 22:42:44 +00:00
Roger Dingledine
210d9db54d and even more so
svn:r5776
2006-01-10 21:01:30 +00:00
Roger Dingledine
aea0a78254 make entry node logging slightly less chatty.
still quite chatty. it's an alpha, that's ok.


svn:r5775
2006-01-10 20:59:39 +00:00
Nick Mathewson
bef879540a #undef FOO is cleaner than #define FOO_XX
svn:r5774
2006-01-10 20:50:22 +00:00
Nick Mathewson
4a7ee9bd3d Make unittests pass again.
svn:r5773
2006-01-10 20:47:24 +00:00
Roger Dingledine
b2d79f278b or_state_validate() needs an extra arg too or it will crash
svn:r5772
2006-01-10 20:38:33 +00:00
Roger Dingledine
f4299f0f44 hack to address bug 238.
needs a better fix, but not for 0.1.1.11.


svn:r5771
2006-01-10 20:27:47 +00:00
Roger Dingledine
d114ea7125 implement getinfo desc/all-recent
closes bug 237.


svn:r5770
2006-01-10 20:09:31 +00:00
Roger Dingledine
f71273c216 fix bug 235
svn:r5768
2006-01-10 20:06:24 +00:00
Nick Mathewson
7fc62029d4 Refuse to use RunAsDaemon when torrc is a relative path. Fixes bug 229.
svn:r5767
2006-01-10 20:00:20 +00:00
Nick Mathewson
e1d1ce3da8 Warn about actual offending hiddenservice* config option, now that more than one is possible. Closes bug 239.
svn:r5766
2006-01-10 19:28:31 +00:00
Nick Mathewson
2fda7140e8 Fix bug 221 and bug 201: For 221, check return value from connection_add() when adding a rendezvous post connection. For 201, do not include a content-length 0 with a GET request.
svn:r5765
2006-01-10 19:24:40 +00:00
Roger Dingledine
c8e6003412 balance the reachability testing so a smidgen of it happens
every 10 seconds. this way we don't try to do 500 tls's at
once every 20 minutes.


svn:r5763
2006-01-10 07:21:01 +00:00
Nick Mathewson
43a4f8c7f3 Be more aggressive about throwing away expired router descriptors: they are of no use to anybody. Better still: dont serve expired descriptors by fingerprint. The only people who ask for them are busted 0.1.1.10 Tors that will throw them away and re-request them after 30 minutes.
svn:r5762
2006-01-10 04:57:12 +00:00
Nick Mathewson
56c55c343e When picking a random directory, prefer non-authorities if any are known.
svn:r5761
2006-01-09 23:39:07 +00:00
Nick Mathewson
bec9b705cc Instrument directory client bytes as well as server bytes.
svn:r5760
2006-01-09 23:13:53 +00:00
Nick Mathewson
10100c4315 Make instrmentation code a little cleaner.
svn:r5759
2006-01-08 22:19:41 +00:00
Roger Dingledine
fa05c1b21b remove the loud logging of busted rendezvous descriptors
svn:r5758
2006-01-08 22:16:30 +00:00
Roger Dingledine
6dcbbda43b remove typo
svn:r5757
2006-01-08 22:16:09 +00:00
Nick Mathewson
ff9cfa9644 Instrument how many directory bytes we are serving in what kind of request.
svn:r5756
2006-01-08 22:09:54 +00:00
Nick Mathewson
5d709e8517 Fix bug in last commit. Also, fix bug 231: authorities should never treat their own descriptor changes as cosmetic.
svn:r5755
2006-01-08 21:33:15 +00:00
Nick Mathewson
e30516f33f Fix bug 236: caches should cache up to 16 unrecognized network-status docs.
svn:r5754
2006-01-08 21:26:33 +00:00
Roger Dingledine
1dd8ebf615 bugfix: we were leaving open duplicate connections to other ORs
for a week, rather than closing them once we detect a duplicate.

also, avoid some duplicate mark-for-closes in connection-housekeeping.


svn:r5752
2006-01-07 03:56:56 +00:00
Roger Dingledine
9796733e89 "Pending" is a bad term for a circuit that uses your server as its last hop.
svn:r5751
2006-01-07 02:31:14 +00:00
Roger Dingledine
d4d7a49411 fix typo
svn:r5750
2006-01-07 02:12:38 +00:00
Roger Dingledine
af54b73985 and get the log arguments right
svn:r5747
2006-01-07 01:43:09 +00:00
Roger Dingledine
ba339b8a4d a more correct log message
svn:r5746
2006-01-07 01:41:17 +00:00
Roger Dingledine
654b61a2e8 Jan 05 19:39:27.356 [warn] connection_edge_process_end_not_open():
Got an end because of misc error, but we're not an AP. Closing.


svn:r5744
2006-01-07 01:02:21 +00:00
Roger Dingledine
f88fa3efc1 helper nodes are dead
svn:r5743
2006-01-07 00:41:50 +00:00
Nick Mathewson
50b6b3258d Dont call directory_get_from_dirserver when you have a particular dirserver in mind; remove fetch-from-authority special-case in directory_get_from_dirserver.
svn:r5741
2006-01-06 18:19:17 +00:00
Nick Mathewson
f0fb9f6b0c Directory authorities should go to the proper authority when asking for a networkstatus, even when they want a compressed one. (Also, bullet-proof the logic in case we ever accidentally request a networkstatus for a non-authority.)
svn:r5740
2006-01-06 18:05:48 +00:00
Nick Mathewson
65f76bad4f Add descriptions for state variables; rename AccountingBytesRead{In}Interval; remove extraneous and unused struct member.
svn:r5739
2006-01-06 15:43:03 +00:00
Nick Mathewson
447e6ffffd Fix bug where OPs would try to generate descriptor and crash.
svn:r5738
2006-01-06 15:40:34 +00:00
Nick Mathewson
878962bee1 Add reasons to DESTROY and RELAY_TRUNCATED cells.
svn:r5734
2006-01-05 21:23:03 +00:00
Roger Dingledine
d8e3bc0288 fix a wrong string
svn:r5733
2006-01-05 12:18:34 +00:00
Roger Dingledine
6aaa92f736 short-circuit half the cost of node-picking in the general case.
svn:r5732
2006-01-05 10:59:46 +00:00
Roger Dingledine
f8a59965a1 cleanups, and remove some unreachable code.
svn:r5727
2006-01-04 06:43:03 +00:00
Roger Dingledine
485aa9415d authdirs now stop whining so loudly about bad descriptors that they fetch
from other dirservers. now when there's a log complaint, it's for sure
from a freshly uploaded descriptor.


svn:r5726
2006-01-04 04:42:10 +00:00
Roger Dingledine
6b2a6a8239 Bugfix: dyndns tor servers were needing to wait 18 hours before they
could start doing reachability testing using the new IP address and
ports. This is because we were using the internal descriptor to learn
what to test, yet we were only rebuilding the descriptor once we
decided we were reachable.


svn:r5723
2006-01-03 23:34:42 +00:00
Roger Dingledine
f6f65c66b5 oh, it was supposed to compile?
svn:r5721
2006-01-03 13:12:17 +00:00
Roger Dingledine
da06f3553c don't try to build circuits until we have 3 running servers;
and for networks that are very small, having more than a quarter
of the descriptors is much harder than having equal to or more than
a quarter of the descriptors -- follow the spec.


svn:r5720
2006-01-03 13:09:49 +00:00
Roger Dingledine
5d28b7b884 we're done with tree.h. long live ht.h.
svn:r5715
2006-01-03 12:35:58 +00:00
Roger Dingledine
9af33ef39c when we choose not to use a server descriptor from our cache, don't
log it so loudly.


svn:r5713
2006-01-03 10:42:20 +00:00
Roger Dingledine
16ee6830b6 only print bandwidth lines to the state file if we're being a server.
otherwise this is pointless and probably bad for security.


svn:r5704
2006-01-02 12:19:28 +00:00
Roger Dingledine
1d474e14d7 strictentrynodes means we should clear the current entry_nodes list.
svn:r5703
2006-01-02 11:33:14 +00:00
Roger Dingledine
c5a5161fb5 prevent auth dir servers from enabling entry nodes.
svn:r5702
2006-01-02 08:40:58 +00:00
Roger Dingledine
358052416d bugfix: only try to use the EntryNodes config option if it is set.
svn:r5701
2006-01-02 05:14:21 +00:00
Roger Dingledine
ddf070e204 bugfix: we were failing to parse a tor version that started with
"Tor ", even though we said we could.


svn:r5699
2006-01-02 05:11:31 +00:00
Roger Dingledine
ea6ea8ec22 Make UseEntryNodes true by default. Let the fun begin.
svn:r5698
2006-01-02 05:00:03 +00:00
Roger Dingledine
aa604ef2c2 bugfix: only try to parse the TorVersion if there is one.
svn:r5697
2006-01-02 04:58:12 +00:00
Roger Dingledine
839111b85a tolerate a mal-formed or unrecognized tor version in the state file.
svn:r5696
2006-01-02 04:45:18 +00:00
Roger Dingledine
0bd25f5d43 save and validate TorVersion in the state file.
svn:r5694
2006-01-02 04:14:52 +00:00
Roger Dingledine
2efa056777 make the "stable" flag in network-status be the median of the uptimes
of running valid servers. that way the cutoff adapts to the stability
of the network as a whole.


svn:r5693
2006-01-02 03:32:55 +00:00
Nick Mathewson
4868d77ab8 Possible fix to state-load bug reported by weasel.
svn:r5692
2006-01-02 00:42:19 +00:00
Peter Palfrader
3dc69d3add Make tor compile again
svn:r5688
2005-12-31 11:52:13 +00:00
Roger Dingledine
6c693dbda6 add a TorVersion state string.
not yet set to anything.


svn:r5687
2005-12-31 08:16:07 +00:00
Roger Dingledine
e9e7dc176c Some tor servers process billions of cells in a matter of days.
These statistics need to be uint64_t's.


svn:r5686
2005-12-31 08:09:26 +00:00
Roger Dingledine
1a11b97b15 get rid of the special case for 'testing' circuits
svn:r5684
2005-12-31 06:37:34 +00:00
Roger Dingledine
5947388968 Finish implementing config's EntryNodes and StrictEntryNodes option.
The logging is way verbose for now.


svn:r5683
2005-12-31 06:32:57 +00:00
Roger Dingledine
0dc8e284f8 load balance a bit better by taking some load off the really
fast servers.
this might slow things down more, or it might not. hm.


svn:r5681
2005-12-30 04:46:43 +00:00
Roger Dingledine
c051e82f69 fix a typo
svn:r5680
2005-12-30 04:44:10 +00:00
Nick Mathewson
fc850273bd Appease some verbose GCC warnings.
svn:r5679
2005-12-29 20:25:53 +00:00
Roger Dingledine
2904c6f024 log how big the failed rend descriptor is, and if it's small, log
a base16 of the whole thing.


svn:r5678
2005-12-29 04:57:19 +00:00
Roger Dingledine
14ea2e0b56 when we reject a rend descriptor, tell us where it came from.
svn:r5677
2005-12-29 04:43:24 +00:00
Roger Dingledine
dbd7b97eff helper nodes are dead. long live entry nodes.
(config options EntryNodes and StrictEntryNodes still not
implemented.)


svn:r5673
2005-12-28 09:07:31 +00:00
Roger Dingledine
5d9256a367 but only close the new conn if one of the earlier helper nodes
that we mark up is actually reachable, fast enough, etc to use.


svn:r5672
2005-12-28 07:27:41 +00:00
Roger Dingledine
c1145138ea but only close it if we have marked an earlier helper as up.
that way we don't close it too needlessly.


svn:r5671
2005-12-28 07:20:33 +00:00
Roger Dingledine
60cd03069a when we connect to a helper node for the first time, close
that connection and its circuits. this lets us go back to
using the old helper nodes rather than immediately using
the last one in the list.


svn:r5670
2005-12-28 07:19:55 +00:00
Roger Dingledine
bbc4c8cef8 fix a spacing problem introduced by our 80-column requirement
svn:r5669
2005-12-27 10:11:29 +00:00
Roger Dingledine
d2171cb7a4 if the network is down, and we try to connect to a conn because we
have a circuit in mind, and we timeout (30 seconds) because the
network never answers, we were expiring the circuit, but we weren't
obsoleting the connection or telling the helper functions. now do that.


svn:r5668
2005-12-27 09:25:50 +00:00
Roger Dingledine
4088f7dfd1 fix typo
svn:r5667
2005-12-27 09:04:36 +00:00
Roger Dingledine
f46c135fac when we succeed at connecting to a helper that we've never connected
to before, mark all the previous helpers as up. This is handy if the
network went away and then returned.


svn:r5666
2005-12-27 08:54:37 +00:00
Roger Dingledine
25fcb5fa9c helpful log
svn:r5665
2005-12-27 08:38:22 +00:00
Roger Dingledine
976bf06463 slightly more accurate log messages
svn:r5664
2005-12-27 07:37:21 +00:00
Roger Dingledine
25052c6f4b first cut of the new helper stuff. seems to work in the normal
case, but many edge cases still need testing.


svn:r5663
2005-12-27 07:23:52 +00:00
Nick Mathewson
9ef54a3d0c Make directory caches a little less chatty when logging
svn:r5662
2005-12-27 06:05:54 +00:00
Nick Mathewson
fa0d5aa894 Make insert_old try hard to never add a duplicate.
svn:r5661
2005-12-27 05:58:12 +00:00
Nick Mathewson
ece9865020 Implement new directory logic: download by descriptor digest, not by key digest. Caches try to download all listed digests from authorities; clients try to download "best" digests from caches.
svn:r5659
2005-12-27 05:26:03 +00:00
Nick Mathewson
d94b9fd7d2 normalize spaces
svn:r5658
2005-12-27 04:52:34 +00:00