Commit Graph

534 Commits

Author SHA1 Message Date
Nick Mathewson
84790d059f r9715@catbus: nickm | 2007-01-22 02:51:04 -0500
Document a few undocumented functions and arguments.


svn:r9385
2007-01-22 07:51:06 +00:00
Roger Dingledine
c85ff4d6ab Fix an assert error introduced in 0.1.2.5-alpha: if you're an
advertised exit node, somebody might try to exit from you when
you're bootstrapping and before you've built your descriptor yet.


svn:r9305
2007-01-09 00:37:13 +00:00
Nick Mathewson
c8466c5919 r11824@Kushana: nickm | 2007-01-03 17:15:28 -0500
control-spec: upcase arguments in status events; note unimplemented events individually
 r11825@Kushana:  nickm | 2007-01-03 17:41:43 -0500
 Implement EXTERNAL IP server status event.
 r11826@Kushana:  nickm | 2007-01-03 17:47:10 -0500
 Implement BAD_SERVER_DESCRIPTOR server status event.
 r11827@Kushana:  nickm | 2007-01-03 18:01:56 -0500
 Implement SOCKS_UNKNOWN_PROTOCOL and DANGEROUS_SOCKS client events.
 r11828@Kushana:  nickm | 2007-01-03 18:23:22 -0500
 Implement BUG controller events. Also, flush ERR-level status events just like ERR-level log messages.
 r11829@Kushana:  nickm | 2007-01-03 23:37:27 -0500
 Yet more status events: CLOCK_SKEW, GOOD/ACCEPTED_SERVER_DESCRIPTOR, {CHECKING_}REACHABILITY_{SUCCEEDED|FAILED}
 r11833@Kushana:  nickm | 2007-01-05 16:56:37 -0500
 Note some unimplementedness in control-spec.txt


svn:r9279
2007-01-06 05:42:31 +00:00
Roger Dingledine
da2ff14839 Set orport= for 4 of the 5 dir authorities; Fix getinfo ns/all; Fix seg
fault when starting a server without a fingerprint file present.


svn:r9261
2007-01-04 05:41:24 +00:00
Nick Mathewson
2caeaf4e2f r11787@Kushana: nickm | 2007-01-02 14:40:14 -0500
Stop polluting new descriptors with the defaults-to-1 "opt eventdns" entry.


svn:r9239
2007-01-02 20:08:03 +00:00
Nick Mathewson
e3d5e4fcae Okay, now descriptors seem to be buildable.
svn:r9216
2006-12-29 17:10:29 +00:00
Nick Mathewson
a77bbe2346 r11753@Kushana: nickm | 2006-12-29 11:30:28 -0500
Fix flipped sign in compare: make descriptors buildable again.


svn:r9214
2006-12-29 16:31:37 +00:00
Nick Mathewson
7cfdac1bf6 r11737@Kushana: nickm | 2006-12-28 18:32:13 -0500
Remove some dead code; refactor some duplicated code.


svn:r9206
2006-12-29 02:49:12 +00:00
Nick Mathewson
b59573949e r11736@Kushana: nickm | 2006-12-28 17:46:23 -0500
Mark a pile of XXXX comments as targetted for 0.1.2: some because they look important, some because they look easy.


svn:r9205
2006-12-29 02:47:51 +00:00
Nick Mathewson
d9f1f3533d r11724@Kushana: nickm | 2006-12-28 14:22:35 -0500
Refactor and unify my-ip-addr-changed logic.  Make change in IP address or in nameservers reset and relaunch DNS hijacking tests.


svn:r9200
2006-12-28 21:29:20 +00:00
Nick Mathewson
e5f5b96ca6 r11723@Kushana: nickm | 2006-12-28 13:52:48 -0500
Fix bug 364: check for whether popular hostnames (curently google, yahoo, mit, and slashdot) are getting wildcarded.  If they are, we are probably behind a DNS server that is useless: change our exit policy to reject *:*.


svn:r9199
2006-12-28 21:29:11 +00:00
Nick Mathewson
58ae3cd648 r11713@Kushana: nickm | 2006-12-24 22:42:08 -0500
Better handling of internal addresses wrt X-Your-Address-Is (never believe them; never provide them.) Also, report something useful for X-Your-Address-Is with one-hop tunneled connections.


svn:r9191
2006-12-25 03:42:38 +00:00
Nick Mathewson
baac5389a1 r11690@Kushana: nickm | 2006-12-23 22:09:53 -0500
Hmm. Maybe I should have been compiling these before I checked them in.


svn:r9178
2006-12-24 03:09:58 +00:00
Nick Mathewson
bf1014692f r11686@Kushana: nickm | 2006-12-23 22:05:57 -0500
More changes wrt unnecessary disk writes.


svn:r9176
2006-12-24 03:06:03 +00:00
Nick Mathewson
f3fd5d9032 r11680@Kushana: nickm | 2006-12-23 21:45:05 -0500
Remove code to look for keys in their old locations: we havent stored them there since 0.0.7.2.


svn:r9175
2006-12-24 02:45:53 +00:00
Nick Mathewson
bba5a3533f r11679@Kushana: nickm | 2006-12-23 21:38:41 -0500
Update the state file less often when AvoidDiskWrites is set.


svn:r9174
2006-12-24 02:45:46 +00:00
Nick Mathewson
4d948281c3 r11676@Kushana: nickm | 2006-12-23 20:42:17 -0500
Add an orport option to dirserver lines so that clients can tell where to connect to open an encrypted tunnel to a dirserver even before they have its descriptor.


svn:r9171
2006-12-24 02:45:27 +00:00
Roger Dingledine
f175aca3a8 and then revert half of r9138
svn:r9140
2006-12-16 07:04:26 +00:00
Nick Mathewson
80b8abf7be r11618@Kushana: nickm | 2006-12-16 02:00:52 -0500
Make router_is_me work without calling router_rebuild_descriptor.


svn:r9139
2006-12-16 07:00:59 +00:00
Roger Dingledine
9cd8feb649 fix an infinite loop and a memory leak in r9131
svn:r9138
2006-12-16 06:56:58 +00:00
Roger Dingledine
ce51a1d349 a changelog for write limiting. also, disable the "advertise dirport
until we reach our max bandwidth if it's tiny" trick now that we
do the bandwidth self-test on boot.


