Commit Graph

3060 Commits

Author SHA1 Message Date
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
Roger Dingledine
94bff33357 and compiling would be good too
svn:r5657
2005-12-27 02:48:35 +00:00
Roger Dingledine
370dcbc7ba and some comments
svn:r5656
2005-12-27 02:48:02 +00:00
Roger Dingledine
5807bd0635 make it clearer in the auto-generated config file that you
probably shouldn't be editing this one yourself.


svn:r5655
2005-12-27 02:46:53 +00:00
Roger Dingledine
b038dc9ecc disambiguate some debug entries
svn:r5654
2005-12-26 22:42:22 +00:00
Roger Dingledine
815df977cf comments? i'll show you comments.
svn:r5652
2005-12-26 05:52:44 +00:00
Roger Dingledine
40c267a89f prevent a rare infinite loop on two-byte architectures,
and be more thorough and starting over when the clock jumps.


svn:r5647
2005-12-25 04:37:33 +00:00
Roger Dingledine
7e0d62b14a stop being sneaky, especially if we're being incorrectly sneaky
svn:r5646
2005-12-24 23:39:20 +00:00
Roger Dingledine
b0144276db more comments, and start to use the made_contact entry.
svn:r5645
2005-12-24 23:32:35 +00:00
Roger Dingledine
7cc53c2281 clean up some comments
svn:r5644
2005-12-24 23:32:15 +00:00
Roger Dingledine
35986a2374 simplify because we weren't using those return values anyway
svn:r5643
2005-12-24 22:48:12 +00:00
Roger Dingledine
3a2ce447b4 start to document the helper node functions
svn:r5642
2005-12-24 20:07:19 +00:00
Peter Palfrader
4bd65f0f98 Keep bandwidth history accross restarts/crashes
svn:r5637
2005-12-23 23:56:42 +00:00
Roger Dingledine
eecb835527 stop shipping tree.h, since we don't use anymore. (woo.)
svn:r5628
2005-12-20 07:17:42 +00:00
Roger Dingledine
bb4662365b when we fail three times to resolve or connect, we were telling the
user it was because we failed to resolve.


svn:r5620
2005-12-19 21:56:43 +00:00
Roger Dingledine
da01657c34 more asserts in case weasel can trigger them
svn:r5616
2005-12-19 00:35:18 +00:00
Roger Dingledine
7cd46d7f95 fix a seg fault when you finish connecting to a server but
at that moment you dump his server descriptor, and you also
happen to be logging at loglevel info.
(found by weasel)


svn:r5615
2005-12-18 22:59:47 +00:00
Roger Dingledine
34249e8861 fix segfault when specifying DirServer without nickname
(reported by weasel)


svn:r5614
2005-12-18 22:45:27 +00:00
Roger Dingledine
a2186b9999 fix a ! that got left out
svn:r5612
2005-12-18 22:34:24 +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
Roger Dingledine
a6afef700a nother typo
svn:r5605
2005-12-15 21:51:12 +00:00
Roger Dingledine
edde3fcf25 ah ha, that variable was static. not useless after all.
svn:r5604
2005-12-15 21:44:23 +00:00
Roger Dingledine
002c9b3589 clean up a lot message, and remove a line that does nothing.
svn:r5603
2005-12-15 21:41:27 +00:00
Nick Mathewson
89eded7b17 Add "panic" option to reject all servers not in fingerprint list.
svn:r5601
2005-12-15 21:39:38 +00:00
Nick Mathewson
cf8c70b79c fix compile
svn:r5600
2005-12-15 21:38:59 +00:00
Nick Mathewson
280c62314e Make clients look at the fast and stable flags in networkstatus, not at the bandwidth and uptime declared in the router descriptors.
svn:r5599
2005-12-15 21:30:57 +00:00
Roger Dingledine
3489066433 put back in a todo comment, so we don't forget.
svn:r5598
2005-12-15 21:26:52 +00:00
Roger Dingledine
dadcb19d17 fix typo
svn:r5597
2005-12-15 21:26:39 +00:00
Nick Mathewson
24e79df0b6 Whitespace fixes; comments.
svn:r5596
2005-12-15 21:17:40 +00:00
Nick Mathewson
713c995adb Do not mark directories as down simply because they dont have the router descs we want.
svn:r5595
2005-12-15 21:15:16 +00:00
Nick Mathewson
5965b3849e Remove some redundant and obsolete code from routerparse
svn:r5594
2005-12-15 20:58:51 +00:00
Nick Mathewson
6b1305aeeb Flip a misplaced not
svn:r5593
2005-12-15 20:56:46 +00:00
Nick Mathewson
3ea32f51cb add a few clarifying comments
svn:r5592
2005-12-15 20:49:01 +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
Roger Dingledine
25e1ad02fa implement weasel's suggestion to fix the bug that newly bootstrapped
tor networks couldn't do hidden services until they had nodes with high
uptime: if you're trying to pick a node for your circuit and you demand
uptime or capacity and nothing works, then abandon your need for uptime
and capacity.


