Commit Graph

852 Commits

Author SHA1 Message Date
Nick Mathewson
bae366eff0 r11702@Kushana: nickm | 2006-12-24 01:31:59 -0500
Patch from Edmanm, slightly modified.  Original change list:
   - Support running the Tor service with a torrc not in the
     same directory as tor.exe (Bug #356) and default to using the torrc
     located in the %appdata%\Tor\ of the user who installed the service
   - Removed the supposedly misleading error message mentioned in Bug #294
   - Fixed some CloseHandle()s that should've been CloseServiceHandle()s
   - Fixed some nt_service_foo() return values to be consistent
   - Resolved some nt_service_foo() DOCDOCs
   - Fixed one trivial typo that I happened to randomly notice
 
 Changes:
   - Make more comments into "imperative" house style.
   - Remove special handling for "-f"; only use --options.
   - Quote all options.
   - Clean up whitespace
 


svn:r9185
2006-12-24 06:32:24 +00:00
Roger Dingledine
04409f202d reenable write limiting. nick finally convinced me this was
a smart move.

more todo sub-items remain for it.


svn:r9101
2006-12-13 07:08:36 +00:00
Nick Mathewson
7c79495137 r11468@Kushana: nickm | 2006-12-07 14:56:57 -0500
Revise logic used to flush state to disk. Now, we try to batch non-urgent changes so that we do not do too many writes, and we save very-non-urgent changes every once in a rare while, and we never save more than once per second.


svn:r9047
2006-12-07 20:11:30 +00:00
Nick Mathewson
6c8075d8a0 r11462@Kushana: nickm | 2006-12-07 13:42:21 -0500
Make bandwidth accounting information get stored to the state file as well as bw_accounting.  Read from the state file if it is more recent than bw_accounting, or if bw_accounting is not there.


svn:r9044
2006-12-07 18:57:37 +00:00
Nick Mathewson
a91c12f2e7 r9855@Kushana: nickm | 2006-12-04 00:55:09 -0500
Merge circuit_about_to_close_connection and connection_about_to_close_connection.


svn:r9021
2006-12-04 05:55:40 +00:00
Roger Dingledine
c5b90daf86 cleanups, bump to 0.1.2.4-alpha
svn:r9015
2006-12-02 22:47:46 +00:00
Nick Mathewson
d1fdabf1c7 r9843@Kushana: nickm | 2006-11-30 17:22:25 -0500
Turn an xxxx0124 into an #ifdef; avoid leaking memory.


svn:r9013
2006-11-30 22:23:01 +00:00
Nick Mathewson
0f6402f17b r9309@totoro: nickm | 2006-11-13 19:05:41 -0500
Whitespace fixes, and clean up code from last natd patch.


svn:r8947
2006-11-14 00:06:45 +00:00
Nick Mathewson
5d7ca19b44 r9465@auth3-479: nickm | 2006-11-01 13:16:21 -0500
Add some temporary code to count  how many *distinct* router digests we verify.  (I have a sneaking suspicion that the numbers look way way high.)


svn:r8890
2006-11-01 18:16:44 +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
3fbb292bff r9389@Kushana: nickm | 2006-10-25 17:46:16 -0400
Add a CLEARDNSCACHE signal to clear the client-side DNS cache.


svn:r8829
2006-10-25 21:46:21 +00:00
Nick Mathewson
5c670a186c r9386@Kushana: nickm | 2006-10-25 17:35:38 -0400
Resolve bug 347: translate v0 controller signal numbers into internal signal numbers; leave v1 signal numbers alone.


svn:r8828
2006-10-25 21:39:42 +00:00
Roger Dingledine
77c8c0ee51 spec and implement some more status events. start to build
some conventions.


svn:r8805
2006-10-23 10:16:43 +00:00
Roger Dingledine
2a1c294717 implement a few status events, so we can make sure they work,
and so vidalia can start handling them if it wants.


svn:r8802
2006-10-23 05:51:46 +00:00
Nick Mathewson
b27cb38dee r9307@Kushana: nickm | 2006-10-20 13:53:54 -0400
Have connection_about_to_close use an end_reason field in edge_connection_t to tell what reason to tell the controller for closing the stream.  Set end_reason in connection_edge_end, connection_mark_unattached_ap, and everwhere we set edge_has_sent_end.  Add a changelog entry.


svn:r8779
2006-10-20 17:54:48 +00:00
Roger Dingledine
584d598e8a move the 'time jump' warning back to a higher threshold.
this still occurs on moria sometimes if it's swapping to death.
so be it.


svn:r8725
2006-10-15 02:32:16 +00:00
Roger Dingledine
86263acf95 Security bugfixes:
When the user sends a NEWNYM signal, clear the client-side DNS
  cache too. Otherwise we continue to act on previous information.


svn:r8679
2006-10-09 21:11:50 +00:00
Roger Dingledine
81dd9720f2 whitespace tweaks
svn:r8677
2006-10-09 20:54:51 +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
Roger Dingledine
538c54e376 try dirport reachability testing five times less often.
it's already so darn thorough per test -- it chews through
like four circuits before giving up.


svn:r8646
2006-10-08 06:33:02 +00:00
Nick Mathewson
1c01797c16 r8932@totoro: nickm | 2006-10-07 20:29:03 -0400
Try to make mingw capable of producing a working tor binary for win98: make all NT-service-related functions get lazy-loaded on demand.  I have no idea if this even compiles.


svn:r8643
2006-10-08 00:33:35 +00:00
Roger Dingledine
1d4bd3990f fetch all the v1 directory stuff way less often. plus, move
around some housecleaning calls so they still occur often.
are some of these redundant or in the wrong order? there are
so many of them, maybe they should be put into a separate
function that has better documentation.


svn:r8607
2006-10-06 09:04:11 +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
95132f836a r8750@totoro: nickm | 2006-09-27 20:52:01 -0400
Fix some warnings on mingw; hopefully this should let us build on mingw without warnings.


svn:r8509
2006-09-28 00:53:02 +00:00
Nick Mathewson
01f9e97d43 Minor fix: add code to eventdns so it can free memory on shutdown. This should help valgrind and dmalloc freak out less.
svn:r8503
2006-09-25 20:38:58 +00:00
Nick Mathewson
52e179b942 Trivial fix to make dmalloc happier: release memory held in static member of escaped().
svn:r8502
2006-09-25 18:46:29 +00:00
Nick Mathewson
7c21dabef1 r8878@Kushana: nickm | 2006-09-21 17:15:47 -0400
Trivial whitespace cleanups.


svn:r8443
2006-09-21 21:48:55 +00:00
Nick Mathewson
e4a9b4de4e r8875@Kushana: nickm | 2006-09-21 16:46:28 -0400
Resolve bug 330: detect ISPs that want to hijack failing DNS requests and basically domain-squat the entire internet.


svn:r8440
2006-09-21 21:48:22 +00:00
Nick Mathewson
65974f82fa r8839@Kushana: nickm | 2006-09-17 16:11:59 -0400
Add some client performance XXXXs; try to move some common case tests higher on their decision trees.


svn:r8410
2006-09-17 20:12:10 +00:00
Roger Dingledine
c22dc94fe6 make my bandwidth exercises actually happen
svn:r8400
2006-09-15 05:53:00 +00:00
Peter Palfrader
9d9e31dcf4 r9752@danube: weasel | 2006-09-14 07:06:49 +0200
Fix some dead code that is on occasion useful


svn:r8389
2006-09-14 05:07:26 +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
Mike Chiussi
6ec9c1092a - made configure check if we are building for win32
- made configure link to required system dll's if building for win32
- added diffs for libevent 1.1b
- forced user to turn off eventdns if win32 is set 
- cleaned up tor_mmap_file()_win32 (not sure if it's stable)
- cleaned up some warnings and typos




svn:r8322
2006-09-06 01:49:55 +00:00
Roger Dingledine
2499d1db7c and make the comment better, while i'm at it
svn:r8273
2006-08-28 19:02:57 +00:00
Roger Dingledine
2a4d5782ef an even better check -- now servers hang up if they can't write
for a while, and clients hang up if they can't read for a while.


svn:r8272
2006-08-28 19:00:17 +00:00
Roger Dingledine
f75ef94f27 fix bug found by Adam J. Richter: directory clients shouldn't
hang up five minutes after they begin. but directory servers
should still hang up after 5 minutes of failing to deliver
any bytes.


svn:r8271
2006-08-28 18:51:36 +00:00
Nick Mathewson
54ca0387a5 r8608@Kushana: nickm | 2006-08-27 16:57:47 -0400
Make it possible to change nameserver options while Tor is running.


svn:r8255
2006-08-28 03:15:55 +00:00
Roger Dingledine
24ad1e06cf i'm guessing nick meant to check the return value of dns_init.
and revise some log severities to match the convention.


svn:r8234
2006-08-27 01:41:08 +00:00
Roger Dingledine
9ebaf01096 clean up logging conventions in do_list_fingerprint()
svn:r8222
2006-08-24 00:54:18 +00:00
Roger Dingledine
41d8d77c8b tor --verify-config now exits with -1(255) or 0 depending on whether
the config options are bad or good.


svn:r8221
2006-08-23 23:45:03 +00:00
Nick Mathewson
0f5bfc1521 r7411@Kushana: nickm | 2006-08-17 19:00:25 -0400
patch suggested by Karsten Loesing: respond to SIGNAL command before we execute the signal, in case the signal shuts us down.


svn:r7072
2006-08-17 23:00:32 +00:00
Roger Dingledine
5647e5c7e6 fix typo, add explanatory comment
svn:r7026
2006-08-11 07:31:16 +00:00
Nick Mathewson
09a895e222 r7324@Kushana: nickm | 2006-08-10 23:23:15 -0700
Add more warnings to the list of those we tolerate. Start using GCC attributes more, for better error checking and better code generation.


svn:r7020
2006-08-11 07:09:17 +00:00
Nick Mathewson
85f381153b r6949@Kushana: nickm | 2006-07-28 10:17:38 -0400
Shave another 8 bytes from connection_t: turn inbuf_reached_eof into a bit, and lower timestamp_lastempty to or_connection_t


svn:r6934
2006-07-28 15:11:20 +00:00
Nick Mathewson
5227395aba r6922@Kushana: nickm | 2006-07-26 16:32:24 -0400
Rename some fields, compress a bitfield, and document some structs and fields


svn:r6919
2006-07-27 05:03:57 +00:00
Nick Mathewson
ec82db6995 r6909@Kushana: nickm | 2006-07-26 13:05:58 -0400
Clean up wide lines from last patch.


svn:r6907
2006-07-26 19:07: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
c9b8458f59 publish a new descriptor after we hup. this is important if our
config has changed such that we'll want to start advertising our
dirport now, etc.


svn:r6819
2006-07-23 11:50:03 +00:00
Roger Dingledine
00aefaab6b think harder about my logic
svn:r6806
2006-07-22 07:19:11 +00:00
Roger Dingledine
2d6a4d283b i lied, that won't work at all. maybe this will.
svn:r6805
2006-07-22 07:15:34 +00:00
Roger Dingledine
444f096d2d more bulletproof reachability testing
svn:r6804
2006-07-22 05:29:31 +00:00
Roger Dingledine
2249180b60 bugfix: if you find yourself reachable, then don't ever make any client
requests (so you stop predicting circuits), then hup, then later your
IP changes, you won't think circuits are working so you won't try to
test reachability, so you won't publish.


svn:r6800
2006-07-21 07:55:35 +00:00
Nick Mathewson
7fcb267e24 Oh. And apparently, msvc6 doesnt think very much of doing u64-and-double arithmetic either.
svn:r6785
2006-07-18 02:24:01 +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
Nick Mathewson
e572d5990c MSVC6 is apparently terrified of unnatural cross-breeding between uint64_t and double, and needs more persuasion than usual to cast one to the other. Issue identified by Frediano Ziglio; patch revised for minimal impact on non-MSVC6 compilers.
svn:r6768
2006-07-17 00:39: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
Roger Dingledine
4e4cc9aa27 lower the number of seconds before we yell about clock jump.
and make the yelling only happen if you're a server.


svn:r6625
2006-06-15 09:03:15 +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
48be472e4f clean up a comment
svn:r6508
2006-05-28 16:07:44 +00:00
Roger Dingledine
27624a3024 stop telling people that "tor -h" will help them in any way.
svn:r6447
2006-05-08 04:28:49 +00:00
Roger Dingledine
3c86402cc2 petty cleanups
svn:r6421
2006-04-25 07:00:04 +00:00
Roger Dingledine
07ff409876 no need to escape the address for our connections -- they are
always IP addresses.


svn:r6389
2006-04-16 22:34:00 +00:00
Peter Palfrader
beb9e0721a Stop assuming every authority is a v1 authority
svn:r6377
2006-04-10 21:29:29 +00:00
Roger Dingledine
12d461a245 make DirFetchPeriod and StatusFetchPeriod truly obsolete.
svn:r6373
2006-04-10 20:16:46 +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
51a3981d10 stop caching the v1 directory so often.
svn:r6226
2006-03-22 06:18:27 +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
Roger Dingledine
a3329036a8 Bugfix: looks like clients since 0.1.1.10-alpha have been
expiring connections whenever 5 minutes pass and they *do*
have circuits on them.


svn:r6213
2006-03-21 21:58:00 +00:00
Roger Dingledine
d1d0813cf3 Allow non-printable characters for exit streams (both for
connecting and for resolving). Now we tolerate applications
that don't follow the RFCs. But continue to block malformed
names at the socks side.


svn:r6193
2006-03-19 03:55:48 +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
Roger Dingledine
499eeced44 when event_add or event_del fail, tell us why.
svn:r6156
2006-03-13 19:33:46 +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
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
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
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
Peter Palfrader
0bab094d5d Explain why we only expire open connections
svn:r6015
2006-02-14 17:30:04 +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
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
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
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
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
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
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
35f91db15f a slightly more useful message when you get a sighup
svn:r5869
2006-01-26 19:11:06 +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
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
8907391ad6 Fix wide lines
svn:r5793
2006-01-11 04:04:42 +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
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
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
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
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
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
Nick Mathewson
d94b9fd7d2 normalize spaces
svn:r5658
2005-12-27 04:52:34 +00:00
Peter Palfrader
4bd65f0f98 Keep bandwidth history accross restarts/crashes
svn:r5637
2005-12-23 23:56:42 +00:00
Nick Mathewson
6b5fc9d46f Instead of "Network down", say "Is your network connection down?"
svn:r5607
2005-12-15 22:10:03 +00:00
Nick Mathewson
ce71b17224 Clean fake_status a bit. Switch from has_fetched_directory to have_minimum_dir_info, and make the latter function smarter.
svn:r5591
2005-12-15 20:44:15 +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
39265dd72e In my private little universe, terminals are still 80 columns. Impose a 160-character-per-line limit; this will creep down.
svn:r5548
2005-12-09 05:37:26 +00:00
Roger Dingledine
8730190914 when we're checking reachability, make it clearer in the logs
what to expect.


svn:r5538
2005-12-08 21:12:47 +00:00
Nick Mathewson
77a494dd55 Expunge remaining places where we used "tree" to mean "associative array".
svn:r5490
2005-12-03 02:21:31 +00:00
Nick Mathewson
a6eb8cd2a0 Move connection_or_remove_from_identity_map() to connection_unlink, but dont remove the other; just make it warn.
svn:r5470
2005-11-30 04:28:41 +00:00
Roger Dingledine
f94f4c1686 when event_add or event_del fail, tell us why.
(nick, do i have my libevent strerror dance moves correct?)


svn:r5462
2005-11-26 09:37:00 +00:00
Nick Mathewson
652e1899ac "How about 'never'? Does 'never' work for you?"
Weasel says circuit_get_by_conn is his main timesink.  Most of its
users were just checking whether OR conns had circuits, so add a
circuit count to OR conns, and check that. One was
circuit_about_to_close_conn, which was doing an O(n^2) series of calls
to get all circs on an OR conn, so make an O(n) function for that.
Finally, circuit_get_by_edge_conn was using it as a sanity test that
has been around for a while but never found any actualy insanity, so
kill that.

circuit_get_by_conn is finally dead, which is good, since it was never
sane to begin with.


svn:r5460
2005-11-26 01:43:57 +00:00
Nick Mathewson
fbf8a8c25f Dump bytes held to store descriptors.
svn:r5443
2005-11-23 06:00:58 +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
6734371234 15*60 is 15 minutes, not 5
svn:r5424
2005-11-18 21:57:49 +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
9b432311c4 Make new logging stuff work on windows; fix a couple of windows typos.
svn:r5375
2005-11-15 03:05:23 +00:00
Roger Dingledine
4ea6d71a26 shorten more of the startup log messages
svn:r5368
2005-11-14 04:39:49 +00:00
Nick Mathewson
a913cb3536 prevent duplicat mark-for-close
svn:r5347
2005-11-04 05:00:12 +00:00
Nick Mathewson
9e82f0cdb7 enable code to remove members of old_routers when it gets big.
svn:r5345
2005-11-01 17:34:17 +00:00
Roger Dingledine
bf2be9abd7 Do round-robin writes of at most 16 kB per write. This might
be more fair on loaded Tor servers, and it might resolve our
Windows crash bug. It might also slow things down.


svn:r5332
2005-10-29 18:19:37 +00:00
Nick Mathewson
5d85560d9e Remove last vestiges of old logging interface.
svn:r5317
2005-10-25 18:01:01 +00:00
Nick Mathewson
e7e170a59e Change more files to new loggin interface. 3 left.
svn:r5310
2005-10-25 08:20:10 +00:00
Roger Dingledine
102df4a982 fix some typos
svn:r5283
2005-10-18 21:39:00 +00:00
Peter Palfrader
7b15f77dd6 Make a few INFO log lines into DEBUG
svn:r5257
2005-10-17 02:13:36 +00:00
Roger Dingledine
ae92a91d96 more log uncluttering
svn:r5254
2005-10-17 01:29:28 +00:00
Roger Dingledine
03dcef4c78 start the process of reducing clutter in server logs
svn:r5253
2005-10-17 00:35:53 +00:00
Roger Dingledine
aca6fb5f5f cut out a warning that doesn't need to warn
svn:r5252
2005-10-16 19:47:01 +00:00
Nick Mathewson
998cf8d622 Try to extract as many descriptors as possible from truncated http responses. (when DIR_PURPOSE_FETCH_ROUTERDESC)
svn:r5249
2005-10-14 02:26:13 +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
a89daaeca9 Once an hour (not just on startup) give OpenSSL some more entropy.
Add entropy in 512-bit chunks, not 160-bit chunks.  (This latter
change is voodoo.)


svn:r5211
2005-10-06 22:22:22 +00:00
Nick Mathewson
5cf758764e Rate-limit warnings related to unrecognized MyFamily elements.
svn:r5204
2005-10-05 23:20:45 +00:00
Roger Dingledine
f12663a4ce call circuit_expire_all_dirty_circs() on do_hup().
there, now we use it.


svn:r5202
2005-10-05 22:36:33 +00:00
Nick Mathewson
370e4abdc9 replace former relaunches of directory downloads with reset of failure count and relaunch of status downloads. Fix memory leak in trusted_dir_server_t. Reset "last download attempted" time when resetting failure counts.
svn:r5195
2005-10-05 05:03:52 +00:00
Roger Dingledine
adf04f121e size_t int printf mucking
svn:r5194
2005-10-05 04:52:55 +00:00
Nick Mathewson
96c47c8478 Note the two places where clients will still try to fetch old-style (v1) directory info. These should be fixed, I think.
svn:r5193
2005-10-05 02:25:59 +00:00
Nick Mathewson
509de69a7e reset warning flags on SIGHUP. arma: is this everything?
svn:r5192
2005-10-05 02:20:46 +00:00
Nick Mathewson
8434595584 Fix verbose compiler warnings, including one in routerlist.c that would have been an actual error. Normalize whitespace. Enforce convention that "address" is a hostname and "addr" is an IPv4 address.
svn:r5190
2005-10-05 02:06:36 +00:00
Nick Mathewson
a608905070 Give a less frequent and more helpful warning on failed serverdesc downloads
svn:r5187
2005-10-05 00:22:56 +00:00
Nick Mathewson
42e17182da When we get an EOF or a timeout on a directory connection, note how many bytes of serverdesc we are dropping. This will help us determine whether it is smart to parse incomplete serverdesc responses.
svn:r5186
2005-10-04 22:34:09 +00:00
Nick Mathewson
c5ee3e961e Reorganize some quick-and-dirty code to find out what openssl stuff is leaking, using dmalloc.
svn:r5178
2005-10-03 20:20:38 +00:00
Nick Mathewson
9e54e2e293 free helper node status info on shutdown
svn:r5177
2005-09-30 21:38:57 +00:00
Nick Mathewson
23864ad423 Try to hunt down a few more leaks
svn:r5172
2005-09-30 21:22:25 +00:00
Nick Mathewson
de198d800b Never call free() on tor_malloc()d memory. This is unlikely to be our current leak, but it may help dmalloc work.
svn:r5168
2005-09-30 20:47:58 +00:00
Nick Mathewson
92451f74a8 Reformat inconsistent function declarations.
svn:r5160
2005-09-30 01:09:52 +00:00
Roger Dingledine
f8d430653e better cleanups as i figure out what's going on
svn:r5154
2005-09-29 23:26:42 +00:00
Nick Mathewson
06625e779d Decouple router downloads from old directory downloads entirely
svn:r5128
2005-09-23 18:49:37 +00:00
Nick Mathewson
c345dab3bd Fix logic error (people who ask authorities should never split; others should always split). Also, fix timing error in main.c so retries really happen.
svn:r5127
2005-09-23 18:17:37 +00:00
Nick Mathewson
f995edd516 Fix at least one overzealous download bug. (tor_malloc_zero new local_routerstatus_t objs); add a pile of logs back in; probe every 10sec; never autolaunch on failure. Let us see if this works better.
svn:r5125
2005-09-23 18:05:14 +00:00
Nick Mathewson
cdc912714e I love the smell of C in the morning. Make router-download rules smarter (download more so long as we dont duplicate existing requests; relaunch at staggered intervals); relaunch one a minute or on failure; reset 60 minutes; always open 3 requests if we can; add authority opinion to networkstatus; make naming rule correct. There is a remaining bug where we retry servers too quickly; We need to look at that harder.
svn:r5110
2005-09-22 06:34:29 +00:00
Nick Mathewson
87f6d526fe Refactor new directory code a bit. Keep a big list of rolled-up router status info, including # of download failures (not yet used). Update this list from networkstatuses when they arrive, then update routers from this list. Only download 128 routers at a time, to avoid gargantuan URLs.
svn:r5089
2005-09-18 02:24:42 +00:00
Nick Mathewson
6d15a73548 Resolve/expand some XXXXs and improve a log message or two
svn:r5082
2005-09-16 16:41:45 +00:00
Nick Mathewson
b70c229f6e make some functions static; clean dead networkstatus entries more often.
svn:r5072
2005-09-15 05:41:30 +00:00
Nick Mathewson
b16048917c Stop downloading directories and download routers instead. This still needs some work, but at last clients are finally on the new architecture. Next comes the tuning and bugfixing.
svn:r5070
2005-09-15 05:19:38 +00:00
Nick Mathewson
d4e0af7822 Fix a bunch of log messages. Deprecate some routerlist fields; remove others, and status_set_at from routerinfo_t. Compress routerlist.c cleanup functions. Update cached networkstatus mtime when we download the same one twice. Change some interfaces.
svn:r5068
2005-09-14 23:42:06 +00:00
Nick Mathewson
e3adcbdb95 Big commit: clients start downloading and using network-statuses.
Only caches need to get running-routers; nobody needs to parse, store,
or use it.  Same for the router-status line in the directories.  Add
many #if 0's that can get removed once I'm convinced they don't
contain anything I'm forgetting.

Start all newly-parsed routers as non-running and non-valid; update
them from the list of network statuses.

Update all routers when a new networkstatus comes in.

After 3 tries for a networkstatus, clients give up until they're told
to try again.

     "Let's get those missles ready to **DESTROY THE UNIVERSE**!"
				-TMBG


svn:r5063
2005-09-14 21:09:25 +00:00
Nick Mathewson
7c6679d8dc Add new config.c function to set options that can fail, and roll back if they do. This should solve the setconf-an-impossible-port bug.
svn:r5046
2005-09-14 02:36:29 +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
Nick Mathewson
f50ddfd4dd Download network-status at regular intervals. The code is probably iffy, and the constants need to be renamed.
svn:r4921
2005-09-08 06:22:44 +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
33b2abbc90 remove redundant logs about unreachable servers
svn:r4905
2005-09-03 04:37:30 +00:00
Nick Mathewson
0e649ac60a Remove descriptor_list and use routerlist instead. Make directories manage routerlist a little better.
svn:r4854
2005-08-26 20:59:04 +00:00
Nick Mathewson
cf90a36dd1 Add quotes around filenames in src/or
svn:r4845
2005-08-26 18:44:26 +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
675f6b5f3c that comma was important
svn:r4820
2005-08-23 01:00:30 +00:00
Roger Dingledine
ab112ca6ad and don't print the null string here either
svn:r4816
2005-08-22 22:59:54 +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
Roger Dingledine
d928411acd change log entry for unreachability to explicitly suggest /etc/hosts
as the culprit


svn:r4807
2005-08-22 05:33:49 +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
Roger Dingledine
04d42ea433 rotate dns and cpu workers if the controller changes options that
will affect them.


svn:r4787
2005-08-15 23:46:18 +00:00
Roger Dingledine
10ff723938 initialize the dns worker cache tree whether or not we start
out as a server.


svn:r4785
2005-08-15 10:27:37 +00:00
Nick Mathewson
299af3d393 Possibly broken implementation of persistant state; handles helper nodes; does not handle accounting info yet.
svn:r4680
2005-07-28 19:01:48 +00:00
Roger Dingledine
a32f936346 whoops, fix compile
svn:r4674
2005-07-25 10:36:01 +00:00
Roger Dingledine
1e0fdcae98 parameterize RephistTrackTime
svn:r4673
2005-07-25 10:29:21 +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
5fe18894b9 now that we're recommending 0.1.1.x-alpha for win32 and os x users,
stop printing debug stuff once a minute


svn:r4596
2005-07-18 19:16:17 +00:00
Roger Dingledine
e8a1b1d6a0 add a trivial tor-counting variable
svn:r4593
2005-07-18 06:09:04 +00:00
Nick Mathewson
441e02d4ac Merge patch from Matt Edman for bug 162 (service never stops)
svn:r4578
2005-07-15 19:09:36 +00:00
Roger Dingledine
306f7d320c make a notice-level log make more sense.
svn:r4547
2005-07-13 21:12:33 +00:00
Nick Mathewson
cf13b3e4a6 Macro-fu to get DEBUG events working.
svn:r4539
2005-07-13 05:14:42 +00:00
Nick Mathewson
e1db33971e NT service patch from Matt Edman to improve error messages, lightly cleaned; needs more testing.
svn:r4527
2005-07-09 16:37:12 +00:00
Roger Dingledine
2f1f0c8d21 be flexible in what you accept: when people type "tor --install" thinking
they had typed "tor -install", make it work too.


svn:r4526
2005-07-09 03:28:58 +00:00
Nick Mathewson
806da0d8b2 Compile on win32
svn:r4496
2005-06-27 23:35:04 +00:00
Nick Mathewson
2aff87caae Load hardware acceleration options when/where available. Can anybody test this?
svn:r4467
2005-06-20 18:56:35 +00:00
Nick Mathewson
5eef9177c5 Appease verbose GCC warnings.
svn:r4466
2005-06-20 09:38:29 +00:00
Roger Dingledine
b5fd75a063 forward-port the --hash-password bug, plus other nearby fixes
svn:r4459
2005-06-19 08:35:46 +00:00
Nick Mathewson
9b4aa8d2ab Implement all the easy bits of the new control protocol
svn:r4449
2005-06-17 20:37:21 +00:00
Nick Mathewson
2b8fd9ceda Allow a few EINVALs from libevent before dying. Warn on kqueue with libevent before 1.1a
svn:r4419
2005-06-13 00:35:19 +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
fcd0fc3364 flesh out the source file descriptions for doxygen
svn:r4404
2005-06-11 05:31:17 +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
Nick Mathewson
a6f51001a5 New whitespace normalization rule: no blank line at EOF.
svn:r4378
2005-06-09 16:46:51 +00:00
Roger Dingledine
eeb6d6dba6 dump periodic memory usage stats
svn:r4348
2005-06-08 17:24:58 +00:00
Roger Dingledine
aff308e6d9 reenable the part of the code that tries to flush as soon as an OR outbuf
has a full tls record available. perhaps this will make OR outbufs not grow
as huge except in rare cases, thus saving lots of cpu time plus memory.


svn:r4343
2005-06-08 04:55:06 +00:00
Roger Dingledine
1a5c5452b4 when you send a USR2 signal, the log message now tells you to send
a HUP signal if you want to change back to old log levels.


svn:r4332
2005-06-07 18:16:14 +00:00
Nick Mathewson
2118e5798a Use correct errno from libevent on win32
svn:r4327
2005-06-07 17:32:33 +00:00
Nick Mathewson
e1c8aa8035 Fix win32 compilation: backport candidate
svn:r4320
2005-06-06 20:06:10 +00:00
Nick Mathewson
fc40f974c2 When RNG seeding fails, die. Backport candidate
svn:r4319
2005-06-06 20:02:33 +00:00
Nick Mathewson
baa10cbbfa Instrument buffers.c and rephist.c memory usage
svn:r4317
2005-06-06 17:03:21 +00:00
Roger Dingledine
4855990d37 clean up a few more log entries
svn:r4304
2005-05-27 17:43:43 +00:00