svn:r9134
2006-12-15 21:39:35 +00:00
Nick Mathewson
ab2fc7bd62 r11596@Kushana: nickm | 2006-12-15 10:57:12 -0500
Mark some TODO items as done.  Also, never include ourself in our family list.


svn:r9131
2006-12-15 21:26:15 +00:00
Roger Dingledine
c4ed331d8d oh, and catch the other instance we should fix
svn:r9122
2006-12-15 08:14:32 +00:00
Roger Dingledine
0bc0688668 if we rotate our onion key, publish a new descriptor, and
die soon after, we want to stick with that onion key when
we restart.


svn:r9121
2006-12-15 07:58:31 +00:00
Nick Mathewson
38bd6837db r11588@Kushana: nickm | 2006-12-15 02:04:32 -0500
Add a LastRotatedOnionKey variable to the state file, so we can rotate onion keys a week after they change even if we never stay up for a whole week at a time.  Should fix bug 368.


svn:r9120
2006-12-15 07:04:37 +00:00
Roger Dingledine
97c83a4c09 finish enabling begin-dir cells. require one-hop circs for
socks-command-connect-dir streams, so we don't open new anonymity
questions.


svn:r9099
2006-12-13 02:49:45 +00:00
Roger Dingledine
0dbf725927 Infrastructure to test BEGIN_DIR cells.
New socks command CONNECT_DIR. New config option TunnelDirConns that
builds a circ ending at the directory server and delivers a BEGIN_DIR
cell if it's running 0.1.2.2-alpha or later. We still need to make
one-hop circs when appropriate, while making other conns avoid them.


svn:r9098
2006-12-13 00:28:56 +00:00
Roger Dingledine
ab68e312bd actually, i think this fix was closest to what i originally
intended. this way we don't call resolve-my-address, which
yells and screams if we're using an internal address (mere
clients should not have to care).


svn:r8998
2006-11-26 20:01:45 +00:00
Nick Mathewson
116ae04c2d r9399@totoro: nickm | 2006-11-26 14:22:17 -0500
Actually, clients *should* try to guess their addresses.


svn:r8997
2006-11-26 19:22:25 +00:00
Nick Mathewson
68142b18cd r9396@totoro: nickm | 2006-11-26 13:36:29 -0500
Fix router_new_address_suggestion() so it only changes last_guessed_ip() when it actually calls resolve_my_address(). (bug found by dev-girl)


svn:r8996
2006-11-26 18:36:51 +00:00
Nick Mathewson
1bf1f9d2fc r9449@Kushana: nickm | 2006-10-31 00:12:02 -0500
Dump breakdown of PK operations when we get a USR2 signal.  This should help us figure out of we are doing some of them for stupid reasons.


svn:r8881
2006-10-31 19:17:07 +00:00
Nick Mathewson
829bf4dcd0 r8970@totoro: nickm | 2006-10-09 10:12:53 -0400
Win32 patch from Matt Edman: fix compilation bugs by casting to int; defining SSIZE_T; defining USE_TWOS_COMPLEMENT in windows orconfig.h; and using the proper names for win32 functions on GetProcAddress. Also fixes bug 295.


svn:r8669
2006-10-09 15:46:21 +00:00
Nick Mathewson
c6f2d725d0 r8957@totoro: nickm | 2006-10-08 22:35:17 -0400
The otherwise regrettable MIPSpro C compiler warns about values set but never used, and about mixing enums and ints; these are good warnings, and so should be fixed.  This removes some dead code and some potential bugs. Thanks to pnx.


svn:r8664
2006-10-09 02:35:51 +00:00
Roger Dingledine
06e5b2283c minor cleanups
svn:r8622
2006-10-07 00:50:39 +00:00
Roger Dingledine
baf208d7b3 bugfix: When testing reachability of our dirport, don't launch a new
test if there's already one in progress.


svn:r8604
2006-10-06 04:02:27 +00:00
Nick Mathewson
6e0b90a902 r8838@totoro: nickm | 2006-10-02 15:24:39 -0400
Partial implementation of revised nickname syntax for controllers.  Implement ability to look up routers by "verbose" nicknames; add a per-v1-control-connection flag to turn the feature on in events.  Needs testing, spec, ability to actually turn on the flag, double-checking that we wont overflow any nickname buffers, and changelog.


svn:r8582
2006-10-03 18:58:40 +00:00
Roger Dingledine
a3efc8e3d1 - V1 authorities should set "HSAuthoritativeDir 1" to continue being
hidden service authorities too.
- Just because your DirPort is open doesn't mean people should be
  able to remotely teach you about hidden service descriptors. Now
  only accept rendezvous posts if you've got HSAuthoritativeDir set.


svn:r8573
2006-10-01 22:16:55 +00:00
Roger Dingledine
e6f4431722 stop trying to hammer router_rebuild_descriptor() when we don't
have a public address we like yet.


svn:r8554
2006-09-30 20:40:26 +00:00
Nick Mathewson
c2d304366b r9032@Kushana: nickm | 2006-09-29 18:51:42 -0400
Now, all log messages should be distinct.


svn:r8545
2006-09-29 22:51:47 +00:00
Nick Mathewson
7d366f61cb r9025@Kushana: nickm | 2006-09-29 18:33:13 -0400
Differentiate more duplicated log entries


svn:r8542
2006-09-29 22:33:40 +00:00
Nick Mathewson
0335bd51d3 r9005@Kushana: nickm | 2006-09-29 10:37:55 -0400
Implement DESCCHANGED event to tell controller when our router descriptor changes.


svn:r8533
2006-09-29 18:13:25 +00:00
Nick Mathewson
907fc6c73e r8977@Kushana: nickm | 2006-09-28 19:56:41 -0400
Make "is a v1 authority", "is a v2 authority", and "is a hidden service authority" into separate flags so we can eventually migrate more trust away from moria.