svn:r5589
2005-12-15 09:53:00 +00:00
Nick Mathewson
7af95e5c06 When we mark a router as down, also mark its local_routerstatus as not running. This way, we do not use directories that are believed to be down.
svn:r5587
2005-12-14 22:05:10 +00:00
Nick Mathewson
9482b1b9d5 Choose directory servers from routerstatus list, not from routerinfo list. This way, as soon was we have a networkstatus, we can ask a cache to give us routers, rather than needing to ask the directories.
svn:r5586
2005-12-14 22:00:58 +00:00
Nick Mathewson
c02c6b5823 Shave off 8 bytes per connection and 4 bytes per circuit by paying attention to padding warnings, moving fields around, and acknowledging that we have no files with over 64 kilolines.
svn:r5583
2005-12-14 21:03:51 +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
Nick Mathewson
7e632a7564 another possible patch related to circuit_free and memory stomping.
svn:r5580
2005-12-14 18:55:17 +00:00
Nick Mathewson
4f38670328 Fix a potential memory stomp on servers running hidden services. Found by weasel with valgrind. Backport candidate.
svn:r5579
2005-12-14 02:19:27 +00:00
Roger Dingledine
86d69218ef orconn_identity_map was another static variable that started
out NULL and didn't change until it needed to change.


svn:r5578
2005-12-14 01:02:35 +00:00
Roger Dingledine
c9f6e6b0a0 sometimes, when we just started tor, we haven't created that
smartlist yet. so don't free it.


svn:r5577
2005-12-14 00:52:15 +00:00
Roger Dingledine
d853c9a009 bugfix: when we removed a dead helper node, we never committed that
change to disk.


svn:r5576
2005-12-13 02:52:38 +00:00
Roger Dingledine
ea760fa149 extendcircuit and attachstream would complain about not enough
arguments, but then just keep on going anyway.


svn:r5575
2005-12-12 16:50:55 +00:00
Nick Mathewson
27a201ac80 Have dirctory authorites note which servers make good V2 directory caches in publishe network-status.
svn:r5574
2005-12-12 01:03:28 +00:00
Nick Mathewson
32126cced1 Make directory authorities ignore router uploads that have only cosmetic differences: now regardless of version!
svn:r5573
2005-12-12 01:02:08 +00:00
Roger Dingledine
bf4da967c1 Don't use helper nodes for circuits with purpose 'testing'.
Also, when picking the helper node for a given circuit,
exclude the circuit's exit from your choices.


svn:r5569
2005-12-11 12:14:26 +00:00
Roger Dingledine
a131783c8b when removing dead helpers, only write or_state to disk once at the
end, not for every helper you remove.


svn:r5568
2005-12-11 11:56:17 +00:00
Roger Dingledine
5981169440 mark the helper node as down if we time-out on the circuit handshake
with him.


svn:r5567
2005-12-11 11:55:41 +00:00
Roger Dingledine
dded1dd8bd don't mark the helper node as down when we fail to connect to
our https proxy.


svn:r5566
2005-12-11 11:54:55 +00:00
Roger Dingledine
9c01fa3d59 fix yet another time comparison bug. we were abandoning helpers
as soon as they became unavailable. (is this true?)