svn:r8523
2006-09-28 23:57:59 +00:00
Nick Mathewson
adade79f68 r8879@Kushana: nickm | 2006-09-21 17:20:31 -0400
Oops from earlier patch; add "opt eventdns" to unittests, fix bug in routerdesc generation.


svn:r8444
2006-09-21 21:49:03 +00:00
Nick Mathewson
a942441615 r8872@Kushana: nickm | 2006-09-21 14:00:20 -0400
Implement server-side reverse DNS using eventdns.  Add an option to routerdescs so we can tell which servers have eventdns enabled.


svn:r8437
2006-09-21 21:48:06 +00:00
Nick Mathewson
5ebb949c9f Stop searching routerlist for routers with the same identity as other routers (on router insert): we already have a map for that. (We need to add an index field to routerinfo_t so we can figure out which point in the routerlist to replace.) Also, add a comment to routerlist.c; arma, please advise?
svn:r8432
2006-09-19 23:18:30 +00:00
Roger Dingledine
bfa78b3dea actually, do the bandwidth test anyway, if you've been up at
least 6 hours at your previous address.


svn:r8403
2006-09-15 18:07:11 +00:00
Roger Dingledine
a51ec44466 avoid thrashing the bandwidth exercise when we change IPs a lot.
(we avoid simply by not doing any new tests when we change IPs --
it looks like we retain our previous bandwidth estimates, so there's
no need to do new exercise. though in some cases new exercises may
still be useful. one day we'll do something smarter.)


svn:r8402
2006-09-15 18:03:53 +00:00
Roger Dingledine
c22dc94fe6 make my bandwidth exercises actually happen
svn:r8400
2006-09-15 05:53:00 +00:00
Roger Dingledine
769f9201a6 Send out a burst of long-range drop cells after we've established that
we're reachable. Spread them over 4 circuits, so hopefully a few will
be fast. This exercises our bandwidth and bootstraps us quicker.


svn:r8399
2006-09-15 05:30:25 +00:00
Nick Mathewson
e58b9c1151 r8819@Kushana: nickm | 2006-09-15 00:27:45 -0400
Implement a smartlist_uniq() that will with luck not end the world.


svn:r8396
2006-09-15 04:27:58 +00:00
Peter Palfrader
2cf6cfe189 r9758@danube: weasel | 2006-09-14 07:10:12 +0200
Add a comment


svn:r8391
2006-09-14 05:17:02 +00:00
Peter Palfrader
7fcec09560 r9753@danube: weasel | 2006-09-14 07:07:02 +0200
Remove duplicates from MyFamily


svn:r8390
2006-09-14 05:07:34 +00:00
Peter Palfrader
984e8f6efb r9736@danube: weasel | 2006-09-14 05:53:06 +0200
Refactor dirserv_parse_fingerprint_file(fname) into dirserv_load_fingerprint_file():
 There is not need to put together the path to the approved-routers file in more than one place.


svn:r8386
2006-09-14 04:53:23 +00:00
Roger Dingledine
e56dbb810f start remembering X-Your-Address-Is hints even if you're
a client, so you can become a server more smoothly.


svn:r8359
2006-09-09 19:36:51 +00:00
Roger Dingledine
5f6351ceb3 fix typo, add log message
svn:r8357
2006-09-09 19:16:07 +00:00
Roger Dingledine
29b6d6560e add a "getinfo address" controller command.
svn:r8354
2006-09-09 03:18:39 +00:00
Roger Dingledine
43edbf0461 prefer calling it a client rather than an OP
svn:r8334
2006-09-07 01:00:37 +00:00
Nick Mathewson
4ff4577beb r6908@Kushana: nickm | 2006-07-26 12:38:52 -0400
Refactor connection_t into edge, or, dir, control, and base subtypes.  This might save some RAM on busy exit servers, but really matters most in terms of correctness.


svn:r6906
2006-07-26 19:07:26 +00:00
Roger Dingledine
e1f30a5f21 when we find our dirport to be reachable, mark our descriptor
dirty so we'll tell the world. (fixes bug 306 reported by pnx)


svn:r6787
2006-07-18 03:06:55 +00:00
Roger Dingledine
ac258d2cc8 Start publishing one minute or so after we find our ORPort
to be reachable. This will help reduce the number of descriptors
we have for ourselves floating around, since it's quite likely
other things (e.g. DirPort) will change during that minute too.


svn:r6786
2006-07-18 03:06:12 +00:00
Roger Dingledine
c85745cfe2 parameterize the loudness of log_addr_has_changed(), since it's the
only place where we inform the user of a new IP address, if we're
guessing it from external sources.


svn:r6780
2006-07-17 19:33:54 +00:00
Roger Dingledine
542adb88d7 Make a louder statement the first time we learn a guessed
IP address.


svn:r6779
2006-07-17 08:17:51 +00:00
Roger Dingledine
a2a89da693 and don't try to build the descriptor every second, if it's dirty
but we don't have a known address.


svn:r6777
2006-07-17 06:59:56 +00:00
Roger Dingledine
42e2057d67 fix some more places where we shouldn't crash if we can't build
our own descriptor yet.


svn:r6775
2006-07-17 06:54:28 +00:00
Roger Dingledine
9db7b2c068 Allow servers with no hostname or IP address to learn their IP address
by asking the directory authorities. This code only kicks in when you
would normally have exited with a "no address" error.

This design is flawed, though, since the X-Your-Address-Is header is not
authenticated, and doing it this way introduces too many new attacks. The
right answer is to give IP address hints inside the HELLO cell; much of
this code can be reused when we switch.


svn:r6774
2006-07-17 06:35:06 +00:00
Roger Dingledine
ee5f512e13 parameterize the loudness of resolve_my_address(), and call things
IP addresses, not IPs.


svn:r6764
2006-07-15 20:26:05 +00:00
Roger Dingledine
05d0b70573 Get rid of the router_retry_connections notion. Now routers no longer
try to rebuild long-term connections to directory authorities, and
directory authorities no longer try to rebuild long-term connections to
all servers.

We still don't hang up connections in these two cases though -- we need
to look at it more carefully to avoid flapping, and we likely need to
wait til 0.1.1.x is obsolete.


svn:r6712
2006-07-04 03:31:27 +00:00
Nick Mathewson
b7910202a3 Next batch of memory miserdom: mmap cached-routers file. This is sure to break somewhere.
svn:r6675
2006-06-22 07:01:54 +00:00
Roger Dingledine
2cd349903c be more lax about recognizing valid hexdigests.
svn:r6619
2006-06-13 12:05:59 +00:00
Roger Dingledine
0bfef523df simplify the tortls api: we only support being a "server", that
is, even tor clients do the same sort of handshake.

this has been true for years, so it's best to get rid of the
stale code.


svn:r6557
2006-06-07 06:10:54 +00:00
Nick Mathewson
853e2d99b6 Add a new warning to our "warn a lot" list: unused parameters. This means we have to explicitly "use" unuseds, but it can catch bugs. (It caught two coding mistakes so far.)
svn:r6532
2006-06-04 22:42:13 +00:00
Roger Dingledine
82ae38f649 be more verbose about testing reachability of our ORPort.
svn:r6506
2006-05-26 16:29:33 +00:00
Roger Dingledine
3c86402cc2 petty cleanups
svn:r6421
2006-04-25 07:00:04 +00:00
Roger Dingledine
934e9c49bb Regenerate our local descriptor if it's dirty and some local
function asks for it. This may resolve bug 286.


svn:r6412
2006-04-23 23:09:03 +00:00
Nick Mathewson
6ebd886511 forward-port: "Resolve" all XXX011 items, mostly by marking them non-011.
svn:r6396
2006-04-18 03:07:24 +00:00
Roger Dingledine
56df81199a that extra punctuation distracts me
svn:r6250
2006-03-27 05:30:16 +00:00
Roger Dingledine
6f08d121d9 Refactor and consolidate addr/exit policies into a new policies.c.
Fix some minor bugs and memory leaks along the way.


svn:r6246
2006-03-27 02:25:34 +00:00
Roger Dingledine
1db263ac3c stop writing the "router.desc" file, ever. nothing uses it anymore.
svn:r6224
2006-03-22 03:45:17 +00:00
Peter Palfrader
805754fdd9 Log server fingerprint on startup
svn:r6223
2006-03-22 03:40:59 +00:00
Roger Dingledine
c06e6ddadd Finish the transition from the word 'verified' to the words
'named' and 'valid'.


svn:r6188
2006-03-19 01:21:59 +00:00
Nick Mathewson
0f0e14c6e3 normalize whitespace.
svn:r6173
2006-03-17 04:43:37 +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
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
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
8db1e363c9 remove some redundant code now that we compress exit policies
after parsing them


svn:r6099
2006-03-08 19:34:34 +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
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
Roger Dingledine
ae249fc5a3 document the frequency for reachability testing by the
directory authorities.


svn:r6014
2006-02-14 04:33:59 +00:00
Roger Dingledine
259c65ab08 the last of the log convention conversion. finally.
svn:r6005
2006-02-13 10:33:00 +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
5f051574d5 Happy new year!
svn:r5949
2006-02-09 05:46:49 +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
76f1b7415b try to detect an assert error earlier
svn:r5834
2006-01-17 02:31:04 +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
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
Roger Dingledine
6dcbbda43b remove typo
svn:r5757
2006-01-08 22:16:09 +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
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
Nick Mathewson
1af630d32c Bite the bullet and limit all our source lines to 80 characters, the way IBM intended.
svn:r5582
2005-12-14 20:40:40 +00:00
Roger Dingledine
58366ffd24 when we changed from log_fn to debug/info/notice/warn/err,
we screwed up the formatting in wild and unpredictable ways.

fix it before it becomes convention to format logs in wild and
unpredictable ways.

still need to do src/common/ someday.


svn:r5551
2005-12-10 09:36:26 +00:00
Nick Mathewson
9cec3a13f5 remove some functions that are not used; #if0 out some files that are not likely to be used.
svn:r5471
2005-11-30 06:27:59 +00:00
Nick Mathewson
3bd613b44d Rename connection_get_by_identity_digest to reflect that it is OR-only. Make it use a hashtable instead of a linear search.
svn:r5469
2005-11-30 03:01:16 +00:00
Roger Dingledine
7aae63994f Recover better from TCP connections to Tor servers that are broken but
don't tell you (it happens!); and rotate TLS connections once a week.

1) If an OR conn becomes more than a week old, make it obsolete.
2) If it's obsolete and empty, kill it.
3) When an OR makes a second connection to you, allow it.
4) If we want to send a new create cell, but the best conn we've
   got is obsolete, and the router is 0.1.1.9-alpha-cvs or later, ask
   for a new conn instead.
5) When we time out on circuit building on the first hop, make that
   connection obsolete.


svn:r5429
2005-11-19 06:57:44 +00:00
Peter Palfrader
901712ee59 Remove ip address change flapping detection. It is not really needed and I do not think it works quite right.
svn:r5423
2005-11-18 19:28:34 +00:00
Nick Mathewson
75d85c8214 On directory servers, old_routers was wasting hundreds of bytes per superseded router descriptor. Roll the signed descriptor info and identifying info into a cache_info struct, and use only that for old_routers.
svn:r5349
2005-11-05 20:15:27 +00:00
Roger Dingledine
1991f6cf48 more doc cleanups and reorganizing
svn:r5336
2005-11-01 03:48:51 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
452f4cfa09 Convert circuituse, command, config, connection, relay, router, test to new logging interface
svn:r5308
2005-10-25 07:04:36 +00:00
Nick Mathewson
f9b0be526e Use LD_BUG as appropriate; convert rend* and router* to new logging interface; use new circ_log_path interface
svn:r5302
2005-10-24 19:39:45 +00:00
Nick Mathewson
37708e9b1b Avoid potential infinite recursion when building a descriptor
svn:r5292
2005-10-24 03:04:05 +00:00
Nick Mathewson
3347c1741d Refactor routerlist access slightly: always use router_get_by_routerlist(); change its interface; add modifier functions to add/remove elements from the current routerlist (so we can add indices).
svn:r5276
2005-10-18 17:43:54 +00:00
Peter Palfrader
0d9aedfcea Downgrade a few INFO level logs to DEBUG again. Also add two or three new
logs in cases where a calling function's log was downgraded and we wouldn't
get any log message otherwise.