svn:r5565
2005-12-11 11:23:36 +00:00
Roger Dingledine
f3349d6ed3 fix an error in reporting why we abandoned a helper node
svn:r5564
2005-12-11 11:20:26 +00:00
Roger Dingledine
b974f67c01 choose helper nodes to have high capacity always
svn:r5563
2005-12-11 11:20:01 +00:00
Roger Dingledine
77c0f6d456 a first go at fixing a bug matt edman reported: when he tries
to "setconf log" via the controller, it is friendly and gives
him a log to stdout, even though he didn't ask for one.


svn:r5562
2005-12-11 10:01:21 +00:00
Roger Dingledine
79f09b2f17 setconf orport=9001
513 Unrecognized option value

it's not unrecognized. it's unacceptable. (in this case, i still
have to consult the logs to figure out why, but at least i have
an inkling that maybe i should.)


svn:r5561
2005-12-11 09:33:38 +00:00
Roger Dingledine
46d563fe00 whenever we hupped or did a controller setconf, we were prepending
another reachableaddresses *:80,*:443 if fascistfirewall was set,
and we were appending another reject *:* regardless.


svn:r5560
2005-12-11 09:18:25 +00:00
Roger Dingledine
a4e1014f4d i think fascistfirewall still has its uses. it's a synonym
for a certain reachableaddresses line, but it's easier to
remember and people already understand it. i think we should
think about undeprecating it.


svn:r5559
2005-12-11 08:59:02 +00:00
Roger Dingledine
defa3804cf explain why 0.1.1.9-alpha-cvs is a special version.
svn:r5552
2005-12-10 21:07:21 +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
Roger Dingledine
9b0a40ec78 crank the max line limit down to 150 chars.
svn:r5550
2005-12-10 08:27:01 +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
Nick Mathewson
95e471c9a6 Normalize whitespace
svn:r5547
2005-12-09 05:22:15 +00:00
Nick Mathewson
33c4445846 For some bizarre reason, MSVC does not implement GCC extensions. Who would have thought?
svn:r5546
2005-12-09 05:20:02 +00:00
Roger Dingledine
a438f2abcd let the user configure a sockslistenaddress on other private IPs
besides 127.x.y.z without complaining.
and give a better message in the log.


svn:r5544
2005-12-09 02:46:46 +00:00
Nick Mathewson
d57029ffe8 Make code to handle "private" alias work when assume_action is set.
svn:r5542
2005-12-08 23:58:23 +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
Roger Dingledine
d3dcea08af remove a redundant memcpy when extending to a new server
and attaching circuits to it.


svn:r5537
2005-12-08 20:33:57 +00:00
Nick Mathewson
338f23114f Oops. 0.0.0.0/8 and 169.254.0.0/16 are also special.
svn:r5536
2005-12-08 19:58:14 +00:00
Nick Mathewson
2d585941b8 Release memory from conn_circid_circuit_map on exit.
svn:r5535
2005-12-08 19:46:22 +00:00
Nick Mathewson
1b770817c0 Add private:* as an alias in configuration for policies.
svn:r5534
2005-12-08 19:40:24 +00:00
Nick Mathewson
898968b3ac Warn when binding to a public address for socks. This warning needs to be improved. Also, make options_validate() only warn when an option is changed to a bad value.. (Previously, it warned when an option was bad and any option was changed.)
svn:r5532
2005-12-08 18:56:32 +00:00
Nick Mathewson
e9b66ec906 Document CREATE_FAST better in the code. Move our key expansion algorithm into a separate function in crypto.c
svn:r5530
2005-12-08 17:38:32 +00:00
Nick Mathewson
617f71e4ba Whitespace normalization
svn:r5528
2005-12-08 04:03:12 +00:00
Nick Mathewson
f031ee8246 Make clients use CREATE_FAST cells. add an option to disable this.
svn:r5524
2005-12-07 22:09:02 +00:00
Roger Dingledine
4902ece698 what the heck is wrong with this little piece of code?
why can none of us get it right?
it looks so simple.


svn:r5521
2005-12-07 04:43:39 +00:00
Roger Dingledine
b0ffa34219 tell the controller about new .onion streams too.
svn:r5520
2005-12-06 23:43:52 +00:00
Roger Dingledine
5c0338dca3 the other half of weasel's patch, so old gcc's can build cvs again.
svn:r5517
2005-12-06 21:03:48 +00:00
Peter Palfrader
0dbb622f26 Old gccs want you to do your variable declarations first
svn:r5516
2005-12-06 17:01:36 +00:00
Roger Dingledine
3347762fa4 when we're giving up on a circuit and retrying on a new one,
log the name of the exit node. perhaps people will find this
useful, or see patterns, or something.