svn:r5263
2005-10-17 16:21:42 +00:00
Roger Dingledine
fd165329b8 start calling it *ListenAddress rather than *BindAddress,
since none of our users know what it means to bind an address or port.


svn:r5260
2005-10-17 03:17:29 +00:00
Peter Palfrader
8808b26206 Check if our IP address has changed every 5 minutes. If it has, update our server descriptor, but not too often
svn:r5246
2005-10-12 22:41:16 +00:00
Nick Mathewson
bf9ff1c1e7 Do not check whether DirPort is reachable when we are suppressing it because of hibernation. (Backport candidate)
svn:r5235
2005-10-12 04:07:10 +00:00
Roger Dingledine
46af2d26d0 you can't declare variables in the middle of a block
svn:r5214
2005-10-07 18:56:21 +00:00
Nick Mathewson
ba24193ab5 Make doxygen marginally happier
svn:r5208
2005-10-06 04:33:40 +00:00
Nick Mathewson
5cf758764e Rate-limit warnings related to unrecognized MyFamily elements.
svn:r5204
2005-10-05 23:20:45 +00:00
Nick Mathewson
61ea516885 Check for named servers when looking them up by nickname;
warn when we'recalling a non-named server by its nickname;
don't warn twice about the same name.

Fix a bug in routers_update_status_from_networkstatus that made nearly
all clients never update routerinfo_t.is_named.

Try to list MyFamily elements by key, not by nickname.

Only warn about names that we generated ourself, or got from the local
user.

On TLS handshake, only check the other router's nickname against its
expected nickname if is_named is set.


svn:r5185
2005-10-04 22:23:31 +00:00
Nick Mathewson
2d203fdcf3 link nicknames to trusted directory servers; log these nicknames when mentioning servers; also, when we get a naming conflict; log which nicknames or keys are supposed to bind.
svn:r5184
2005-10-04 21:21:09 +00:00
Roger Dingledine
e28c31ebce we were leaking some memory every time the client changes IPs
svn:r5165
2005-09-30 06:03:04 +00:00
Roger Dingledine
609af664ac resolve a docdoc
svn:r5157
2005-09-30 00:43:40 +00:00
Roger Dingledine
54a662a542 re-enable dirport testing again
(still need the other half, to notice when it has worked.)


svn:r5152
2005-09-29 23:04:01 +00:00
Roger Dingledine
8ae6e1c226 Be more conservative about whether to advertise our dirport.
The main change is to not advertise if we're running at capacity and
either a) we could hibernate or b) our capacity is low and we're using
a default dirport.


svn:r5148
2005-09-29 06:45:03 +00:00
Roger Dingledine
03d0f62da0 make the numbers in read-history and write-history into uint64s,
so they don't overflow and publish negatives in the descriptor.
fixes bug 193.


svn:r5119
2005-09-23 08:29:58 +00:00
Roger Dingledine
cce469c5ce simplify
svn:r5081
2005-09-16 06:15:34 +00:00
Roger Dingledine
8585599965 correct "your server is reachable" log entries to indicate that it was
self-testing that told us so.


svn:r5034
2005-09-13 21:39:42 +00:00
Nick Mathewson
3dc5e77b58 Numerous changes to move towards client-side v2 directories.
connection.c:
- Add some more connection accessor functions to make directory
  download redundancy checking work.

directory.c, or.h, router.c, routerlist.c:
- Start on logic to note when networkstatus downloads fail.

dirserv.c, routerlist.c, routerparse.c:
- Start maintaining an is_named field in routerstatus_t.  Don't
  actually look at it yet.

dirserv.c, routerlist.c:
- Remove expired networkstatus objects.

or.h:
- Make some booleans into bitfields
- Add prototypes

routerlist.c:
- Sort networkstatus list by publication time
- Function to remove old (older than 10 days) networkstatus objects.
- Function to set a list of routerinfo_ts' status info from the
  current set of networkstatus objects.
- Function to tell which routerinfos we need to download based no the
  current set of networkstatus objects.
- Do not launch a networkstatus download if a redundant one is in progress.

routerparse.c:
- Keep router entries in networkstatus sorted by digest.


svn:r5012
2005-09-12 06:56:42 +00:00
Nick Mathewson
059148f588 Only caches download network-status for now, and they use a different strategy. Add an element to connection_t to remember what we are downloading, and a function to recognize our own fingerprint.
svn:r4944
2005-09-08 20:18:15 +00:00
Roger Dingledine
c9e1c41873 dirserv_add_descriptor() doesn't chew up its argument anymore,
so we can stop protecting it.


svn:r4919
2005-09-08 05:37:22 +00:00
Roger Dingledine
03ddeb2620 strip obsolete code
svn:r4918
2005-09-08 05:32:41 +00:00
Nick Mathewson
5c6c88e76d More stuff for new directories.
- Distinguish v1 authorities (all currently trusted directories) from
  v2 authorities (all trusted directories).
    - Add configuration option for which dirs are v1 authories.
    - Add configuration option for whether to be a v1 authority.
    - Make trusted dirserver selection functions take options to
      choose which functionality we need.
    - Remove option when getting directory cache to see whether they
      support running-routers; they all do now.  Replace it with one
      to see whether caches support v2 stuff.

- Parse, cache, and serve network-status objects properly.

- Serve compressed groups of router descriptors.  The compression logic
  here could be more memory-efficient.

-


svn:r4911
2005-09-07 16:42:53 +00:00
Roger Dingledine
d2a5b614eb if you're an auth dir server, start yourself out as verified.
svn:r4907
2005-09-03 23:10:28 +00:00
Roger Dingledine
711cad94ed when we think a router is unreachable, pass the message back to the
server's logs, and make it a 'warn'.
also, fix a memory leak for rejected router descriptors.


svn:r4889
2005-08-31 06:14:37 +00:00
Roger Dingledine
e9524f9d2d refactor -- no actual changes
svn:r4885
2005-08-30 06:43:07 +00:00
Roger Dingledine
53431a4950 fix compile complaints (and a bug)
svn:r4862
2005-08-26 21:30:52 +00:00
Nick Mathewson
208bdf5f27 No need to load cached directory twice
svn:r4860
2005-08-26 21:19:58 +00:00
Nick Mathewson
7f78be1659 Clean up the "add myself as a trusted dirserver" code.
svn:r4849
2005-08-26 19:31:51 +00:00
Nick Mathewson
cf90a36dd1 Add quotes around filenames in src/or
svn:r4845
2005-08-26 18:44:26 +00:00
Nick Mathewson
d54d7b7ec1 Add some documentation; move the signature generation logic into routerparse.c along with the hash generation logic; make router signing use it as well.
svn:r4840
2005-08-26 15:34:53 +00:00
Roger Dingledine
893acb3acc Make a new AssumeReachable config option that will publish anyway.
Also, let authdirservers start without setting their Address field.
Something is still not working though. Will fix in morning.


svn:r4839
2005-08-26 07:41:19 +00:00
Nick Mathewson
54a6a8f0ef Start implementing the server side of the new directory protocol.
Probably very buggy, since I can't actually run an authdir.

Features
- Generate and publish new network-status format
- Code to cache and re-serve network-status objects generated by others.
- Publish individual descriptors (by fingerprint, by "all", and by
  "tell me yours.")  [Still needs compression logic]
- Publish client and server recommended versions seprately.
- Add digest of descriptor to routerinfo_t, so we can track them better, and
  length, so we can server them more easily.

Cleanups
- Unify code to sign directory-like things
- Make resolve_my_address() able to tell you which name it wound up resolving.
- Unify code to store and serve directory-like things so it all uses
  cached_dir_t.
- Unify code to set the value of cached_dir_t objects.


svn:r4835
2005-08-25 20:33:17 +00:00
Roger Dingledine
86f85f240c be much more conservative about logging reachability complaints.
the ones it logs now are probably genuine problem servers.


svn:r4832
2005-08-24 14:31:32 +00:00
Roger Dingledine
a120cc20c1 Dirservers now do their own external reachability testing of each
Tor server, and only list them as running if they've been found to
be reachable.

Dirservers also log trouble servers, but only start complaining loudly
after they've been up for an hour, to reduce false positives. We still
need to do something about the fact that it is quite loud when there
are many trouble servers.


svn:r4829
2005-08-24 02:31:02 +00:00
Roger Dingledine
8b766d1b7e fix bad logic that has been lurking for eons, that now prevented us
from uploading descriptors after the first one.


svn:r4818
2005-08-23 00:47:44 +00:00
Roger Dingledine
676b330eb2 Make DirPostPeriod config option obsolete.
Force new descriptor upload every 18 hours, not 24, to avoid races.
Change rate-limiting on new descriptors due to bandwidth changes, from
45 minutes to 20 minutes.


svn:r4814
2005-08-22 21:53:12 +00:00
Nick Mathewson
dc09c7fc73 Implement new (reduced-frequency) upload rules. arma, you should review this.
svn:r4806
2005-08-22 03:10:53 +00:00
Nick Mathewson
249b72f53e Replace (Fascist)Firewall* with a new ReachableAddresses option that understands address policies.
svn:r4751
2005-08-08 21:58:48 +00:00
Nick Mathewson
11ff0aba80 Make clients regenerate their keys when their IP address changes.
svn:r4688
2005-08-03 20:42:17 +00:00
Nick Mathewson
2bd6040f62 Rename cross-format config.c stuff to config_* and or_options_t-specific stuff to option[s]_*
svn:r4641
2005-07-23 01:58:05 +00:00
Roger Dingledine
97174b67c2 if you're an auth dir server, always publish your dirport,
even if you haven't yet found yourself to be reachable.

this is the cause of Jan Tore Morken's recent or-talk bug.


svn:r4575
2005-07-15 18:49:35 +00:00
Roger Dingledine
3bb756b93b forward-port the 0.1.0.11 stuff
svn:r4515
2005-07-01 02:01:21 +00:00
Nick Mathewson
232861ba42 Docment or add DOCDOC comments to undocumented functions in src/or. Make function definition format uniform.
svn:r4411
2005-06-11 18:52:12 +00:00
Roger Dingledine
b349e60543 don't tell people you're publishing the server descriptor if you're
actually not.


svn:r4387
2005-06-09 21:23:54 +00:00
Nick Mathewson
0831823763 Change end-of-file NLNL convention. It turns out arma I and I agree.
svn:r4382
2005-06-09 19:03:31 +00:00
Roger Dingledine
cfc89f8753 pay more attention to the ClientOnly config option
svn:r4367
2005-06-09 08:54:42 +00:00
Roger Dingledine
9ed7b53143 don't upload your descriptor if rebuilding it failed
svn:r4352
2005-06-08 19:45:17 +00:00
Roger Dingledine
4855990d37 clean up a few more log entries
svn:r4304
2005-05-27 17:43:43 +00:00
Roger Dingledine
040a748d87 i screwed up the dirport reachability testing when we don't yet
have a cached version of the directory. hopefully now fixed.


svn:r4284
2005-05-23 05:20:52 +00:00
Roger Dingledine
b7d6b8a397 doxygeny goodness from tyranix
svn:r4262
2005-05-17 17:01:36 +00:00
Nick Mathewson
00f2a09380 Append default exit policy before checking for implicit internal addresses: fix bug 129.
svn:r4201
2005-05-14 00:13:17 +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
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
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
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
ad4eca60ec add geoff's NoPublish patch
svn:r4084
2005-04-21 10:40:48 +00:00
Roger Dingledine
13e211de17 We're printing the host mask wrong in exit policies in server descriptors.
I believe this isn't a critical bug tho, since we're still obeying the
exit policy internally.


svn:r3987
2005-04-02 08:55:31 +00:00
Nick Mathewson
0e81265359 update copyright notices.
svn:r3982
2005-04-01 20:15:56 +00:00
Roger Dingledine
453a822425 when you decide you're reachable, actually publish your descriptor
right then.