svn:r5515
2005-12-06 07:21:17 +00:00
Nick Mathewson
b1d034d2ab Fix bug 212: Directory authorities should not try to download server descriptors that they know they will reject.
svn:r5514
2005-12-06 06:55:43 +00:00
Nick Mathewson
d2123388ad Better fix for last bug: avoids trying to double-mark circuits.
svn:r5511
2005-12-05 19:45:54 +00:00
Nick Mathewson
fedc9c8a60 We were neglecting to unlink marked circuits from soon-to-close OR connections.
svn:r5510
2005-12-05 19:26:09 +00:00
Nick Mathewson
b03e8733f3 Change how OR conns get removed from the identity map; fix some warnings on shutdown.
svn:r5509
2005-12-05 19:15:27 +00:00
Nick Mathewson
f0abb1a74b Check magic when removing old connection from map.
svn:r5508
2005-12-05 19:01:34 +00:00
Nick Mathewson
835f06a77c Set chosen_exit_name to something we are not about to zero.
svn:r5507
2005-12-05 06:16:24 +00:00
Nick Mathewson
98290e4115 When parsing foo.exit, if foo is unknown, and we are leaving circuits unattached, set the chosen_exit field and leave the address empty
svn:r5504
2005-12-05 04:38:21 +00:00
Roger Dingledine
26b49dbc09 Bugfix for trackhostexits: write down the fingerprint of the chosen exit,
not its nickname, because the chosen exit might not be verified.


svn:r5499
2005-12-05 00:15:42 +00:00
Roger Dingledine
40cbe550f3 fix a log message to be mildly more helpful
svn:r5498
2005-12-04 23:06:48 +00:00
Roger Dingledine
bb8dc691eb Fix another time comparison bug in circuit_stream_is_being_handled().
Nick, can you confirm this one?
This is also a backport candidate.


svn:r5497
2005-12-04 22:23:24 +00:00
Roger Dingledine
ef000fd82e ok, i know this one was a bug. we were expiring open general
circuits after they had been around for 30 seconds.


svn:r5496
2005-12-04 22:19:04 +00:00
Roger Dingledine
7d032bd300 take back half of my bugfix. comparing times sucks.
but leave the other half.


svn:r5495
2005-12-04 21:59:15 +00:00
Roger Dingledine
d60f514f4c fix the first bug with our optimization to circuit_expire_building():
we were killing off rendezvous circuits unless they magically time-warped
to be too old before we got around to killing them, in which case we
would leave them alone. this made it hard to rendezvous with hidden
services.


svn:r5494
2005-12-04 21:51:50 +00:00
Nick Mathewson
1b0134dda8 Clean up some comments; remove some dead code
svn:r5493
2005-12-03 16:32:29 +00:00
Nick Mathewson
61c5a9ae2b Use a switch statement and some mild refactoring to try to speed up circuit_expire_building
svn:r5492
2005-12-03 05:29:05 +00:00
Nick Mathewson
979fc3e69d cvs diff -u src/or/circuitlist.c | less almost never does what you want in C.
svn:r5491
2005-12-03 03:36:32 +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
148a1e969d Shave off another 4.7%: remove a linear search when figuring out which circuits wanted us to open a given OR connection.
svn:r5489
2005-12-03 02:12:37 +00:00
Nick Mathewson
502cb59611 Remove "tree" references from dns.
svn:r5488
2005-12-03 02:01:18 +00:00
Nick Mathewson
6443e5ec7f Add a benchmark-aes function to test.c. Off by default.
svn:r5485
2005-12-01 04:35:58 +00:00
Nick Mathewson
fea19528a1 assert_buf_ok was showing up in the profile; remove it from critical-path functions, since it hasnt triggered for ages.
svn:r5479
2005-11-30 22:48:58 +00:00
Nick Mathewson
d56a65c497 Fix some verbose warnings and remove an unneeded include.
svn:r5472
2005-11-30 06:38:41 +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
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
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
Nick Mathewson
447a3a7ff2 Funny. I could have sworn that it compiled.
svn:r5467
2005-11-29 17:17:02 +00:00
Nick Mathewson
94e8dcef44 Fix a bug weasel found: when we are an authority and somebody requests "all" statuses, cconsider regenerating our own.
svn:r5466
2005-11-29 17:14:10 +00:00
Nick Mathewson
c90d6c7e5f Make arguments to circuit_set_circid_orconn match the connection that is closing in circuit_about_to_close_connection. This accounts for our mysterious "arbitrary ram gets decremented!" bug.
svn:r5465
2005-11-29 17:13:34 +00:00
Nick Mathewson
7de0c33857 Avoid a segfault in routerlist_reset_warnings()
svn:r5464
2005-11-28 16:29:27 +00:00
Roger Dingledine
1da454a42d when returning a list of circuits, don't return a list of the same
conn over and over. that's really bad for memory.