svn:r3968
2005-04-01 09:28:14 +00:00
Roger Dingledine
a28ae7a70c fix assert: if our dirport isn't reachable yet, don't trick
*ourselves* into thinking the dirport is zero. but continue
to tell other people that it is.


svn:r3952
2005-04-01 07:42:32 +00:00
Roger Dingledine
003d9df6b0 authdirservers shouldn't do orport reachability detection,
since they're in clique mode, so it will be rare to find a
server not already connected to them.


svn:r3949
2005-04-01 07:09:18 +00:00
Roger Dingledine
1f5c8335e8 still publish your descriptor if orport is reachable but dirport isn't
when building testing circs for orport testing, require high-bandwidth
nodes, so fewer circs fail. complain about unreachable orport separately
from unreachable dirport.


svn:r3935
2005-03-31 19:26:33 +00:00
Roger Dingledine
9b5432214d but only do the rapid reachability testing if we're hoping to be a server.
svn:r3902
2005-03-27 11:52:15 +00:00
Roger Dingledine
1328383482 make it clearer to the human that his server is testing
its reachability. tell him when it succeeds, or when 20
minutes pass and it hasn't succeeded yet.


svn:r3882
2005-03-26 01:43:39 +00:00
Roger Dingledine
6659cd5e8e options->MaxAdvertisedBandwidth only replaces advertised
bandwidthrate, not advertised bandwidthcapacity


svn:r3818
2005-03-22 20:41:28 +00:00
Nick Mathewson
ec81f87018 Implement an option to cap bandwidth-to-advertise. Arma: can you improve the manpage entry by explaining why you would want to do this?
svn:r3813
2005-03-22 19:01:46 +00:00
Nick Mathewson
f5989afde2 Add opt hibernating; fix bug 78
svn:r3807
2005-03-22 06:08:28 +00:00
Roger Dingledine
35953edae0 Implement controller's "extendcircuit" directive.
Also refactor circuit building so we plan the whole path ahead
of time.


svn:r3797
2005-03-22 00:42:38 +00:00
Roger Dingledine
856ab90ca8 stop logging at -l notice every single time a create cell successfully
gets processed


svn:r3791
2005-03-19 23:04:15 +00:00
Nick Mathewson
b88c4ba11c Turn addr_policy_compare from a tristate to a quadstate; this should help address our "Ah, you allow 1.2.3.4:80. You are a good choice for google.com" problem.
svn:r3786
2005-03-19 06:57:16 +00:00
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
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
Geoff Goodell
af15c711c9 redefining default exit policy as per or-talk discussion
svn:r3739
2005-03-11 05:07:31 +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
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
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
6e6d95b3db Change from inet_ntoa to a threadproof tor_inet_ntoa.
svn:r3656
2005-02-22 08:18:36 +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
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
Roger Dingledine
0551e3a814 reject more default filesharing ports by default.
svn:r3500
2005-02-02 04:15:40 +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
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
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
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
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
b6173b7b68 0.0.9 broke hibernation. darn it.
svn:r3147
2004-12-13 19:42:46 +00:00
Roger Dingledine
464338b250 when hibernating, don't advertise any ports
this is important for the dirport, because clients will still
ask you for a directory, and they'll be sad when you're down.
and do the other ports too, because hey, they're not listening.


svn:r3133
2004-12-11 23:53:59 +00:00
Nick Mathewson
fc87758ff3 Add function to check that addr_policy_t is okay; change struct addr_policy_t to addr_policy_t.
svn:r3070
2004-12-04 01:14:36 +00:00
Roger Dingledine
db5e100cde clean up 3 more underflow possibilities
svn:r3063
2004-12-02 04:31:52 +00:00
Roger Dingledine
0799804c60 fix redundant (and dangerous) NUL termination
svn:r3062
2004-12-02 04:16:18 +00:00
Nick Mathewson
7fbd297532 Suggestion from weasel: Make tor --version --version dump the cvs Id of every file.
svn:r3019
2004-11-29 22:25:31 +00:00
Roger Dingledine
7fc30fc1e6 accept *:706 (silc) by default
svn:r3006
2004-11-28 15:49:12 +00:00
Roger Dingledine
22727b4edc wrong is ok, and right is fine, but in between is apparently
totally unacceptable to me.


svn:r3005
2004-11-28 11:39:53 +00:00
Nick Mathewson
6f5dbefa7e Normalize space: add one between every control keyword and control clause.
svn:r3003
2004-11-28 09:05:49 +00:00
Roger Dingledine
7c9a707900 remove emacs droppings, since nick says he doesn't need them anymore
svn:r2989
2004-11-26 04:00:55 +00:00
Nick Mathewson
f91152ce6a Clarify a bunch of log messages
svn:r2983
2004-11-25 04:20:10 +00:00
Nick Mathewson
22dba27d8d Normalize a few more kinds of whitespace. We now dislike:
- func (args)
  - if (x){
This doesn't normalize if(x), for(x); while(x), and friends.


svn:r2943
2004-11-22 23:28:26 +00:00
Nick Mathewson
d4754b334c Compile cleanly on windows; prevent some insane bandwidth cases (e.g., "BandwidthBurst 1000 TB" from occuring.
svn:r2941
2004-11-22 22:24:10 +00:00
Nick Mathewson
983a335f3b Normalize space
svn:r2939
2004-11-22 22:13:34 +00:00
Nick Mathewson
bdb61f2a04 fix typo
svn:r2925
2004-11-21 05:06:22 +00:00
Nick Mathewson
36f4e15e81 Call init_keys() where needed; fix hibernate bug.
svn:r2924
2004-11-21 04:19:04 +00:00
Nick Mathewson
8acaf8e187 Add "MEMUNIT" and "INTERVAL" types to configuration. Also tweak Accounting setup. More docs needed
svn:r2911
2004-11-20 00:37:00 +00:00
Nick Mathewson
08627d5d87 Track whether descriptor is dirty/uploaded. When any options are set, mark it dirty. Once a minute, regenerate and upload the server descriptor if it is dirty.
svn:r2832
2004-11-13 16:53:48 +00:00
Nick Mathewson
5109de5626 Rename exit_policy to addr_policy, since it gets used for SOCKS and directory connections too. Make all policies get validated in options_validate, and make SOCKS/directory policies get set in options_act.
svn:r2819
2004-11-12 19:39:13 +00:00
Nick Mathewson
5a5be93f80 Normalize whitespace; add a "tell me about all the unnormalized whitespace" target; fix a braino in dirserv.c
svn:r2758
2004-11-09 20:04:00 +00:00
Nick Mathewson
7daab4034d Fix windows build for VC6; centralize newline-fiasco-damage-control logic
svn:r2756
2004-11-09 19:13:08 +00:00
Nick Mathewson
cd753df7bf Resolve many XXXs and all DOCDOCs
svn:r2755
2004-11-09 18:22:17 +00:00
Roger Dingledine
9f3e3d2b71 stop wanting to split init_keys()
svn:r2735
2004-11-09 07:29:05 +00:00
Nick Mathewson
180e0a9326 Make check_private_dir trimodal (check/create/ignore), not bimodal (create/ignore).
svn:r2733
2004-11-09 07:12:31 +00:00
Roger Dingledine
6521c2ce51 Stop using the wrong DataDirectory when we're validating.
Also validate/normalize the DataDirectory better.


svn:r2732
2004-11-09 07:05:53 +00:00
Roger Dingledine
8b9d7da59f while we hibernate, our declared bandwidth capacity is 0
svn:r2710
2004-11-07 23:19:12 +00:00
Roger Dingledine
394554cfbf Clean up copyrights.
Break connection_consider_empty_buckets() out of
connection_read_bucket_decrement().


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


svn:r2692
2004-11-06 05:18:11 +00:00
Roger Dingledine
d0c158c8d6 clarify the bandwidthburst and bandwidthrate are in bytes
(niels had thought they were in bits, or kb, or something)


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


svn:r2661
2004-11-03 18:33:07 +00:00
Roger Dingledine
85c79ffbc7 canonicalize "src" and "dest" arg order in crypto.c (and others)
svn:r2644
2004-11-02 02:28:51 +00:00
Nick Mathewson
2fbf31533b Tricksy compiler warnings! We hates them, hates them forever, my precious!
svn:r2615
2004-10-27 21:14:11 +00:00
Nick Mathewson
44d4516155 Use tor_snprintf, not snprintf
svn:r2609
2004-10-27 06:37:34 +00:00
Nick Mathewson
06fa8fc05f Avoid strcat; use snprintf or strlcat instead
svn:r2605
2004-10-27 06:25:29 +00:00
Nick Mathewson
bc62f8e983 Replace sprintf with snprintf
svn:r2602
2004-10-27 05:53:07 +00:00
Nick Mathewson
e5049d5aa3 Remove routerinfo_t->is_trusted_dir, and all the twisted machinery used to
maintain it.

Have clients default to the nickname "client" in their certificates.

Give a less frightening warning on obsolete (pre-0.0.8) routerinfo_t's.


svn:r2568
2004-10-19 18:19:59 +00:00
Roger Dingledine
97a0a43511 start the process of making 0.0.7* obsolete
svn:r2565
2004-10-17 21:51:20 +00:00
Roger Dingledine
de65052312 don't assert multiple things in the same tor_assert()
svn:r2544
2004-10-16 22:14:52 +00:00
Nick Mathewson
a42adce362 fix memory leak in router.c; start relying on NULL==(zero bytes)
svn:r2538
2004-10-16 20:38:57 +00:00
Nick Mathewson
7fa5d224d4 Implement "families" of coadministered nodes; prevent them all from appearing on the same circuit.
svn:r2523
2004-10-15 01:58:11 +00:00
Nick Mathewson
08c33f0b46 Compile without warnings on windows
svn:r2491
2004-10-14 04:06:24 +00:00
Nick Mathewson
bd10bf4b5b Try to always dtrt if routerlist==NULL
svn:r2489
2004-10-14 03:44:45 +00:00
Nick Mathewson
1c9426d6e0 Build without warnings on mac gcc 3.3
svn:r2487
2004-10-14 03:18:14 +00:00
Roger Dingledine
aebc3a03ba more int to size_t conversions, fixing one or more amd64 bugs
plus a whitespace patch on config.c from vicman


svn:r2482
2004-10-14 02:47:09 +00:00
Nick Mathewson
0d5a847f12 Remove need for dirservers file: now, we note trusted dirservers in configuration options, and only need to remember addr:port and key digest for each one.
svn:r2479
2004-10-14 01:44:32 +00:00
Nick Mathewson
9dc72de41f Omit any exit rules that follow a catch-all rule when writing a router descriptor.
svn:r2459
2004-10-13 01:25:42 +00:00
Nick Mathewson
dad7c71686 Workaround for bug on windows where cached-directories get crlf corruption.
svn:r2426
2004-10-07 20:22:58 +00:00
Nick Mathewson
2bba65148b Refactor fingerprint handling: remember hex digests (no spaces) instead of beautified fingerprints
svn:r2422
2004-10-06 13:31:48 +00:00
Roger Dingledine
136d4e5739 prefer tor_free to free
plus complain more loudly when we fail to parse a dir we just fetched


svn:r2401
2004-09-29 06:52:36 +00:00
Roger Dingledine
a2517b4f07 checking only 0.0.7 and 0.0.8 didn't work, because some dirservers
files have really old descriptors for the authdirservers, so we're
asking them in the new format because they're too old.

now we actually compare the version to a cutoff version, and act
appropriately.

also take this chance to use only >=0.0.8 servers for dns resolves,
because of the recent bugs. we'll bump to >=0.0.9pre1 once there are
some servers running that.


svn:r2380
2004-09-27 06:00:43 +00:00
Roger Dingledine
fa0a1ec49f cleanup: use strcmpstart() in more places
svn:r2372
2004-09-23 22:18:50 +00:00
Nick Mathewson
0ef85f6dba Some platforms have weird translations when you open files in "test" mode; make read/write_str_to_file aware.
svn:r2336
2004-09-08 07:16:34 +00:00
Nick Mathewson
86980cf6e2 Functions to test nickname validity
svn:r2269
2004-08-18 04:44:24 +00:00