svn:r5463
2005-11-28 02:52:17 +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
Roger Dingledine
97f748f680 clean up broken comment
svn:r5461
2005-11-26 09:27:36 +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
31d5d96739 Cut down a common call to circuit_get_by_conn by about half.
svn:r5459
2005-11-26 00:53:51 +00:00
Roger Dingledine
fe221f3dff Start the process of treating internal circuits and exit circuits
separately. It's important to keep them separate because internal
circuits have their last hops picked like middle hops, rather than like
exit hops. So exiting on them will break the user's expectations.

- Stop cannibalizing internal circuits for general exits, and stop
  cannibalizing exit circuits for rendezvous stuff.

- Don't let new exit streams attach to internal circuits.

- When deciding if we have enough circuits for internal and for exit,
  don't count the wrong ones.

- Treat predicted resolves as predicted port 80 exits.


svn:r5457
2005-11-25 08:08:56 +00:00
Roger Dingledine
6452aecedb when calling connection_get_by_identity_digest, don't do a memcmp
for non-OR conns. this should save a bit of time.


svn:r5456
2005-11-25 06:43:53 +00:00
Roger Dingledine
2350e487a2 minor cleanup
svn:r5454
2005-11-24 06:44:13 +00:00
Roger Dingledine
ea7fe0c267 Fix a bug found by Lasse Overlier: when we were making internal circuits
(intended to be cannibalized later for rendezvous and introduction
circuits), we were picking them so that they had useful exit nodes. There
was no need for this, and it actually aids some statistical attacks.


svn:r5453
2005-11-24 06:43:39 +00:00
Roger Dingledine
5b583073a1 remove some more dead code (found while hunting lasse's bug)
svn:r5452
2005-11-24 06:06:50 +00:00
Roger Dingledine
23efc30776 get rid of some unused variables
svn:r5451
2005-11-24 01:47:05 +00:00
Roger Dingledine
0118a236a4 comment that scary-looking function.
svn:r5447
2005-11-23 07:30:44 +00:00
Nick Mathewson
eb0021b06e Fix dumb logic error that kept some old descripttors from getting the axe.
svn:r5446
2005-11-23 07:28:54 +00:00
Nick Mathewson
061ef582a1 Make dropping very old descriptors faster (remove old correctness check). Track bytes dropped that are still in our store or journal, and rebuild when it gets very high.
svn:r5445
2005-11-23 07:24:59 +00:00
Nick Mathewson
36109fea33 e more aggressive about calling routerlist_remove_old_routers()
svn:r5444
2005-11-23 07:06:36 +00:00
Nick Mathewson
fbf8a8c25f Dump bytes held to store descriptors.
svn:r5443
2005-11-23 06:00:58 +00:00
Nick Mathewson
7d7bb95f36 Track how many bytes we have in signed descriptors. Try to make sure we are tracking this right. Somebody should valgrind a dirserver on an example net. There should be code to dump this value.
svn:r5442
2005-11-23 05:47:51 +00:00
Nick Mathewson
a39269572f Replace balanced trees with hash tables: this should make stuff significantly faster.
svn:r5441
2005-11-23 04:18:45 +00:00
Nick Mathewson
50ce5e1932 Avoid spurious re-launch of first pending requested descriptor
svn:r5439
2005-11-22 02:20:05 +00:00
Peter Palfrader
a48b722432 Ancient gcc does not like you when you declare variables in the middle of a block
svn:r5437
2005-11-20 16:53:49 +00:00
Peter Palfrader
b9d37a2d58 Add a new controller event type that allows controllers to get all
server descriptors that were uploaded to a router in its role as authoritative
dirserver.


svn:r5436
2005-11-19 18:35:43 +00:00
Roger Dingledine
f28770b639 be less eager to decide that the entire network is down
svn:r5434
2005-11-19 11:04:00 +00:00
Roger Dingledine
859d1c902a and another instance where i was trying to be too sneaky
svn:r5433
2005-11-19 10:38:23 +00:00
Roger Dingledine
98f353fa7c actually listen when we try to route our dir connection via tor.
svn:r5432
2005-11-19 10:33:34 +00:00
Roger Dingledine
5c949fce51 Start obeying our firewall options more rigorously:
- If we can't get to a dirserver directly, try going via Tor.
  - Don't ever try to connect (as a client) to a place our firewall
    options forbid.
  - If we specify a proxy and also firewall options, obey the firewall
    options even when we're using the proxy: some proxies can only proxy
    to certain destinations.


svn:r5431
2005-11-19 10:12:10 +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
Roger Dingledine
700c370a3b misc cleanups
svn:r5428
2005-11-19 01:56:58 +00:00
Roger Dingledine
f824fb5f83 Bugfix: it looks like some middleman circuits were spending the
first few moments of their existence in CIRCUIT_STATE_OPEN, then
when Alice sent an extend request for a Tor that they're not connected
to, they switched to CIRCUIT_STATE_OR_WAIT and spent the rest of
their sorry little lives in that state, even when the connection
was established and they were shuttling relay cells back and forth.

And I'm not going to backport this (yet), because somehow it worked!


svn:r5427
2005-11-19 01:55:58 +00:00
Roger Dingledine
0de8f4ee55 another case (i think) of redundant code.
svn:r5426
2005-11-19 01:03:34 +00:00
Roger Dingledine
409294153f remove some redundant (and misleading) code
svn:r5425
2005-11-19 00:44:24 +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
Roger Dingledine
4ddf2385a0 if it's not less than three does that mean it's more than two?
svn:r5422
2005-11-18 11:35:23 +00:00
Roger Dingledine
9d6d6da883 and code the part where redirectstream can take a port.
svn:r5421
2005-11-18 11:32:59 +00:00
Roger Dingledine
afb1c79879 Leave options->DirServers alone -- if the user didn't specify any,
just add the default ones directly to the trusted dirserver list.
This fixes a bug where people running controllers would setconf or
the equivalent, and Tor would start yelling at them about setting
their own DirServer lines.


svn:r5418
2005-11-18 02:47:09 +00:00
Roger Dingledine
26d8c3498c and another overly common log entry
svn:r5417
2005-11-18 00:35:29 +00:00
Roger Dingledine
aa53190ed5 and another one
svn:r5416
2005-11-17 22:23:18 +00:00
Roger Dingledine
9111a3fb48 comment out some really popular log lines
svn:r5415
2005-11-17 22:19:35 +00:00
Roger Dingledine
d2b93df26c and now we actually do it, too.
svn:r5414
2005-11-17 22:01:46 +00:00
Roger Dingledine
7dbf2511c3 when you type 'getinfo' with no arguments, it doesn't give you
any answer at all. this is clearly a bug.

the more interesting bug is whether things like setconf, getconf,
and so on should return 250 OK if you give them no arguments. should
we have a new "you didn't ask me anything" response code, or just
leave it as is?


svn:r5412
2005-11-17 21:45:38 +00:00
Roger Dingledine
af86345b74 we used to kill the circuit when we receive a relay command we
don't recognize. now we just drop it. perhaps this will make us
more forward-compatible? or perhaps it will bite us? one day we
will find out.


svn:r5405
2005-11-17 03:40:20 +00:00
Roger Dingledine
298da4497a help the term "OP" become obsolete
svn:r5403
2005-11-17 01:17:53 +00:00