Commit Graph

6283 Commits

Author SHA1 Message Date
Nick Mathewson
f9133f2528 Fix a memory leak of one address string per DNSPort request.
svn:r17681
2008-12-18 15:00:27 +00:00
Nick Mathewson
148e4e8837 Do not leak the DNS server port structure.
svn:r17680
2008-12-18 15:00:18 +00:00
Nick Mathewson
4911ec627b Call release_lockfile() before exiting.
svn:r17679
2008-12-18 15:00:13 +00:00
Nick Mathewson
290b6f54a3 Make unit tests slower but more reliable by disabling an old optimization.
To turn it back on, re-define CACHE_GENERATED_KEYS option in test.c.

svn:r17677
2008-12-18 06:12:19 +00:00
Nick Mathewson
8ba2a15a49 Fix more leaks in unit tests.
svn:r17676
2008-12-18 06:02:23 +00:00
Nick Mathewson
1b735e46dd Make it possible to call set_onion_key twice without leaking RAM.
svn:r17673
2008-12-18 05:40:57 +00:00
Nick Mathewson
cebdf93949 Fix bug 889: share deep-copied keys between threads to avoid races in reference counts. Bugfix on 0.1.0.1-rc.
svn:r17672
2008-12-18 05:28:27 +00:00
Roger Dingledine
7b5be147ee fix a minor memory leak if we start up as a relay but don't
have any files in the cached-status/ directory


svn:r17671
2008-12-18 05:15:11 +00:00
Nick Mathewson
d597b23c42 Massage a little code to hopfully please coverity.
svn:r17669
2008-12-18 04:45:51 +00:00
Nick Mathewson
f3f6daf819 Avoid nop call to control_event_or_authdir_new_descriptor that makes coverity think we are dereferencing a null pointer. It is safe, I think, but entirely too clever for our own good.
svn:r17668
2008-12-18 04:45:47 +00:00
Nick Mathewson
676175103d Fix a valgrind-located memory stomp. Bugfix on 0.2.1.6-alpha.
svn:r17667
2008-12-18 04:27:23 +00:00
Nick Mathewson
5c235cb5ec Fix memory leak in rend_cache_store_v2_desc_as_client(), and refactor the function to use the "goto err" idiom.
svn:r17665
2008-12-18 00:11:49 +00:00
Nick Mathewson
1510d50fab Oops: SeverDNS->ServerDNS.
svn:r17664
2008-12-17 23:20:07 +00:00
Nick Mathewson
7d92053286 Remove RedirectExit feature; it has been deprecated since 0.2.0.3-alpha
svn:r17663
2008-12-17 23:02:04 +00:00
Nick Mathewson
6693f32530 Resolve many DOCDOCs.
svn:r17662
2008-12-17 22:58:20 +00:00
Nick Mathewson
2ad36f68c8 Rename ServerDNSAllowBrokenResolvConf to ServerDNSAllowBrokenConfig.
(Many users have no idea what a resolv.conf is, and shouldn't be forced to learn.  The old option will keep working for now.)
Also, document it.

svn:r17661
2008-12-17 22:58:14 +00:00
Roger Dingledine
03f413f5c7 declare that we're putting out 0.2.1.9-alpha next week
svn:r17659
2008-12-17 22:46:00 +00:00
Roger Dingledine
048f2a179b Clip the MaxCircuitDirtiness config option to a minimum of 10
seconds. Warn the user if lower values are given in the
configuration. Bugfix on 0.1.0.1-rc. Patch by Sebastian.
Clip the CircuitBuildTimeout to a minimum of 30 seconds. Warn the
user if lower values are given in the configuration. Bugfix on
0.1.1.17-rc. Patch by Sebastian.


svn:r17657
2008-12-17 22:32:17 +00:00
Nick Mathewson
33e2053ebc Make return code from router_add_to_routerlist a nice sensible enum. Based on patch from Sebastian.
svn:r17656
2008-12-17 21:50:01 +00:00
Nick Mathewson
2de9bd7bae Rename a couple of v2-networkstatus-only fields so that it is clear they are v2-networkstatus-only.
svn:r17652
2008-12-17 17:20:48 +00:00
Nick Mathewson
f43bcdc063 Use ctags and a python script to find identifiers that are never used anywhere, and remove the ones that we really want gone.
svn:r17651
2008-12-17 17:20:42 +00:00
Nick Mathewson
fc5e686b19 Whitespace fix.
svn:r17650
2008-12-17 17:20:36 +00:00
Nick Mathewson
1beb1c113b Add some missing documentation in or.h
svn:r17649
2008-12-17 17:20:31 +00:00
Nick Mathewson
0dc724d19c Make ALLOW_INVALID_* into an enum.
svn:r17648
2008-12-17 17:20:26 +00:00
Nick Mathewson
d0e1cc6fe2 Remove the no-longer-used incoming_cmd_type field from control_connection_t.
svn:r17647
2008-12-17 17:20:22 +00:00
Nick Mathewson
68a6935afb Change CELL_DIRECTION_* to an enum.
svn:r17646
2008-12-17 17:20:19 +00:00
Nick Mathewson
44e19a4949 Oops; remove extraneous comma.
svn:r17644
2008-12-17 15:04:43 +00:00
Nick Mathewson
7678ac5193 Move edge-only flags from connection_t to edge_connection_t.
svn:r17643
2008-12-17 14:59:28 +00:00
Nick Mathewson
26632d59dd Rename or_is_obsolete and move it to or_connection_t where it belongs.
svn:r17642
2008-12-17 14:59:19 +00:00
Nick Mathewson
e53ffaa4e4 Don't extend circuits over noncanonical connections with mismatched addresses.
Also, refactor the logic to check whether we will use a connection or
launch a new one into a new function.

svn:r17628
2008-12-15 21:17:53 +00:00
Nick Mathewson
51c29e1e24 Apply rovv's bug 805 fix: take more care never to prefer a non-canonical connection.
svn:r17627
2008-12-15 21:17:43 +00:00
Roger Dingledine
5822e14dc9 When a stream at an exit relay is in state "resolving" or
"connecting" and it receives an "end" relay cell, the exit relay
would silently ignore the end cell and not close the stream. If
the client never closes the circuit, then the exit relay never
closes the TCP connection. Bug introduced in Tor 0.1.2.1-alpha;
reported by "wood".


svn:r17625
2008-12-14 19:40:56 +00:00
Roger Dingledine
2ad06eef11 comment tweak
svn:r17624
2008-12-14 19:39:54 +00:00
Nick Mathewson
a4a481d81c Implement proposal 148: Make client stream end reasons uniform.
This patch makes every RELAY_COMMAND_END cell that we send pass through one of two functions: connection_edge_end and relay_send_end_cell_from_edge.  Both of these functions check the circuit purpose, and change the reason to MISC if the circuit purpose means that it's for client use.

svn:r17612
2008-12-12 20:30:42 +00:00
Nick Mathewson
5fb2ab1e65 Implement the /tor/keys/fp-sk/ URL format. That mostly finishes the server side of 157.
svn:r17611
2008-12-12 19:05:36 +00:00
Nick Mathewson
69ce955484 Add cross-certification to authority key certificates. Partial implementation of proposal 157.
svn:r17610
2008-12-12 18:31:39 +00:00
Nick Mathewson
519de7970e Do not discard sign on return values of iv crypto functions in tests. May fix CID 9. Might not.
svn:r17603
2008-12-11 21:11:31 +00:00
Nick Mathewson
7e351a6341 Note that a couple of line in control.c are supposed to be dead-code.
I'm hoping not to have to litter the rest of our codebase with Coverity ignores, but I think these are the only one we need right now.

svn:r17602
2008-12-11 21:11:28 +00:00
Nick Mathewson
02e26ebc49 If we are building under Coverity, enable geoip_stats and instrument_downloads.
This makes sure that a) optional code gets analyzed too, and b) it doesn't
look like dead code to Coverity.

svn:r17601
2008-12-11 21:11:26 +00:00
Nick Mathewson
b20694758e Fix two more unit-test bugs (deadcode this time) spotted by Coverity run 7.
CIDs == 357, 356.

svn:r17599
2008-12-11 21:11:19 +00:00
Nick Mathewson
04ec7d1f98 Now that tor_assert is no longer using a broken force-to-boolean formulation, we can tor_assert a bitfield without a gcc compile error.
svn:r17598
2008-12-11 20:28:50 +00:00
Nick Mathewson
d9aa57253d Fix error in last unit test mem-leak-fixing.
svn:r17596
2008-12-11 19:41:03 +00:00
Nick Mathewson
bb02f919f1 Refactor find_first_by_keyword into one variant that can return NULL and one that can't.
This makes it easier for us to avoid errors where we we forgot to list a keyword as mandatory, and easier for Coverity to detect cases like this too.

svn:r17595
2008-12-11 19:40:58 +00:00
Nick Mathewson
f3b52e331e Avoid multiple descriptor-fetch connections to authorities. Fixes bug 366.
svn:r17594
2008-12-11 19:12:55 +00:00
Nick Mathewson
043b4fc59e Add a PDS_ flag to exclude authorities from which we are fetching descs.
Yes, this is maybe a little overspecific.  Part of a bug 366 fix.

svn:r17593
2008-12-11 19:12:48 +00:00
Nick Mathewson
29f5a65a16 Change directory_get_from_dirserver to take a set of flags to be passed to pick_(trusted_)dirserver. This lets us make its interface smarter, and makes code that calls it a little more readable.
svn:r17592
2008-12-11 19:12:45 +00:00
Nick Mathewson
4e69284e89 Fix wide line in main.c
svn:r17587
2008-12-11 17:23:00 +00:00
Nick Mathewson
240ee1866b Add experimental support for learning svn revision number in git-svn based repositories. Fancy.
svn:r17581
2008-12-11 06:52:24 +00:00
Nick Mathewson
d7563ee231 Fix memory leaks in test_util_smartlist_* functions.
svn:r17580
2008-12-11 06:18:09 +00:00
Nick Mathewson
595e77c8d7 Fix memory leaks in test_v3_networkstatus.
svn:r17579
2008-12-11 06:18:01 +00:00
Nick Mathewson
6ffb4d4ab6 Fix memory leaks in test_dir_format
svn:r17578
2008-12-11 06:17:59 +00:00
Nick Mathewson
d8027aa689 Fix a logic error that would automatically reject all but the first configured DNS server. Bugfix on 0.2.1.5-alpha. Possible fix for part of 813/868. Spotted by coderman
svn:r17569
2008-12-10 22:57:41 +00:00
Nick Mathewson
53d3f812bd Add new internal-use-only option for controllers to use to prevent SIGHUP from reloading the configuration. Fixes bug 856.
svn:r17567
2008-12-10 22:17:02 +00:00
Nick Mathewson
9aa706e20c Bug 691 fix: do not shutdown Tor servers right away if the network is down.
svn:r17566
2008-12-10 20:45:31 +00:00
Nick Mathewson
426b53d85a Apply patch from Karsten to fix bug 879. Backport candidate.
svn:r17562
2008-12-10 18:16:58 +00:00
Nick Mathewson
7aa7d1a3e7 Give a better error when something has changed our descriptor cache out from under us. Based on patch from Karsten. Addresses bug 885.
svn:r17550
2008-12-10 03:01:26 +00:00
Roger Dingledine
d7bf7e0b32 When a directory authority gives us a new guess for our IP address,
log which authority we used. Hopefully this will help us debug
the recent complaints about bad IP address guesses.


svn:r17549
2008-12-10 01:46:51 +00:00
Roger Dingledine
4053b47459 note a potential bug in status events. need to look at spec to
see if it's really a bug.


svn:r17548
2008-12-10 01:35:21 +00:00
Roger Dingledine
145e589b6c Resume using the correct "REASON=" stream when telling the
controller why we closed a stream. Bugfix in 0.2.1.1-alpha.


svn:r17547
2008-12-10 01:34:24 +00:00
Nick Mathewson
ab75c0d9e3 remove a bogus comment. Now that there is no undocumented synonym for EXTENDED_EVENTS, we do not need to point out that EXTENDED_EVENTS is documented
svn:r17542
2008-12-09 23:10:38 +00:00
Nick Mathewson
a7b4a7b9f8 Finally remove deprecated-since-0.1.2.4-alpha EXTENDED_FORMAT synonym for EXTENDED_EVENTS
svn:r17538
2008-12-09 19:55:19 +00:00
Nick Mathewson
0280a72500 Add a new status event for consensus arrival
svn:r17535
2008-12-09 18:16:41 +00:00
Nick Mathewson
b32bac88e8 Mark DirPortFrontPage as a FILENAME rather than a STRING. Right now this has no effect.
svn:r17520
2008-12-08 18:00:34 +00:00
Roger Dingledine
b1c8fb7058 this function is no longer used.
svn:r17515
2008-12-08 00:09:28 +00:00
Roger Dingledine
e5be0504ab When the client is choosing entry guards, now it selects at most
one guard from a given relay family. Otherwise we could end up with
all of our entry points into the network run by the same operator. 
Suggested by Camilo Viecco. Fix on 0.1.1.11-alpha.

Not a backport candidate, since I think this might break for users
who only have a given /16 in their reachableaddresses, or something
like that.


svn:r17514
2008-12-08 00:04:29 +00:00
Roger Dingledine
f31c16d993 Directory mirrors no longer fetch the v1 directory or
running-routers files. They are obsolete, and nobody asks for them
anymore. This is the first step to making v1 authorities obsolete.


svn:r17513
2008-12-07 23:53:39 +00:00
Jacob Appelbaum
48aca3c999 Small whitespace fix to properly format if () {} statement.
svn:r17503
2008-12-07 01:51:56 +00:00
Jacob Appelbaum
f70146ca91 This helps return a better error message when the file supplied to DirPortFrontPage is missing.
svn:r17502
2008-12-07 01:48:30 +00:00
Roger Dingledine
21892d8a9c cleanups on r17500
svn:r17501
2008-12-07 01:34:45 +00:00
Jacob Appelbaum
6b178b46ef New DirPortFrontPage option that takes an html file and publishes it as "/" on the DirPort. Now relay operators can provide a disclaimer without needin to set up a separate webserver. There's a sample disclaimer in contrib/tor-exit-notice.html.
svn:r17500
2008-12-07 01:21:19 +00:00
Jacob Appelbaum
cf75162a0c Add comment clarifying OpenSSL usage.
svn:r17498
2008-12-07 01:14:49 +00:00
Nick Mathewson
af03faa1a6 Fix more leaks in test_util_memarea().
svn:r17491
2008-12-05 02:25:39 +00:00
Nick Mathewson
475fbbbccc Fix a resource leak in test_dir_formats()
svn:r17488
2008-12-05 02:05:39 +00:00
Nick Mathewson
1affbd3464 Split test_util_smartlist into manageable chunks; make them free memory properly.
svn:r17487
2008-12-05 01:58:35 +00:00
Nick Mathewson
30377823c3 Add a few more tests to our tests so that our tests make sense to coverity. CIDs 139, 138, 137.
svn:r17486
2008-12-05 01:49:15 +00:00
Nick Mathewson
e06442b648 Add a couple of sanity-checks for return values that coverity thinks we ought to have. CIDs 337, 335.
svn:r17485
2008-12-05 01:35:49 +00:00
Nick Mathewson
a26188cee9 fix bug 880: find the end of an authority cert by looking for the first ----END SIGNATURE----- after the first dir-key-certification, not for the first ----END SIGNATURE. Harmless bug, but it made us non-spec-compliant.
svn:r17470
2008-12-03 03:42:19 +00:00
Nick Mathewson
bd6b3072f9 Change logging code to use fds instead of stdio. Fixes bug 861, and probably makes logging slightly faster. Not a backport candidate: bug 861 is too obscure and harmless.
svn:r17456
2008-12-02 23:36:58 +00:00
Nick Mathewson
9c65195449 Apply rovv's patch for bug 864: avoid null error on detached signature handling failure.
svn:r17446
2008-12-02 19:13:23 +00:00
Roger Dingledine
2d8f7a4ff6 clarify that 'resolve' relay cells nul-terminate the hostname, just
like 'begin' relay cells.


svn:r17442
2008-12-02 17:35:05 +00:00
Roger Dingledine
984dc51f26 clean up some log messages
svn:r17406
2008-11-29 11:55:30 +00:00
Roger Dingledine
a53ebd20f0 whitespace fix
svn:r17379
2008-11-24 02:02:48 +00:00
Nick Mathewson
c7910c3bc9 Consider GetNetworkParams() nameserver parsing to have suceeded if even one nameserver can be added. Log more useful info about what exactly is failing when we fail to add a nameserver.
svn:r17368
2008-11-22 21:46:34 +00:00
Roger Dingledine
0b7a2a505e prepare_for_poll() -- plus its mysterious cousin, prepare_for_pool() --
are long gone.


svn:r17351
2008-11-21 14:07:57 +00:00
Nick Mathewson
0fa698d84f apply sebastian's bug 867 fix: make routerset_equal() work as documented with NULL arguments
svn:r17287
2008-11-16 18:25:20 +00:00
Karsten Loesing
6d7951c022 Fix a possible segfault when establishing an exit connection. Bugfix on 0.2.1.5-alpha.
svn:r17275
2008-11-16 01:52:44 +00:00
Nick Mathewson
c36ddcbabf Apparently sparc64 is way more strict about uint16_t access alignment than I had thought: it gave bus errors when messing with var-cell headers. Maybe this patch will fix bug 862.
svn:r17262
2008-11-12 14:41:44 +00:00
Nick Mathewson
8f1952bf11 Be even _more_ careful when signatures are bogus.
svn:r17252
2008-11-11 17:14:12 +00:00
Nick Mathewson
3970c34f10 Only replace the detached signatures object when we actually added or replaced at least one signature.
svn:r17250
2008-11-11 16:52:07 +00:00
Nick Mathewson
997aea74dc Fix from rovv: when adding a detached signature, do not automatically assume it is good just because we are adding it. We might also be adding it because it was the first signature we saw for a given voter.
svn:r17248
2008-11-11 16:35:46 +00:00
Nick Mathewson
00a90177fa oops, remove debugging log message.
svn:r17247
2008-11-11 16:02:23 +00:00
Nick Mathewson
8157b8b766 be less aggressive about deleting expired certs. based on patch from rovv. partial fix for bug 854.
svn:r17246
2008-11-11 16:01:57 +00:00
Nick Mathewson
e08cbe2029 Add PURPOSE= field to getinfo circuit-status. With luck, controllers are ignoring extra fields (like they are supposed to) and this will not break any controllers.
svn:r17245
2008-11-11 15:59:24 +00:00
Nick Mathewson
6c50ab6e61 Document a couple of functions.
svn:r17239
2008-11-10 20:40:01 +00:00
Roger Dingledine
c62d5f6a5c beg nick for some documentation on the locking functions
svn:r17233
2008-11-10 00:48:13 +00:00
Roger Dingledine
4d8799b987 we missed a case when printing circuit purposes in circ events.
svn:r17230
2008-11-09 23:56:29 +00:00
Nick Mathewson
9f1e06bd0e but to not attempt to download a specific certificate we already have.
svn:r17214
2008-11-07 15:01:49 +00:00
Nick Mathewson
bda4ca065c Aaaaand, do not reset the download count just because we have a certificate that is listed in a consensus.
svn:r17212
2008-11-07 14:57:14 +00:00
Nick Mathewson
aa405f29e6 fix up signs in r17208
svn:r17211
2008-11-07 14:17:46 +00:00
Nick Mathewson
5e2cdc1666 When we get a duplicated certificate, treat it as a failure and increment the download count. Do not claim to be downloading certificates that we merely want.
svn:r17209
2008-11-07 14:01:44 +00:00
Nick Mathewson
a15bdd3edd patch from karsten to not use or accept expired certs. fixes bug 851.
svn:r17208
2008-11-07 13:38:49 +00:00
Roger Dingledine
bc128c0b03 vidalia asks us for the value of the Group config option. but now
it's obsolete. which causes us to inform the user every time, even
though the user can't do anything about it other than get confused.

now it's an info-level log by default.


svn:r17206
2008-11-07 04:38:58 +00:00
Roger Dingledine
14773f42a7 now that we drop privs more thoroughly, switch_id() is no longer
idempotent. so now we remember if we've succeeded, and if so we
don't even try.


svn:r17204
2008-11-07 04:34:47 +00:00
Roger Dingledine
d27337bf17 i needed a piece of the 'patching patches' action too
svn:r17202
2008-11-07 03:39:19 +00:00
Steven Murdoch
9d68ed08e9 Patch from Jacob Appelbaum and me to make User option more robust, properly set supplementary groups, deprecated the Group option, and log more information on credential switching
svn:r17200
2008-11-07 02:06:12 +00:00
Nick Mathewson
6e3de8530e Remove bug 811/845 debugging code
svn:r17199
2008-11-07 01:50:37 +00:00
Nick Mathewson
a38026bb06 fix wide lines
svn:r17198
2008-11-07 01:48:55 +00:00
Nick Mathewson
3ebd1ebeca The chunk_size field in memarea_t was never actually set. Remove the whole thing.
svn:r17195
2008-11-05 20:34:22 +00:00
Nick Mathewson
3f858b5b26 Fix a compile error found under pcc. It wants single-quites to be escaped in strings, it seems.
svn:r17191
2008-11-05 18:03:14 +00:00
Karsten Loesing
b31e2c2491 (a - b) / 2 != a - (b / 2); this is the reason why tunneled directory requests and client-side introduction circuits don't time out after the intended 30 seconds (task #847). Bugfix on r17106. Found by miner.
svn:r17189
2008-11-05 10:40:29 +00:00
Nick Mathewson
73c6cb8353 Fix unit test failure related to intro point parsing.
svn:r17188
2008-11-03 16:36:15 +00:00
Nick Mathewson
7b45d530b0 Add some debugging logs for bug 811/845.
svn:r17186
2008-11-03 15:46:05 +00:00
Roger Dingledine
ebe4ef12b9 when building preemptive circuits, ignore streams that have a
chosen exit node in mind already. otherwise we get tricked into
trying to build a new circuit that will handle them.


svn:r17184
2008-11-03 07:00:56 +00:00
Roger Dingledine
3e5a584d37 fix the other half of r17091. now that best_support can be -1,
we were complaining about no support for our one-hop streams,
when in fact choose_good_exit_server_general() has no business
caring about one-hop streams. patch from miner.


svn:r17181
2008-11-01 23:49:14 +00:00
Nick Mathewson
c534b96e58 Fix an assertion failure on double-marked circuits, and a double-mark.
svn:r17179
2008-11-01 20:27:41 +00:00
Nick Mathewson
0c9dfffe5a Implement the 0x20-hack to make DNS poisoning harder against us, especially when resolving large names. Add a cfg option to disable it, since apparently 3/10 of a percent of servers get it wrong.
svn:r17171
2008-10-29 19:20:02 +00:00
Nick Mathewson
c8a5e2d588 Work better with tools that resist DNS poisoning by using the 0x20 hack: make DNSPort replies perserve case.
svn:r17170
2008-10-29 15:31:26 +00:00
Nick Mathewson
accb4a680f make layer_hint check a little stricter.
svn:r17164
2008-10-27 16:57:18 +00:00
Nick Mathewson
ee31e0829e Verify cpath_layer match on rendezvous cells too. Fixes another case of bug 446. Based on patch from rovv.
svn:r17162
2008-10-27 16:46:45 +00:00
Karsten Loesing
c53f1f83e7 gabelmoo has a new IP address.
svn:r17160
2008-10-27 15:04:45 +00:00
Nick Mathewson
b166a43cb6 Fix another case of refusing to use a chosen exit node because we think it will reject _mostly_ everything. Based on patch from rovv. See bug 752.
svn:r17139
2008-10-21 17:09:04 +00:00
Nick Mathewson
5e762e6a5c Fix the rest of bug 619: reject *:* servers should not do DNS lookups, even if broken clients send them RELAY_BEGIN cells. Patch from rovv.
svn:r17138
2008-10-21 16:51:59 +00:00
Nick Mathewson
b593fd5c20 Patch from rovv: send back END cell in response to connect attempts to nonexistent hidden service port.
svn:r17137
2008-10-21 16:41:20 +00:00
Roger Dingledine
bca46cc628 backport candidate:
The "ClientDNSRejectInternalAddresses" config option wasn't being
consistently obeyed: if an exit relay refuses a stream because its
exit policy doesn't allow it, we would remember what IP address
the relay said the destination address resolves to, even if it's
an internal IP address. Bugfix on 0.2.0.7-alpha; patch by rovv.


svn:r17135
2008-10-17 22:08:49 +00:00
Roger Dingledine
e3127e874e fix grammar in a log message
svn:r17131
2008-10-16 17:13:28 +00:00
Roger Dingledine
bbf0f5a266 explain patch4 better. whee.
svn:r17111
2008-10-15 21:12:51 +00:00
Roger Dingledine
a5769eefa4 patch4 from proposal 155:
Hidden services start out building five intro circuits rather
than three, and when the first three finish they publish a service
descriptor using those. Now we publish our service descriptor much
faster after restart.


svn:r17110
2008-10-15 20:59:48 +00:00
Roger Dingledine
d06182f0bd add patch2 from proposal 155:
Launch a second client-side introduction circuit in parallel
after a delay of 15 seconds (based on work by Christian Wilms).


svn:r17108
2008-10-15 18:52:06 +00:00
Roger Dingledine
4520500cde put in karsten's patch #1 for proposal 155, modified
svn:r17106
2008-10-15 00:36:09 +00:00
Nick Mathewson
846e40d193 Patch from rovv: when we have no pending streams, choose exits with choose_good_exit_server_general() rather than with circuit_get_unhandled_ports() and friends. Bugfix on 0.1.1.x, at least.
svn:r17091
2008-10-14 17:05:52 +00:00
Roger Dingledine
d7cfa1f56c Minor fix in the warning messages when you're having problems
bootstrapping; also, be more forgiving of bootstrap problems when
we're still making incremental progress on a given bootstrap phase.


svn:r17066
2008-10-13 03:34:29 +00:00
Roger Dingledine
c9bddb24b2 another coverity-found memory leak
svn:r17062
2008-10-12 03:21:05 +00:00
Roger Dingledine
95aace5aae minor memory leak found by coverity
svn:r17061
2008-10-12 03:19:17 +00:00
Roger Dingledine
bb1f488dbe fix typo in log entry
svn:r17050
2008-10-08 10:47:23 +00:00
Roger Dingledine
e7f5a07ff4 Make rend_cache_store() use the same return error codes as its v2
equivalent: I got a lonely "Failed to fetch rendezvous descriptor."
in my log file, even when the connection worked.


svn:r17028
2008-10-02 07:32:13 +00:00
Roger Dingledine
c7af43a624 Now NodeFamily and MyFamily config options allow spaces in
identity fingerprints, so it's easier to paste them in.
Suggested by Lucky Green.


svn:r17021
2008-10-01 03:41:33 +00:00
Nick Mathewson
ccede03cc0 Switch a should-benee-dless check for an assert.
svn:r17018
2008-09-30 13:59:12 +00:00
Roger Dingledine
f2708dd40f a few more tweaks
svn:r17010
2008-09-30 09:32:26 +00:00
Roger Dingledine
49a250b208 i *think* this is equivalent. somebody should check me on it though.
svn:r17009
2008-09-30 08:45:40 +00:00
Roger Dingledine
7247838a25 v3 authorities write down all the votes they used for the consensus
to the datadir, for debugging.


svn:r17008
2008-09-29 23:13:43 +00:00
Nick Mathewson
25f8335528 Include circuit purposes in circuit events. Now all circuit events are extended; this makes the code simpler.
svn:r17007
2008-09-29 22:34:22 +00:00
Nick Mathewson
9d950f7d25 Nobody calls circuit_launch_by_nickname; remove it.
svn:r17006
2008-09-29 20:44:29 +00:00
Roger Dingledine
26aa741169 Remove the old v2 directory authority 'lefkada' from the default
list. It has been gone for many months.


svn:r17005
2008-09-29 19:27:20 +00:00
Nick Mathewson
ae3ce7b387 Patch from mwenge: update TrackHostExits mapping expiry times when the mappings are used, so that they expire a while after their last use, not a while after their creation.
svn:r17004
2008-09-29 14:53:53 +00:00
Nick Mathewson
57db1c1a7d Tweak the dbg-stability.txt code to log everything else that influences router stability calculations.
svn:r17003
2008-09-29 14:40:34 +00:00
Roger Dingledine
9678f166a8 If we have correct permissions on $datadir, we complain to stdout
and fail to start. But dangerous permissions on
$datadir/cached-status/ would cause us to open a log and complain
there. Now complain to stdout and fail to start in both cases. Fixes
bug 820, reported by seeess.


svn:r16998
2008-09-29 10:09:05 +00:00
Roger Dingledine
c846979ab7 Fix a bug where an unreachable relay would establish enough
reachability testing circuits to do a bandwidth test -- if
we already have a connection to the middle hop of the testing
circuit, then it could establish the last hop by using the existing
connection. Bugfix on 0.1.2.2-alpha, exposed when we made testing
circuits no longer use entry guards in 0.2.1.3-alpha.


svn:r16997
2008-09-29 09:36:42 +00:00
Nick Mathewson
99755f374d Fix 0/0 calculation in get_weighted_fractional_uptime().
svn:r16994
2008-09-28 15:48:36 +00:00
Nick Mathewson
bb1685318c Commit fix for bug 807 from mwenge: send CLOSED controller event for reverse dns resolve, not FAILED.
svn:r16985
2008-09-26 20:25:35 +00:00
Nick Mathewson
745e5b0e22 Make sure ExcludeSingleHopRelays works for an exit.
svn:r16984
2008-09-26 19:09:12 +00:00
Nick Mathewson
e147e867be Proposal 152 implementation from Josh Albrecht, with tweaks.
svn:r16983
2008-09-26 18:58:45 +00:00
Nick Mathewson
87eb230c01 Put the start-of-downtime value in the start-of-downtime buffer so that we do not put junk in the dbg-stability.txt file
svn:r16982
2008-09-26 18:31:22 +00:00
Nick Mathewson
e7e12236ac Code to serve a current stability calculations from /tor/dbg-stability.txt. Untested: somebody please run this on an authority and let me know if it is broken.
svn:r16981
2008-09-26 18:02:48 +00:00
Nick Mathewson
283b95e463 Make tests pass again by adding an opt hidden-service-dir to the example routerinfo output.
svn:r16980
2008-09-26 17:58:35 +00:00
Nick Mathewson
ae33d3ead7 Apply rovv's fix for bug 824.
svn:r16975
2008-09-26 15:30:26 +00:00
Nick Mathewson
02c71a7eb4 Widen the conditions under which we whine about not having a geoip file to include "a country code was configured in a node list."
svn:r16968
2008-09-25 21:06:32 +00:00
Nick Mathewson
e06f140f97 Whitespace fixes.
svn:r16967
2008-09-25 20:22:17 +00:00
Nick Mathewson
8bbbbaf87b Add country-code support to configured node lists to implement the ever-popular "no exits in Monaco" feature (ExcludeExitNodes {MC}). Also allow country codes and IP ranges in ExitNodes. (EntryNodes needs more work.) Based on code by Robert Hogan. Needs more testing.
svn:r16966
2008-09-25 20:21:35 +00:00
Nick Mathewson
b2c7090da6 Make it easier for dmalloc to see if keys are leaking; remove a test-only key leak.
svn:r16965
2008-09-25 17:37:00 +00:00
Nick Mathewson
06f96363fd Remove now-needless _tor_dmalloc_free helper.
svn:r16964
2008-09-25 17:36:09 +00:00
Nick Mathewson
a7e383af19 More test memory-management fixes
svn:r16963
2008-09-25 15:20:38 +00:00
Karsten Loesing
f2ff3e74ae All relays now store and serve v2 hidden service descriptors by default (not only directory mirrors).
svn:r16961
2008-09-24 22:33:47 +00:00
Karsten Loesing
9a7098487b If we are not using BEGIN_DIR cells, don't attempt to contact hidden service directories with non-open dir port.
svn:r16960
2008-09-24 22:29:22 +00:00
Nick Mathewson
7f805aca2b Split test_crypto() into manageable pieces.
svn:r16959
2008-09-24 20:55:38 +00:00
Karsten Loesing
5f457e4fa6 Minor correction of commentation.
svn:r16958
2008-09-24 17:33:07 +00:00
Nick Mathewson
8bc1536a9e Add patch 4 from Karsten for proposal 121, slightly modified. Karsten should definitely re-review the bits I changed.
svn:r16955
2008-09-24 14:44:29 +00:00
Nick Mathewson
75977fd79b Patch from roger for 752, but with more comments: When we get an A.B.exit:P address, and B would reject most connections to P, but we do not know whether it would allow A, then allow the connection to procede. Bugfix, amusingly, on 0.0.9rc5.
svn:r16944
2008-09-23 20:25:01 +00:00
Nick Mathewson
545b317e1f Fix for bug 797 (by arma, with tweaks): always use create_fast for circuits where we do not know an onion key.
svn:r16942
2008-09-23 20:13:23 +00:00
Nick Mathewson
f28fc83ea5 More logging for mtbf/wfu calculations.
svn:r16941
2008-09-23 18:24:20 +00:00
Karsten Loesing
e4942e809e Exclude v0 rendezvous descriptors when considering republication.
svn:r16939
2008-09-23 09:30:57 +00:00
Roger Dingledine
6a7abbd25d ok, but inaccurate error strings worse
svn:r16938
2008-09-23 08:57:30 +00:00
Roger Dingledine
0fc0d5266c identical error strings in different contexts bad
svn:r16937
2008-09-23 08:54:03 +00:00
Nick Mathewson
b0c48d8e45 Oops; we need to make sure that DNS request names are matched in the _questions_ section of the replies. Rejecting answers whether the _answers_ section did not match made us reject A records waiting at the end of a CNAME record. Bug 823.
svn:r16933
2008-09-22 20:06:25 +00:00
Roger Dingledine
4fd9880540 give rend_client_desc_here a slightly more accurate name
svn:r16916
2008-09-16 10:26:15 +00:00
Roger Dingledine
38f2272d5d patch from karsten for bug 814. whew.
svn:r16915
2008-09-16 10:17:04 +00:00
Nick Mathewson
3db8c15287 Add a circuit_conforms_to_options() function for use in debugging paths [and inother stuff too]. Untested, and so far unused.
svn:r16914
2008-09-15 22:29:47 +00:00
Roger Dingledine
2bde30efa6 read_to_buf should take an int *error_socket and return it.
svn:r16909
2008-09-14 08:35:41 +00:00
Roger Dingledine
7f2fd34645 stop telling us every time we fetch a consensus. that's not really news.
svn:r16908
2008-09-14 07:17:44 +00:00
Roger Dingledine
dbb481c169 Serve the latest v3 networkstatus consensus via the control
port. Use "getinfo dir/status-vote/current/consensus" to fetch it.


svn:r16907
2008-09-14 04:07:29 +00:00
Roger Dingledine
4045ef72f5 make it explicit that the uncompressed cached dir items are nul-terminated
(they are, but now we should keep them that way)


svn:r16906
2008-09-14 03:36:54 +00:00
Roger Dingledine
2d95accc75 Allow ports 465 and 587 in the default exit policy again. We had
rejected them in 0.1.0.15, because back in 2005 they were commonly
misconfigured and ended up as spam targets. We hear they are better
locked down these days.


svn:r16898
2008-09-13 10:04:42 +00:00
Karsten Loesing
f0a5ef804f Directory mirrors store and serve v2 hidden service descriptors by default.
svn:r16858
2008-09-11 20:06:04 +00:00
Nick Mathewson
b322348e8a Fix more actual test leaks
svn:r16831
2008-09-10 05:34:03 +00:00
Nick Mathewson
45205126fe Fix some apparent leaks in voting. If authorities suddenly start segfaulting, this could be a patch to look harder at.
svn:r16830
2008-09-10 05:33:49 +00:00
Nick Mathewson
aa69d586ea Make buffer unit tests handle resource leaks properly.
svn:r16823
2008-09-10 00:16:32 +00:00
Nick Mathewson
38f56608d9 Make more unit tests handle resource leaks properly.
svn:r16822
2008-09-10 00:11:53 +00:00
Karsten Loesing
52fbfc5d45 Correct indentation.
svn:r16819
2008-09-09 22:19:41 +00:00
Roger Dingledine
659f1651e0 tweak karsten's patch
svn:r16818
2008-09-09 21:09:15 +00:00
Roger Dingledine
2c14705a4d patch from karsten to fix more of bug 767
svn:r16817
2008-09-09 21:08:02 +00:00
Nick Mathewson
f95d7c189b Refactor unit test macros and tor_free_all() logic a bit so as to make it easier to free memory on failing tests, in order to suppress scanner warnings and to make dmalloc() usable with tests.
svn:r16816
2008-09-09 20:43:31 +00:00
Roger Dingledine
fa64d8041f minor cleanups on karsten's patch
svn:r16810
2008-09-09 09:21:21 +00:00
Roger Dingledine
ef7af1d61e karsten's patch for bug 767.
svn:r16808
2008-09-09 08:41:58 +00:00
Roger Dingledine
d37fae2f4e Catch and report a few more bootstrapping failure cases when Tor
fails to establish a TCP connection. Cleanup on 0.2.1.x.


svn:r16803
2008-09-09 06:25:39 +00:00
Nick Mathewson
aacda9cd8e We should not alter an addr_policy_t that has been canonicalized.
svn:r16802
2008-09-09 03:48:01 +00:00
Nick Mathewson
baeb260ad1 Refactor use of connection_new so that we get more verifiable typesafety.
svn:r16785
2008-09-05 22:09:44 +00:00
Nick Mathewson
339f094056 Refactor some code and add some asserts based on scanner results.
svn:r16783
2008-09-05 21:19:53 +00:00
Nick Mathewson
d5b2dab31d Fix a malloc that should have been a tor_malloc
svn:r16780
2008-09-05 20:53:39 +00:00
Nick Mathewson
0b8117a5c0 Fix numerous memory leaks: some were almost impossible to trigger, and some almost inevitable.
svn:r16779
2008-09-05 20:52:15 +00:00
Nick Mathewson
a56a072f29 It is probably some kind of misdeed to say for (i=0;i<2;++i) { A=i?x:y; foo(bar(A)); } rather than foo(bar(x)); foo(bar(y)); . Also, it can confuse tools.
svn:r16777
2008-09-05 20:04:27 +00:00
Nick Mathewson
c33dde4ac1 Fix mingw build with --enable-gcc-warnings set.
svn:r16759
2008-09-04 21:58:09 +00:00
Nick Mathewson
3f2b7078d2 Use warn_too_many_conns() when accept() fails with a resource limit.
svn:r16751
2008-09-04 15:22:55 +00:00
Nick Mathewson
f80ac31d74 Add a lockfile to the Tor data directory to avoid situations where two Tors start with the same datadir, or where a --list-fingerprints races with a server to create keys, or such.
svn:r16722
2008-09-01 20:06:26 +00:00
Roger Dingledine
cfff21e78a backport candidate:
If not enough of our entry guards are available so we add a new
one, we might use the new one even if it overlapped with the
current circuit's exit relay (or its family). Anonymity bugfix
pointed out by rovv.


svn:r16698
2008-08-31 06:33:39 +00:00
Nick Mathewson
32549ad95e Double oops: revert accidentally committed local geoipc.c debugging hack.
svn:r16687
2008-08-29 17:02:26 +00:00
Nick Mathewson
730f1b6d3f Oops. Make warn_too_many_conns() actually work.
svn:r16686
2008-08-29 17:01:15 +00:00
Nick Mathewson
6bf1dec945 Oops; set address families on nameservers.
svn:r16674
2008-08-27 14:12:10 +00:00
Nick Mathewson
2625eb204f Fix a memory leak when freeing routerstatuses with exit policy summaries. Patch from mwenge.
svn:r16659
2008-08-25 23:19:58 +00:00
Roger Dingledine
c5fef3c57f commit jake's patch to include strings with socks5 error numbers
svn:r16657
2008-08-25 21:02:22 +00:00
Roger Dingledine
8a9b6204ca get rid of some magic constants i found while walking
jake through socks4 and socks5 failure codes


svn:r16651
2008-08-25 07:06:55 +00:00
Nick Mathewson
239cbe99ba Oops. Linux has no sa_len field.
svn:r16627
2008-08-22 18:00:26 +00:00
Nick Mathewson
0800b332a0 r17847@tombo: nickm | 2008-08-22 12:08:56 -0400
ipv6: make server-side dns cache remember for each address an ipv6 addr and an ipv4 addr.  This fix is just the struct side.


svn:r16622
2008-08-22 16:24:47 +00:00
Nick Mathewson
fc52d85b7c r17846@tombo: nickm | 2008-08-22 11:54:00 -0400
Make dns resolver code more robust: handle nameservers with IPv6 addresses, make sure names in replies match requested names, make sure origin address of reply matches the address we asked.


svn:r16621
2008-08-22 16:24:43 +00:00
Roger Dingledine
8f5642edbc Relays now reject risky extend cells: if the extend cell includes
a digest of all zeroes, or asks to extend back to the relay that
sent the extend cell, tear down the circuit. Ideas suggested
by rovv.


svn:r16605
2008-08-20 05:21:43 +00:00
Roger Dingledine
cc8b2247bf make r16598 compile on 64-bit too
svn:r16604
2008-08-20 05:15:08 +00:00
Karsten Loesing
a8035b5fc3 Update doxygen documentation.
svn:r16599
2008-08-19 19:01:41 +00:00
Nick Mathewson
24f1d29be1 Apply proposal 121 patch 3, with minor tweaks and a few comments.
svn:r16598
2008-08-19 15:41:28 +00:00
Peter Palfrader
87a5962abb All the controller things want their stuff in v2 format. Well then, maybe that's already sufficient
svn:r16578
2008-08-17 08:26:02 +00:00
Peter Palfrader
d3be2cb7fb And tell us more in another error case
svn:r16577
2008-08-17 08:14:57 +00:00
Peter Palfrader
ab9078fca0 Change a warning/bug message
svn:r16576
2008-08-17 08:11:21 +00:00
Peter Palfrader
3c0b0ccca9 Two consensus fixes: always reset has_* to 0, and use a buffer of proper length for exitsummaries.
svn:r16575
2008-08-17 08:01:23 +00:00
Peter Palfrader
4eecd27b42 Make trunk build again under -DEXPORTMALLINFO
svn:r16559
2008-08-15 14:03:37 +00:00
Nick Mathewson
fcf817f897 Switch global_identifier on connections to a 64-bit field and move it to connection_t. When procession onionskins, look up the connection by this field rather than by addr:port. This will keep us from dropping onionskins. How many dropped circuits are dropped because of this bug?
svn:r16558
2008-08-15 13:55:01 +00:00
Peter Palfrader
521f8c791f spaceman
svn:r16555
2008-08-14 23:09:48 +00:00
Peter Palfrader
8cc3d6e22d Add exitpolicy summaries to the consensus
svn:r16554
2008-08-14 23:01:31 +00:00
Peter Palfrader
e27b448c57 Do not split stored exit policy summary into type(accept/reject) and portlist. At least not just yet
svn:r16553
2008-08-14 23:01:21 +00:00
Peter Palfrader
41730a893c Rename a field so weasel likes it better
svn:r16552
2008-08-14 23:01:09 +00:00
Peter Palfrader
ceae7ed960 Add bw to consensus
svn:r16551
2008-08-14 23:00:57 +00:00
Peter Palfrader
82f8050ac4 Parse policies and weight (bw) into routerstatuses
svn:r16550
2008-08-14 23:00:44 +00:00
Peter Palfrader
e8de3ff54d If we are lucky the whitespace nazis will not have noticed these things yet
svn:r16549
2008-08-14 18:01:20 +00:00
Peter Palfrader
fdba26f213 minor comment/doxygen fix
svn:r16548
2008-08-14 18:01:09 +00:00
Peter Palfrader
7c4106135a Give bw in kb/sec in votes/consensus
svn:r16544
2008-08-14 12:37:59 +00:00
Peter Palfrader
ff32708d0e Having a reject-all policy summarized with a lack of summary is stupid. Explicitly mention them as reject 1-65535.
svn:r16543
2008-08-14 12:37:50 +00:00
Peter Palfrader
2f91a3528a testsuite: Now that we add (pretty useless, but still) routerinfos to the routerlist for every one of our routerstatuses in the votes we pass again. yay
svn:r16542
2008-08-14 12:37:42 +00:00
Peter Palfrader
6317cc2956 Only fetch the routerinfo_t in routerstatus_format_entry() if we are going to need it
svn:r16541
2008-08-14 12:37:34 +00:00
Peter Palfrader
a6ade97f67 Properly move forward char pointer after appending stuff to the string
svn:r16540
2008-08-14 12:37:28 +00:00
Peter Palfrader
056157984b Disable test suite for today
svn:r16539
2008-08-14 12:37:21 +00:00
Peter Palfrader
b246c4de9b asserting(s) is better than segfaulting if it turns out to be NULL later
svn:r16538
2008-08-14 12:37:14 +00:00
Peter Palfrader
1a2c6b41e3 Do not show policy and bw in v2 statuses
svn:r16537
2008-08-14 12:37:07 +00:00
Peter Palfrader
24da63ea7b Add exit policy and bw to dirvotes - unfortunately also to v2 statuses
svn:r16536
2008-08-14 12:37:00 +00:00
Peter Palfrader
91f654f2ff This bunch of functions really should be static
svn:r16535
2008-08-14 11:24:03 +00:00
Peter Palfrader
171a7d4b0f Fix an overflow when counting rejects for *, truncate exit summaries after 1000 chars
svn:r16530
2008-08-13 19:25:18 +00:00
Peter Palfrader
adcea0f332 Think of the poor children in Antarctica who still have to work on 4" screens
svn:r16528
2008-08-13 12:46:13 +00:00
Peter Palfrader
0d807068a3 A few testcases for policy summaries
svn:r16527
2008-08-13 12:46:06 +00:00
Peter Palfrader
c4e8fe11db Also special case "accept 1-65535" case, do not leak in non-exit case
svn:r16526
2008-08-13 12:46:00 +00:00
Peter Palfrader
8ef2fe4b37 Return NULL for policies that do not allow any exits
svn:r16525
2008-08-13 12:45:53 +00:00
Peter Palfrader
4a74b9a7df Fix condition statement for accept items, fix two asserts
svn:r16524
2008-08-13 12:45:44 +00:00
Peter Palfrader
34e083dde1 Make sure we don't run off the end of the list
svn:r16523
2008-08-13 12:45:34 +00:00
Peter Palfrader
b2344a9e4d Move policy_summarize() prototype to or.h
svn:r16522
2008-08-13 12:45:28 +00:00
Peter Palfrader
49a616e0fa Create string representation of exit summaries
svn:r16521
2008-08-13 12:45:23 +00:00
Peter Palfrader
7eaf5bd848 Nickm says I'm going to hell, but if I write that in a comment he might just save my soul
svn:r16520
2008-08-13 12:45:15 +00:00
Peter Palfrader
1adc12546e implement policy_summary_accept and policy_summary_reject together with a set of helpers
svn:r16519
2008-08-13 12:45:09 +00:00
Peter Palfrader
f5adde1a17 Start with exit policy summaries
svn:r16518
2008-08-13 12:45:01 +00:00
Nick Mathewson
97245376d9 Next patch from Karsten: client-side configuration stuff for proposal 121.
svn:r16510
2008-08-12 16:12:26 +00:00
Nick Mathewson
30422b5df1 Rate-limit "too-many-sockets" messages; they can get needlessly verbose.
svn:r16480
2008-08-09 15:35:37 +00:00
Nick Mathewson
60a0ae198d Patch cleanups from karsten
svn:r16479
2008-08-09 15:13:28 +00:00
Nick Mathewson
7994f49d43 Fix bug in my changes to karsten's patch
svn:r16477
2008-08-08 16:45:22 +00:00
Nick Mathewson
a8ddac96d8 handle ipv6 in socks5 requests.
svn:r16476
2008-08-08 16:41:59 +00:00
Nick Mathewson
22259a0877 The first of Karsten's proposal 121 patches: configure and maintain client authorization data. Tweaked a bit: see comments on or-dev.
svn:r16475
2008-08-08 14:36:11 +00:00
Nick Mathewson
f6879caa04 Try once again to make BSD compilation happy.
svn:r16474
2008-08-08 12:58:17 +00:00
Nick Mathewson
39f88641c1 r17692@tombo: nickm | 2008-08-07 22:41:26 -0400
Fix more compile errors on BSD pf stuff. How about now?


svn:r16472
2008-08-08 02:41:34 +00:00
Nick Mathewson
5ab6fe0051 r17680@tombo: nickm | 2008-08-07 16:06:30 -0400
Add a missing safe_str for a debug_log_message.  Fix the bad part of bug 674.


svn:r16462
2008-08-07 20:06:40 +00:00
Nick Mathewson
b81d70addb Oops. On recent linux kernels we were not detecting the linux/netfilter_ipv4.h header properly, since we needed to have in_addr and in6_addr and __u32 defined before trying to include it. Fix that.
svn:r16460
2008-08-07 19:39:52 +00:00
Nick Mathewson
48848537bc r17667@tombo: nickm | 2008-08-07 15:13:30 -0400
Make the TransPort input code handle IPv6 addresses, I hope.  This code may not compile.  Possibly fix bug 796.


svn:r16459
2008-08-07 19:13:39 +00:00
Nick Mathewson
d9601c65e0 r17666@tombo: nickm | 2008-08-07 15:12:30 -0400
Make tor_addr_from_sockaddr also give away the port in a useful format


svn:r16458
2008-08-07 19:13:35 +00:00
Nick Mathewson
635f3c8aee r17664@tombo: nickm | 2008-08-06 12:32:09 -0400
Patch from Christopher Davis: open /dev/pf before dropping privileges.  Fixes bug 782.  Backport candidate.


svn:r16450
2008-08-06 16:32:17 +00:00
Nick Mathewson
9855c1d06f r17645@31-33-44: nickm | 2008-08-05 16:28:01 -0400
Make unspecified addresses also cause connection_is_rate_limited to say 0.


svn:r16437
2008-08-05 20:28:03 +00:00
Nick Mathewson
960a0f0a99 r17641@31-33-44: nickm | 2008-08-05 16:07:53 -0400
Initial conversion of uint32_t addr to tor_addr_t addr in connection_t and related types.  Most of the Tor wire formats using these new types are in, but the code to generate and use it is not.  This is a big patch.  Let me know what it breaks for you.


svn:r16435
2008-08-05 20:08:19 +00:00
Peter Palfrader
0cfb68454e Document that we break ties in favor of smaller SD digest if there are still ties after comparing the published timestamp
svn:r16432
2008-08-05 18:54:23 +00:00
Roger Dingledine
d01813a8dd Take out the TestVia config option, since it was a workaround for
a bug that was fixed in Tor 0.1.1.21.


svn:r16409
2008-08-05 00:12:05 +00:00
Roger Dingledine
d5bb361977 minor fixes
svn:r16407
2008-08-04 23:59:38 +00:00
Karsten Loesing
d166b9dc45 Make check-spaces happy.
svn:r16406
2008-08-04 23:39:07 +00:00
Roger Dingledine
2a417700b4 don't log-warn on a bootstrapping status event if the recommendation
is to ignore.


svn:r16405
2008-08-04 23:38:32 +00:00
Karsten Loesing
1fe07f66f4 In some edge cases it occurs that the router descriptor of a previously picked introduction point becomes obsolete. In that case, don't stick to using that introduction point, but simply give up on it. Reverts some part of r15825.
svn:r16404
2008-08-04 23:35:12 +00:00
Karsten Loesing
ff9c3c006f Remove dead code that was left from marking HiddenService(Exclude)Nodes obsolete in task 754.
svn:r16401
2008-08-04 22:42:27 +00:00
Karsten Loesing
3c9cd463d2 Fix a false assertion when extending a circuit to a relay to which a connection is already established. In that case the circuit should not need to memorize extend info for that relay. circuitbuild.c:389 contains a similar assertion.
svn:r16375
2008-08-03 17:45:24 +00:00
Karsten Loesing
ee44eadf4c Fix a bug when generating router descriptors: The address part of exit policies was uninitialized.
svn:r16372
2008-08-03 12:43:18 +00:00
Roger Dingledine
fd4a30d198 bump to 0.2.1.3-alpha
svn:r16369
2008-08-03 05:35:42 +00:00
Roger Dingledine
bf066be654 note a feature (bugfix) we should do one day
svn:r16368
2008-08-03 05:35:18 +00:00
Nick Mathewson
1a76cd179a When a struct ends with char a[1], the size of all earlier members of the struct is _not_ sizeof(st)-1; compilers add alignment. Problem spotted by rovv. Backport candidate.
svn:r16302
2008-07-31 12:18:14 +00:00
Nick Mathewson
186097906d r17436@tombo: nickm | 2008-07-30 09:03:19 -0400
Move n_addr, n_port, and n_conn_id_digest fields of circuit_t into a separately allocated extend_info_t.  Saves 22 bytes per connected circuit_t on 32-bit platforms, and makes me more comfortable with using tor_addr_t in place of uint32_t n_addr.


svn:r16257
2008-07-30 13:04:32 +00:00
Nick Mathewson
507b01357a r17426@tombo: nickm | 2008-07-28 20:34:03 -0400
More test coverage for tor_addr_t; fix a couple of bugs.


svn:r16234
2008-07-29 00:34:50 +00:00
Nick Mathewson
056d97da0c r17391@pc-10-8-1-079: nickm | 2008-07-25 17:11:17 +0200
Tor_addr_compare did a semantic comparison, such that ::1.2.3.4 and 1.2.3.4 were "equal".  we sometimes need an exact comparison.  Add a feature to do that.


svn:r16210
2008-07-25 15:11:21 +00:00
Nick Mathewson
016adc9a08 r17359@pc-10-8-1-079: nickm | 2008-07-25 16:42:48 +0200
whitespace fixes


svn:r16209
2008-07-25 14:47:19 +00:00
Nick Mathewson
9da0482007 r17358@pc-10-8-1-079: nickm | 2008-07-25 16:41:03 +0200
Split out the address manipulation functions from compat and util: they were about 21% of the total of those, and spread out too much.


svn:r16208
2008-07-25 14:43:24 +00:00
Nick Mathewson
3ce6e2fba2 r17346@aud-055: nickm | 2008-07-24 15:37:19 +0200
Make generic address manipulation functions work better.  Switch address policy code to use tor_addr_t, so it can handle IPv6.  That is a good place to start.


svn:r16178
2008-07-24 13:44:04 +00:00
Nick Mathewson
ed781e6971 r17338@aud-055: nickm | 2008-07-24 11:21:06 +0200
Refactor the router_choose_random_node interface: any function with 10 parameters, most of which are boolean and one of which is unused, should get refactored like this.


svn:r16167
2008-07-24 09:22:34 +00:00
Nick Mathewson
dff1ef7d06 r17337@aud-055: nickm | 2008-07-24 10:17:43 +0200
Refactor the is_vote field of networkstatus_t to add a third possibility ("opinion") in addition to vote and opinion.  First part of implementing proposal 147.


svn:r16166
2008-07-24 09:22:27 +00:00
Nick Mathewson
ea95ce25b6 r17323@aud-055: nickm | 2008-07-23 17:58:25 +0200
Implement most of proposal 110.


svn:r16156
2008-07-23 15:58:38 +00:00
Nick Mathewson
2748afe609 r17322@aud-055: nickm | 2008-07-23 16:50:50 +0200
Make circid_t and streamid_t get used instead of uint16_t; it is possible we will soon want to make circid_t change to uint32_t.


svn:r16155
2008-07-23 15:58:30 +00:00
Nick Mathewson
15b2b8bd69 r17309@aud-055: nickm | 2008-07-23 16:05:43 +0200
Patch from Christian Wilms: remove (HiddenService|Rend)(Exclude)?Nodes options.  They never worked properly, and nobody seems to be using them.  Resolves bug 754.


svn:r16144
2008-07-23 14:07:32 +00:00
Nick Mathewson
cc46b23248 r17308@aud-055: nickm | 2008-07-23 15:57:41 +0200
In connection_edge_destroy, send a stream status control event when we have an AP connection.  Previously, we would send an event when the connection was AP and non-AP at the same time.  This didn't work so well.  Patch from Anonymous Remailer (Austria).  Backport candidate.


svn:r16143
2008-07-23 14:07:26 +00:00
Nick Mathewson
087094961b r17302@aud-055: nickm | 2008-07-23 14:55:28 +0200
Never allow a circuit to be created with the same circid as a circuit that has been marked for close.  May be a fix for bug 779.  Needs testing.  Backport candidate.


svn:r16136
2008-07-23 12:55:55 +00:00
Nick Mathewson
26746d7578 r17220@tombo: nickm | 2008-07-18 15:11:27 -0400
Fix bug in last patch: ADDR_POLICY_REJECT is not the same as ADDR_POLICY_REJECTED.


svn:r16065
2008-07-18 19:11:30 +00:00
Nick Mathewson
c8160bce1f r17188@tombo: nickm | 2008-07-18 14:35:18 -0400
Add new ExcludeExitNodes option.  Also add a new routerset type to handle Exclude[Exit]Nodes.  It is optimized for O(1) membership tests, so as to make choosing a random router run in O(N_routers) time instead of in O(N_routers*N_Excluded_Routers).


svn:r16061
2008-07-18 18:36:32 +00:00
Nick Mathewson
bdcbd23e23 Stop trying to detect versions of Tor on the server-side older than 0.1.1.15-rc; they simply do not work any more. Also add comment about how or_is_obsolete is a terrible field name.
svn:r15982
2008-07-16 13:15:11 +00:00
Roger Dingledine
267e61d0f3 When relays do their initial bandwidth measurement, don't limit
to just our our entry guards for the test circuits. Otherwise we
tend to have multiple test circuits going through a single entry
guard, which makes our bandwidth test less accurate. Fixes part
of bug 654; patch contributed by Josh Albrecht.

(Actually, modify Josh's patch to avoid doing that when you're
a bridge relay, since it would leak more than we want to leak.)


svn:r15850
2008-07-11 21:42:09 +00:00
Nick Mathewson
787c66b70f r16917@tombo: nickm | 2008-07-11 12:55:26 -0400
Remove token enum constant in routerparse.c that we do not actually use.


svn:r15841
2008-07-11 17:08:05 +00:00
Karsten Loesing
9231858ff5 Fix bug 763. When a hidden service is giving up on an introduction point candidate that was not included in the last published rendezvous descriptor, don't reschedule publication of the next descriptor.
svn:r15825
2008-07-10 21:02:01 +00:00
Nick Mathewson
c717e19a29 r16881@tombo: nickm | 2008-07-10 14:19:21 -0400
fix a rare segfault in bw-share-measuring code


svn:r15820
2008-07-10 18:31:28 +00:00
Nick Mathewson
0f8761f9fa fix typos in last patch spotted by sebastian and karsten
svn:r15700
2008-07-06 18:47:27 +00:00
Nick Mathewson
615c64efb8 Apply fix from chrisw: call connection_ap_attach_pending when we get a rendezvous2 or rendezvous_established call. This is a bit brute-foce, but it is better than we had before, and might not even show up on profiles. Backport candidate, once tested.
svn:r15699
2008-07-06 18:34:45 +00:00
Karsten Loesing
28296ad6e8 Correct punctuation.
svn:r15690
2008-07-06 13:59:36 +00:00
Roger Dingledine
c411f83211 forward-port r15576
svn:r15577
2008-06-30 23:27:11 +00:00
Roger Dingledine
45742ce0b0 Make directory servers include the X-Your-Address-Is: http header in
their responses even for begin_dir conns. Now clients who only ever use
begin_dir connections still have a way to learn their IP address. Should
fix bug 737. Reported by goldy.


svn:r15571
2008-06-30 21:52:39 +00:00
Roger Dingledine
aec928e0b6 Send a bootstrap problem "warn" event on the first problem if the
reason is NO_ROUTE (that is, our network is down).


svn:r15443
2008-06-24 08:00:30 +00:00
Roger Dingledine
b7d00bd52e whoops, i shouldn't've left that in
svn:r15434
2008-06-23 18:51:12 +00:00
Karsten Loesing
33ced73597 Added prefixes to testing-network-only configuration options.
svn:r15375
2008-06-20 17:03:13 +00:00
Roger Dingledine
8fa912a8c5 If we close our OR connection because there's been a circuit
pending on it for too long, we were telling our bootstrap status
events "REASON=NONE". Now tell them "REASON=TIMEOUT".


svn:r15369
2008-06-20 04:42:17 +00:00
Roger Dingledine
94dabd2c23 If you're using bridges, generate "bootstrap problem" warnings
as soon as you run out of working bridges, rather than waiting
for ten failures -- which will never happen if you have less than
ten bridges.


svn:r15368
2008-06-20 04:34:39 +00:00
Roger Dingledine
dd50ffb1de Big bridge bugfixes. Backport candidates.
If you have more than one bridge but don't know their keys,
you would only learn a request for the descriptor of the first one
on your list. (Tor considered launching requests for the others, but
found that it already had a connection on the way for $0000...0000
so it didn't open another.)
If you have more than one bridge but don't know their keys, and the
connection to one of the bridges failed, you would cancel all
pending bridge connections. (After all, they all have the same
digest.)


svn:r15366
2008-06-20 03:13:16 +00:00
Roger Dingledine
d76d0493d6 start sending "COUNT=%d RECOMMENDATION=%s" key/values on bootstrap
problem status events, so the controller can hear about problems even
before tor decides they're worth reporting for sure.


svn:r15357
2008-06-19 04:50:06 +00:00
Roger Dingledine
ad6b2e7523 check-spaces, fix a typo
svn:r15355
2008-06-18 20:14:25 +00:00
Roger Dingledine
c6a94718cd Directory authorities shouldn't complain about bootstrapping
problems just because they do a lot of reachability testing and
some of the connection attempts fail. 


svn:r15348
2008-06-18 07:34:04 +00:00
Roger Dingledine
50d3adb819 I was on the second paragraph of my or-dev mail explaining why I chose to
set starting=1 to avoid potential bugs with having it conflict with 0,
which I used to mean uninitialized, when I realized I would be writing
many more lame-sounding paragraphs in the future. Just start it at 0
and handle the bugs.


svn:r15346
2008-06-18 05:35:19 +00:00
Nick Mathewson
ed174245c6 implement more fine-tuning options for stats code
svn:r15345
2008-06-18 04:34:52 +00:00
Karsten Loesing
024de76e5d I was told there is an extend_info_free(). I won't leak memory again. I won't leak memory again. I won't ...
svn:r15335
2008-06-17 19:13:05 +00:00
Karsten Loesing
693d7e3e35 When establishing a hidden service, introduction points that originate from cannibalized circuits are completely ignored and not included in rendezvous service descriptors. Bugfix on 0.2.0.14-alpha. Backport candidate.
svn:r15332
2008-06-17 17:10:03 +00:00
Roger Dingledine
1ad83d74b1 Send an initial "Starting" bootstrap status event, so we have a
state to start out in.


svn:r15326
2008-06-17 08:15:42 +00:00
Roger Dingledine
c19392469d add a getinfo so vidalia can query our current bootstrap state, in case
it attaches partway through and wants to catch up.

matt, is this a good format for you, or is there an even better format?


svn:r15325
2008-06-17 08:01:43 +00:00
Peter Palfrader
efeea9f6de Fix .z suffix for intrumented download stats once more
svn:r15316
2008-06-16 22:40:26 +00:00
Peter Palfrader
6880df52eb Fix .z suffix for intrumented download stats
svn:r15315
2008-06-16 22:39:23 +00:00
Nick Mathewson
dd6324b0c6 More bug 707 fixes: no #if/#endif pairs inside macro arguments.
svn:r15307
2008-06-16 18:35:21 +00:00
Nick Mathewson
6299f4429a Clean up a macro/cpp interaction related to bug 707. Also, add a new "filename" config value type which is currently just a synonym for string, but which might be subject to expansion later.
svn:r15305
2008-06-16 18:09:53 +00:00
Nick Mathewson
44452c2756 r16341@tombo: nickm | 2008-06-15 22:04:25 -0400
Allow spaces to be omitted in approved-router file fingerprints. Requested by arma.


svn:r15296
2008-06-16 02:08:30 +00:00
Nick Mathewson
96bf9cd4c5 Comments and doc tweaks on Karsten's testing-dir-networks patch
svn:r15254
2008-06-14 16:11:37 +00:00
Nick Mathewson
0831cc3dbc Patch from Karsten to implement proposal 135 ("Testing Tor Networks").
svn:r15253
2008-06-14 16:01:29 +00:00
Nick Mathewson
97c06691b9 Malloc does not return size_t. (bug noticed by lodger.)
svn:r15252
2008-06-14 15:42:29 +00:00
Peter Palfrader
54b3b48802 Make unit tests pass again
svn:r15237
2008-06-13 23:24:11 +00:00
Roger Dingledine
6dee2bad83 note a bug that karsten found
svn:r15236
2008-06-13 23:05:48 +00:00
Roger Dingledine
5ded5b58a4 > why would it need an anonymized connection?
> ah.
> yes, i think you're right. i was thinking 3-hop, but i think it is 1-hop.


svn:r15235
2008-06-13 22:52:17 +00:00
Peter Palfrader
4ef606b8fc implement proposal 138: removing down routers from consensus
svn:r15230
2008-06-13 21:22:49 +00:00
Nick Mathewson
4630f0453d Explain how my emacs setup works in the HACKING file. Someone else may care too.
svn:r15228
2008-06-13 19:57:52 +00:00
Peter Palfrader
1f3dc9b22b Asking for a conditional consensus at .../consensus/<fingerprints> would crash
a dirserver if it did not already have a consensus.


svn:r15227
2008-06-13 18:58:58 +00:00
Roger Dingledine
52d3be06f1 steal some of the bootstrap phase strings from vidalia
svn:r15193
2008-06-13 06:23:46 +00:00
Nick Mathewson
bcde95509d Actually reinstate errors that did not work on windows, and add a comment about reading the documentation of the S_CASE and E_CASE macros before adding new cases to the switch statements there.
svn:r15179
2008-06-13 03:52:58 +00:00
Roger Dingledine
b50206a9d2 ignore some errnos in hopes of building on windows again
svn:r15178
2008-06-13 02:07:17 +00:00
Roger Dingledine
6bd006bdb8 you can't strcasecmp on 20-byte digests
what if they contain nuls?
(worse, what if they *don't* contain nuls? ;)


svn:r15149
2008-06-11 22:46:31 +00:00
Nick Mathewson
a886e86cbd r16171@tombo: nickm | 2008-06-11 13:47:41 -0400
Lower number of syscalls used to write data to ordinary sockets through use of writev.  Disabled till I have time to test it.


svn:r15133
2008-06-11 17:56:52 +00:00
Roger Dingledine
62b507fee0 forward-port r15129, but also note the real way we should fix it.
svn:r15130
2008-06-11 11:12:29 +00:00
Roger Dingledine
8c85eef9b0 start sending "bootstrap problem" status events when we're having troubles
reaching relays.


svn:r15116
2008-06-11 01:14:23 +00:00
Roger Dingledine
42f21007a3 consolidate all our edge/circ/orconn reason-to-foo-or-back functions
svn:r15115
2008-06-11 00:17:02 +00:00
Karsten Loesing
33f846b313 In very rare situations new hidden service descriptors were published earlier than 30 seconds after the last change to the service, with the 30 seconds being the current voodoo saying that a descriptor is stable.
svn:r15113
2008-06-10 23:31:55 +00:00
Roger Dingledine
15680ce8d2 some cleanups in preparation for moving stuff around
svn:r15112
2008-06-10 23:13:14 +00:00
Roger Dingledine
45cc25c019 minor fixes and notes
svn:r15111
2008-06-10 23:00:11 +00:00
Nick Mathewson
67a1658da5 Fix last geoip bugs.
svn:r15106
2008-06-10 20:11:59 +00:00
Nick Mathewson
16b62a01e4 a couple more geoip bugfixes
svn:r15105
2008-06-10 19:51:48 +00:00
Nick Mathewson
e3d1ad67f6 r16139@tombo: nickm | 2008-06-10 15:25:23 -0400
Small formatting fixes for geoip-stats file.


svn:r15104
2008-06-10 19:25:25 +00:00
Nick Mathewson
8d484b64e4 r16137@tombo: nickm | 2008-06-10 15:10:55 -0400
sign error


svn:r15103
2008-06-10 19:11:02 +00:00
Nick Mathewson
1ec5705445 r16133@tombo: nickm | 2008-06-10 15:06:43 -0400
Pointers do not make good ints.


svn:r15102
2008-06-10 19:06:48 +00:00
Nick Mathewson
8fa2e80257 r16132@tombo: nickm | 2008-06-10 14:39:19 -0400
Whitespace fix


svn:r15101
2008-06-10 19:06:46 +00:00
Nick Mathewson
b87a7760e0 r16129@tombo: nickm | 2008-06-10 14:28:06 -0400
More geoip tweaks.  Include in the file a rough estimator of our total share.


svn:r15099
2008-06-10 18:28:10 +00:00
Nick Mathewson
d0a4ad3a1c r16127@tombo: nickm | 2008-06-10 14:03:01 -0400
Improved code for counting clients by country: support recording by number of directory status requests in addition to number of IPs seen.


svn:r15097
2008-06-10 18:08:56 +00:00
Roger Dingledine
f4e12fa66d make the 'bootstrap problem' stuff quieter while i'm messing with it
svn:r15094
2008-06-09 22:15:08 +00:00
Nick Mathewson
55975452b4 r16121@tombo: nickm | 2008-06-09 16:14:39 -0400
fix compile with warnings on osx 10.5: double+int apparently gives a 64-bit value on some gccs


svn:r15093
2008-06-09 20:52:59 +00:00
Roger Dingledine
baa3cea213 Start noticing and reporting bootstrapping failures too. It looks like
we never bothered learning why OR conns fail, so next step is to add some
infrastructure for that.


svn:r15091
2008-06-09 18:32:43 +00:00
Peter Palfrader
dba6d8c55a also count number of downloads, not just the bytes
svn:r15090
2008-06-09 17:07:53 +00:00
Roger Dingledine
ac795353c4 fix a bug where we were never reporting the
"Finishing handshake with entry guard" bootstrap phase


svn:r15087
2008-06-09 07:01:52 +00:00
Roger Dingledine
6aeb79af06 report partial bootstrapping progress as we fetch descriptors
svn:r15083
2008-06-09 06:33:29 +00:00
Roger Dingledine
eafb07ec96 extra points if you make it compile. boy, i'm on a roll.
svn:r15077
2008-06-09 05:17:52 +00:00
Roger Dingledine
3b730c7556 whoops -- the other half of r15074
svn:r15076
2008-06-09 05:16:47 +00:00
Roger Dingledine
1ca2ead8c4 when we haven't had any application requests lately, don't bother
logging when we have expired a bunch of descriptors.


svn:r15074
2008-06-09 05:13:33 +00:00
Roger Dingledine
3bb5d3ba6d include tags in the bootstrap status events. also document the
bootstrapping process and how the phases break down.


svn:r15020
2008-06-08 02:53:32 +00:00
Roger Dingledine
00fcd66218 actually start sending the bootstrap status event, so matt
can start playing with it on his side.


svn:r15009
2008-06-07 09:26:41 +00:00
Roger Dingledine
5aeb89447e infrastructure for the 'bootstrap status event' feature, so we can
tell the controller how we're doing at bootstrapping, and it can
tell the user.


svn:r15008
2008-06-07 05:27:34 +00:00
Roger Dingledine
56658956a1 minor comment cleanup and xxx
svn:r15006
2008-06-07 05:01:22 +00:00
Roger Dingledine
b4d697688e revert r14970, since it didn't fix anything.
leave r14971 in place though.


svn:r15005
2008-06-07 05:00:06 +00:00
Roger Dingledine
ebab48769d Stop reloading the router list from disk for no reason when we
run out of reachable directory mirrors. Once upon a time reloading
it would set the 'is_running' flag back to 1 for them. It hasn't
done that for a long time.


svn:r15004
2008-06-07 04:56:08 +00:00
Roger Dingledine
ce64ca48b8 make some log entries more accurate
svn:r14998
2008-06-06 22:31:36 +00:00
Roger Dingledine
b65b89d50f make sure, when we're checking if we have enough dir info, that
we actually have the descriptor listed in the consensus, not just
any descriptor, for each relay.

don't backport this patch (yet); who knows what it might do.


svn:r14971
2008-06-05 11:37:40 +00:00
Roger Dingledine
ca416a78e3 When we switched to using v3 directories, we threw away the part of
the "do we have enough directory info?" calculation that checked
how many relays we believed to still be running based on our own
experience. So if we went offline, we never gave up trying to make
new circuits; worse, when we came back online we didn't recognize
that we should give all the relays another chance. Bugfix on
0.2.0.9-alpha; fixes bugs 648 and 675.


svn:r14970
2008-06-05 10:57:09 +00:00
Roger Dingledine
6782682ac6 changing v2 network status doesn't require us to recompute
anything about whether enough v3 dir info is here.


svn:r14969
2008-06-05 09:01:18 +00:00
Roger Dingledine
2c84c10196 remove some networkstatus consensus warnings for unnamed / invalid
relays. they weren't very specific, and were confusing people before
we reduced their log severity. now nobody even knows they exist.


svn:r14968
2008-06-05 08:20:23 +00:00
Nick Mathewson
fa0989fd67 Make unit tests pass again: new geoip behavior had freaked out.
svn:r14949
2008-06-04 18:38:37 +00:00
Roger Dingledine
b8bde32c3a forward-port r14934
svn:r14936
2008-06-04 09:02:25 +00:00
Roger Dingledine
c6b3cf4b96 documentation bug
svn:r14935
2008-06-04 08:59:14 +00:00
Roger Dingledine
00405468aa forward-port r14930
svn:r14931
2008-06-04 07:41:22 +00:00
Roger Dingledine
f3d679d4cc blind-forward-port that, while i'm at it
svn:r14929
2008-06-04 07:08:05 +00:00
Peter Palfrader
01c1a355c2 Also add create/create fast/extends to the dir-usage stats.
svn:r14900
2008-06-02 15:09:35 +00:00
Peter Palfrader
cfb1f554e2 Make note_request() accessible from outside of directory.c
svn:r14899
2008-06-02 15:09:29 +00:00
Peter Palfrader
716558a6a1 Instrument all downloads that pass through connection_dir_client_reached_eof()
svn:r14897
2008-06-02 15:09:19 +00:00
Nick Mathewson
3a469018e5 Fix warning when compiling with dmalloc.
svn:r14829
2008-05-29 14:37:56 +00:00
Nick Mathewson
ac330d9ba7 New code to implement proposal for local geoip stats. Only enabled with --enable-geoip-stats passed to configure.
svn:r14802
2008-05-29 02:29:35 +00:00
Nick Mathewson
a335b94c8f On win32, default to looking for the geoip file in the same directory as torrc. This is a dumb hack; it should turn into a general mechanism.
svn:r14796
2008-05-29 01:22:30 +00:00
Nick Mathewson
6bfa96bfc7 Fix bug noted by roger: rebuild extrainfo store from time to time, even if we have never actually downloaded an extrainfo. Bridge authorities need this, or they never clean the extrainfo store.
svn:r14792
2008-05-29 00:44:57 +00:00
Roger Dingledine
277dce9ecf document the handle-comments-in-geoip file
svn:r14785
2008-05-28 21:10:46 +00:00
Nick Mathewson
6641152514 Fix some warnings.
svn:r14781
2008-05-28 18:34:10 +00:00
Nick Mathewson
bd3b86df3b Several geoip changes/fixes as requested.
svn:r14780
2008-05-28 18:31:57 +00:00
Roger Dingledine
7f61dafe8d include the geoip file in the tarball, and load it by default
when tor starts.
this breaks rpms and maybe other packages.


svn:r14764
2008-05-28 04:37:34 +00:00
Nick Mathewson
4ea2a4595e Fix the first part of bug 681, as suggested by Robert Hogan on or-talk.
svn:r14754
2008-05-27 21:02:36 +00:00
Nick Mathewson
9975c4f6f8 Fix part of bug 681: always reattach tunneled directory connections, regardless of the setting for LeaveStreamsUnattached
svn:r14750
2008-05-27 20:26:40 +00:00
Nick Mathewson
09cd8fa371 r19795@catbus: nickm | 2008-05-16 14:54:24 -0400
Rename tor_addr_t manipulation functions for a consistent style.


svn:r14639
2008-05-16 19:19:49 +00:00
Nick Mathewson
0b6b356f71 r19725@catbus: nickm | 2008-05-13 08:47:18 -0400
Forward-port: update authority keys affected by Debian OpenSSL bug (See CVE-2008-0166 or http://lists.debian.org/debian-security-announce/2008/msg00152.html )


svn:r14603
2008-05-13 12:47:27 +00:00
Nick Mathewson
e1ef199cf6 r19714@catbus: nickm | 2008-05-12 17:11:47 -0400
Fwdport Bugfix: an authority signature is "unrecognized" if we lack a dirserver entry for it, even if we have an older cached certificate that says it is recognized.  This affects clients who remove entries from their dirserver list without clearing their certificate cache.


svn:r14597
2008-05-12 21:12:21 +00:00
Nick Mathewson
42dc560b1a r19705@catbus: nickm | 2008-05-12 11:40:15 -0400
Actually load the legacy key, not just the authority key twice.


svn:r14594
2008-05-12 15:40:36 +00:00
Nick Mathewson
08ba3355bc r19694@catbus: nickm | 2008-05-12 00:21:37 -0400
Add unit tests for last patch; make it more testable; fix a bug or two.


svn:r14586
2008-05-12 04:22:01 +00:00
Nick Mathewson
f3f6ecef48 r19690@catbus: nickm | 2008-05-11 22:13:31 -0400
Implement a proposal to let a directory authority migrate its identity key without ceasing to sign consensuses.


svn:r14584
2008-05-12 02:14:01 +00:00
Roger Dingledine
755cbe5d44 cosmetic patch by Bernhard M. Wiedemann, so our comments follow
the socks5 protocol better


svn:r14552
2008-05-04 09:36:48 +00:00
Nick Mathewson
6d5a9c81b0 r19496@catbus: nickm | 2008-05-02 19:10:29 -0400
Even compile errors need closing quotes.


svn:r14533
2008-05-02 23:11:43 +00:00
Roger Dingledine
5ad9dc2244 apply patch from lodger to simplify code a bit
svn:r14474
2008-04-25 18:42:42 +00:00
Peter Palfrader
4fa1c69c44 Only using v3 authorities and using the proper digest works better
svn:r14455
2008-04-24 21:29:47 +00:00
Peter Palfrader
c3c7e7114e Actually, do not use conditional consensus downloads until the authorities have upgraded
svn:r14453
2008-04-24 15:51:53 +00:00
Peter Palfrader
ca43044600 I bet I screwed up while merging in the changes from the feature branch into my git-svn repository. Undo r14451
svn:r14452
2008-04-24 15:43:25 +00:00
Peter Palfrader
016e67f941 Merge conditional consensus downloading
svn:r14451
2008-04-24 15:39:14 +00:00
Peter Palfrader
eaad3ab395 Spec compliance: sort id fingerprints in consensus get requests
svn:r14450
2008-04-24 15:39:10 +00:00
Peter Palfrader
901ee58c53 Enable conditional consensus downloading starting with 0.2.1.1-alpha servers
svn:r14449
2008-04-24 15:39:08 +00:00
Peter Palfrader
9d181ec106 Fix doxygen comments to not use <> for metavars since they have to be valid HTML
svn:r14447
2008-04-24 15:39:01 +00:00
Peter Palfrader
788404dacf and the client part of the consensus-by-authority-fpr proposal (ifdef'ed out)
svn:r14446
2008-04-24 15:38:57 +00:00
Peter Palfrader
006b5762d3 Implement the server part of the consensus-by-authority-fpr proposal
svn:r14445
2008-04-24 15:38:54 +00:00
Roger Dingledine
d5be900986 forward-port the severity fixes
svn:r14442
2008-04-24 05:32:55 +00:00
Nick Mathewson
d02d6660a8 r15308@tombo: nickm | 2008-04-23 16:46:48 -0400
Free baddir and badexit policy lists on exit.  fixes bug 672. only affects authorities.


svn:r14431
2008-04-23 20:47:53 +00:00
Nick Mathewson
05b184de01 r15304@tombo: nickm | 2008-04-23 16:31:40 -0400
Forward-port: I had apparently broken OSX and Freebsd by not initializing threading before we initialize the logging system.  This patch should do so, and fix bug 671.


svn:r14430
2008-04-23 20:32:31 +00:00
Roger Dingledine
5dc8062afa what, we went from v4 to v6?
svn:r14428
2008-04-23 18:37:24 +00:00
Roger Dingledine
a1366be7ee forward-port r14421
svn:r14424
2008-04-23 00:31:20 +00:00
Nick Mathewson
41929c2684 r15287@tombo: nickm | 2008-04-22 17:09:25 -0400
Periodically launch requests for server/authority.z when it might help us learn our IP.  Fix for bug 652.


svn:r14418
2008-04-22 21:10:41 +00:00
Roger Dingledine
d72b256f4f When we choose to abandon a new entry guard because we think our
older ones might be better, close any circuits pending on that
new entry guard connection. Bugfix on 0.1.2.8-beta; found by lodger.


svn:r14417
2008-04-22 18:38:25 +00:00
Nick Mathewson
bc95a4dbcb r15283@tombo: nickm | 2008-04-22 13:43:45 -0400
Correctly notify one-hop connections when a circuit build has failed. possible fix for bug 669. found by lodger.


svn:r14415
2008-04-22 17:44:28 +00:00
Nick Mathewson
21592ad429 r15278@tombo: nickm | 2008-04-22 13:17:37 -0400
Apply patch from mwenge to fix bug 646: makes stream events for dns requests get generated more consistently.


svn:r14413
2008-04-22 17:21:12 +00:00
Nick Mathewson
e623d9baff r15277@tombo: nickm | 2008-04-22 13:14:18 -0400
Note a place to refactor.


svn:r14412
2008-04-22 17:21:09 +00:00
Nick Mathewson
ef9c34688c r15273@tombo: nickm | 2008-04-22 12:32:28 -0400
apply patch from lodger: reject requests for reverse-dns lookup of names in private address space.  make non-exits reject all dns requests.  Fixes bug 619.


svn:r14410
2008-04-22 16:32:55 +00:00
Nick Mathewson
6e979489dc r15269@tombo: nickm | 2008-04-22 12:23:30 -0400
Fix bug 663: warn less verbosely about clock skew from netinfo cells


svn:r14408
2008-04-22 16:23:47 +00:00
Peter Palfrader
0cbecbe050 Fix a pair of comments
svn:r14405
2008-04-22 15:20:46 +00:00
Nick Mathewson
1b9c06ab96 r15230@tombo: nickm | 2008-04-17 16:18:08 -0400
Do not allocate excess space for named_flag and unnamed_flag in dirvote.c.  Fixes bug 662.  Not a dangerous bug: sizeof(int*) is at least as big as sizeof(int) everywhere.


svn:r14391
2008-04-17 20:23:13 +00:00
Roger Dingledine
5e299b5e01 minor fixes that have been accumulating
svn:r14378
2008-04-16 00:12:44 +00:00
Roger Dingledine
2b4ff1718f forward-port r14375 and try to make it less likely to happen again
svn:r14377
2008-04-16 00:10:39 +00:00
Roger Dingledine
20f927c2dd forward-port r14373
svn:r14374
2008-04-15 23:06:31 +00:00
Nick Mathewson
b927ede48c r15161@31-33-107: nickm | 2008-04-10 11:11:58 -0400
Make dumpstats() log the size and fullness of openssl-internal buffers, so I can test my hypothesis that many of them are empty, and my alternative hypothesis that many of them are mostly empty, against the null hypothesis that we really need to be burning 32K per open OR connection on this.


svn:r14350
2008-04-10 15:12:24 +00:00
Nick Mathewson
4901ee0a8c r19273@catbus: nickm | 2008-04-09 14:44:23 -0400
Do a slightly better fix for r14329: don't call time() quite so much.  Also note the time(NULL) hack we wanted to do in the TODO.


svn:r14334
2008-04-09 18:44:50 +00:00
Nick Mathewson
186df044cd r19262@catbus: nickm | 2008-04-09 14:05:20 -0400
When writing relay cells to a buffer, update timestamp_last_added_nonpadding.  Bugfix on 0.2.0.1-alpha. Backport candidate.


svn:r14329
2008-04-09 18:05:47 +00:00
Nick Mathewson
31153d6374 r19243@catbus: nickm | 2008-04-08 13:28:59 -0400
Use a freelist to hold a few recent memarea chunks.  We do a kazillion memarea allocs and frees; that cant be good for us.


svn:r14319
2008-04-08 17:29:05 +00:00
Nick Mathewson
a627407fcb r19233@catbus: nickm | 2008-04-08 13:06:34 -0400
When we remove old routers, use Bloom filters rather than a digestmap-based set in order to tell which ones we absolutely need to keep.  This will save us roughly a kazillion little short-lived allocations for hash table entries.


svn:r14318
2008-04-08 17:06:41 +00:00
Nick Mathewson
0c9efd6a1e r19231@catbus: nickm | 2008-04-07 12:45:58 -0400
Update last_listed_as_valid_until for new routers based on v2 networkstatus as well as consensus networkstatus.


svn:r14317
2008-04-08 17:06:38 +00:00
Nick Mathewson
2d68487e7f r19229@catbus: nickm | 2008-04-07 12:28:22 -0400
Add a new SMARTLIST_FOREACH_JOIN macro to iterate through two sorted lists in lockstep.  This happens at least 3 times in the code so far, and is likely to happen more in the future.  Previous attempts to do so proved touchy, tricky, and error-prone: now, we only need to get it right in one place.


svn:r14309
2008-04-07 16:28:34 +00:00
Nick Mathewson
85db675911 r19202@catbus: nickm | 2008-04-04 17:18:47 -0400
Make last_served_at optional; make last_listed_as_valid_until take account (partially) of v2 statuses.


svn:r14299
2008-04-04 21:18:56 +00:00
Nick Mathewson
68407e6a9c r19199@catbus: nickm | 2008-04-03 15:01:05 -0400
Fix bug 641 and 650, I think.


svn:r14297
2008-04-03 19:01:16 +00:00
Roger Dingledine
1ac11591d2 a potential fix for bug 641.
svn:r14281
2008-04-02 20:48:36 +00:00
Roger Dingledine
39c402c29f when add_file_log() fails, tell us why.
svn:r14277
2008-04-01 21:05:31 +00:00
Nick Mathewson
d43a9d9440 r19152@catbus: nickm | 2008-03-30 23:20:11 -0400
Make unit tests pass again after Link protocol list change.


svn:r14254
2008-03-31 03:20:55 +00:00
Nick Mathewson
006530f037 r19140@catbus: nickm | 2008-03-30 14:13:36 -0400
Note in our router descriptors that we actually support link protocol version 2, now that it seems to work.


svn:r14246
2008-03-30 18:14:55 +00:00
Nick Mathewson
72ca7e5d88 r19138@catbus: nickm | 2008-03-30 11:59:26 -0400
oops; fix bug in descriptor metric logic.


svn:r14245
2008-03-30 15:59:32 +00:00
Nick Mathewson
e19d96637d r19118@catbus: nickm | 2008-03-29 00:27:08 -0400
Code (disabled) to get way too much info about the contents of old_routers on USR1.


svn:r14230
2008-03-29 04:27:34 +00:00
Nick Mathewson
e89bf1c573 r19109@catbus: nickm | 2008-03-27 16:05:18 -0400
Replace a syntax error and a log message that was never emitted with a simple assert.  Asserts are fun and easy.


svn:r14224
2008-03-27 20:05:44 +00:00
Peter Palfrader
9d132fbde6 Add --hush switch.
New --hush command-line option similar to --quiet.  While --quiet disables all
logging to the console on startup, --hush limits the output to messages of
warning and error severity.


svn:r14222
2008-03-27 17:25:49 +00:00
Nick Mathewson
968ad93b0a r19093@catbus: nickm | 2008-03-27 12:43:58 -0400
Only log a notice that dmalloc has been set up if it fails.  Actually, since we have not added a temp log yet, I am not sure this ever does anything.


svn:r14216
2008-03-27 16:46:39 +00:00
Nick Mathewson
4e6b6e3ad7 r19092@catbus: nickm | 2008-03-27 12:43:29 -0400
Stop supporting anything besides CMD_RUN_TOR in ntmain.c. Based on patch from Sebastian Hahn.


svn:r14215
2008-03-27 16:46:36 +00:00
Nick Mathewson
12b217bce8 r19091@catbus: nickm | 2008-03-27 12:42:57 -0400
Stop reading torrc when all we want to do is --hash-password.  Fix based on patch from Sebastian Hahn. Backport candidate.


svn:r14214
2008-03-27 16:46:34 +00:00
Nick Mathewson
02acee891c r19089@catbus: nickm | 2008-03-27 11:05:23 -0400
Free some static hashtables and the log mutex on exit. Backport candidate.


svn:r14212
2008-03-27 15:05:28 +00:00
Nick Mathewson
fa15ed4b7b r19079@catbus: nickm | 2008-03-26 17:16:46 -0400
Free authority certs on exit.  Backport candidate.


svn:r14205
2008-03-26 21:16:56 +00:00
Nick Mathewson
944bd3dbed r19074@catbus: nickm | 2008-03-26 17:08:32 -0400
Start new address policies with refcount of 1, not 2.  Backport candidate once tested more.


svn:r14204
2008-03-26 21:08:39 +00:00
Nick Mathewson
e8cc756c13 r19072@catbus: nickm | 2008-03-26 13:50:24 -0400
Add code to debug memory area size.  Use results of this code to set a couple of area sizes more sanely.


svn:r14201
2008-03-26 17:50:27 +00:00
Nick Mathewson
745f3c859a r19066@catbus: nickm | 2008-03-26 13:24:15 -0400
Initialize logging before we log anything.  Bugfix on 0.2.0.x-alpha.


svn:r14199
2008-03-26 17:25:16 +00:00
Nick Mathewson
762d82cf74 r19062@catbus: nickm | 2008-03-26 12:56:25 -0400
Fix whitespace


svn:r14197
2008-03-26 16:56:37 +00:00
Nick Mathewson
3af9e099f7 r19061@catbus: nickm | 2008-03-26 12:53:18 -0400
Now that every thing in routerparse.c is switched over to use memareas, there is no need to keep the heap-allocated token code.


svn:r14196
2008-03-26 16:56:34 +00:00
Nick Mathewson
6edab8569a r19060@catbus: nickm | 2008-03-26 12:44:19 -0400
Make v2 hidden service descriptors use the new area allocation logic.  This works for me, but Karsten should definitely have a look at it.


svn:r14195
2008-03-26 16:56:31 +00:00
Nick Mathewson
e4ebe3409e r19049@catbus: nickm | 2008-03-26 12:33:25 -0400
Add new stacklike, free-all-at-once memory allocation strategy.  Use it when parsing directory information.  This helps parsing speed, and may well help fragmentation some too.  hidden-service-related stuff still uses the old tokenizing strategies.


svn:r14194
2008-03-26 16:33:33 +00:00
Nick Mathewson
df6b256bc0 r19041@catbus: nickm | 2008-03-25 16:20:42 -0400
More unit tests to improve coverage.


svn:r14185
2008-03-25 20:20:45 +00:00
Nick Mathewson
41deb5cd7b r19039@catbus: nickm | 2008-03-25 12:15:58 -0400
Add some unit tests, particularly for AES counter mode.


svn:r14180
2008-03-25 16:16:05 +00:00
Roger Dingledine
9047361007 Mar 24 08:43:30.014 [debug] circuit_find_to_cannibalize(): Hunting for
a circ to cannibalize: purpose 5, uptime 0, capacity 4, internal 0


svn:r14166
2008-03-24 18:43:01 +00:00
Roger Dingledine
13174b8f97 fix r14162 so it was what i meant. sometimes precedence is surprising!
svn:r14164
2008-03-24 07:24:09 +00:00
Roger Dingledine
a9acdb8f53 when our onehop circuits were failing, nobody was telling the
streams. so they waited 120 seconds before timing out. this
was particularly bad during bootstrapping, if an authority is
down or not answering right.


svn:r14163
2008-03-24 05:48:51 +00:00
Roger Dingledine
c26c77d24d If our create-fast cell is mysteriously never answered for a begindir
attempt, notice more quickly. Some of our bootstrapping attempts have a 60
second delay while we sit there wondering why we're getting no response.


svn:r14162
2008-03-24 03:50:21 +00:00
Roger Dingledine
52b267b987 make it build, too
svn:r14151
2008-03-21 21:59:57 +00:00
Nick Mathewson
b5b77f8bf3 r19004@catbus: nickm | 2008-03-21 15:18:43 -0400
Use RAND_poll() again: the bug that made us stop using it has been fixed.


svn:r14150
2008-03-21 19:18:57 +00:00
Roger Dingledine
7ed6406ce9 forward-port 14113-r14115
svn:r14116
2008-03-18 23:12:41 +00:00
Nick Mathewson
e96d22e914 r18941@catbus: nickm | 2008-03-18 14:59:43 -0400
Likely fix for bug 632: do not call start_reading on a placeholder connection.


svn:r14109
2008-03-18 19:00:12 +00:00
Nick Mathewson
a62a24036d r18937@catbus: nickm | 2008-03-18 14:50:39 -0400
Fix the other lingering part of bug 617: make ClientDNSRejectInternalAddresses actually work.


svn:r14107
2008-03-18 18:51:34 +00:00
Nick Mathewson
ba915e4211 r18913@catbus: nickm | 2008-03-18 10:30:39 -0400
16, not 64.


svn:r14094
2008-03-18 14:30:46 +00:00
Roger Dingledine
31d185a23b point out another bug for nick. and if it's *not* a bug, that's
stunning and i want to know why. :)


svn:r14088
2008-03-18 03:08:48 +00:00
Roger Dingledine
2117abbe3f forward-port the 0.2.0.22-rc changelog entry, plus remove
some duplicate items.


svn:r14086
2008-03-18 02:39:34 +00:00
Nick Mathewson
fe1b2a4ed4 r18900@catbus: nickm | 2008-03-17 18:32:25 -0400
Fix tests and routerdesc behavior on trunk.


svn:r14084
2008-03-17 22:32:28 +00:00
Nick Mathewson
e17e6371d1 r18896@catbus: nickm | 2008-03-17 16:10:54 -0400
Fix bug in earlier bugfix.  Note stupidness of allowing NULL policies at all.  Disallow empty exit policies in router descriptors.


svn:r14082
2008-03-17 20:10:57 +00:00
Nick Mathewson
80ec9e51dd r18891@catbus: nickm | 2008-03-17 13:20:20 -0400
Patch from Sebastian Hahn: give an error message on "error replacing old router store."


svn:r14080
2008-03-17 17:21:12 +00:00
Nick Mathewson
9a24158c69 r18880@catbus: nickm | 2008-03-17 12:51:24 -0400
Fix policy-related crash bug found by lodger.


svn:r14077
2008-03-17 16:51:48 +00:00
Nick Mathewson
296289de82 r18873@catbus: nickm | 2008-03-17 00:06:31 -0400
oops.  guard status logging change had a bug.  it is non-obvious how to make the code perfect atm; just make it work.


svn:r14070
2008-03-17 04:07:56 +00:00
Nick Mathewson
e6b617bf05 r18872@catbus: nickm | 2008-03-16 23:56:48 -0400
Only dump all guard node status to the log when the guard node status actually changes.  Downgrade the 4 most common remaining INFO log messages to DEBUG.


svn:r14069
2008-03-17 04:07:51 +00:00
Nick Mathewson
c59f66709d r18862@catbus: nickm | 2008-03-16 23:33:11 -0400
Part of fix for bug 617: allow connection_ap_handshake_attach_circuit() to mark connections, to avoid double-mark warnings.  Note that this is an incomplete refactoring.


svn:r14066
2008-03-17 03:37:54 +00:00
Nick Mathewson
bd547e3cfc r18861@catbus: nickm | 2008-03-16 23:22:56 -0400
Fix a couple of bugs in setting control log callback severity.


svn:r14065
2008-03-17 03:37:52 +00:00
Nick Mathewson
46155aca17 r18804@catbus: nickm | 2008-03-13 18:18:31 -0400
Refactor log domain mask code so that nobody outside of log.c has to use SEVERITY_MASK_IDX.  It is error-prone.


svn:r14016
2008-03-13 22:18:38 +00:00
Peter Palfrader
925ba96508 downgrade get_interface_address6 logging severity to LOG_DEBUG.
get_interface_address6() fails regardless of the allocator used,
wever logging to the original severity of 0 causes an assert
error only with the bsd allocator.  weird.


svn:r14005
2008-03-13 16:15:16 +00:00
Nick Mathewson
365f16b199 r18787@catbus: nickm | 2008-03-13 11:11:52 -0400
Make set-option functions return sensible error codes from an enum, not mysterious negative integers


svn:r14004
2008-03-13 15:11:56 +00:00
Peter Palfrader
24884bb3ed Use proper log levels with get_interface_address6() calls so we do not die in an assert error because of invalid log levels. Should a failure here fail our test suite?
svn:r14003
2008-03-13 15:10:35 +00:00
Nick Mathewson
11e464c331 r18753@catbus: nickm | 2008-03-11 14:56:39 -0400
Make some assert()s into tor_assert()s.  Make some tor_assert()s called from logging into assert()s, and document why.


svn:r13977
2008-03-11 18:56:41 +00:00
Nick Mathewson
4b65ea0ec0 r18730@catbus: nickm | 2008-03-11 00:47:04 -0400
Forward-port: Fix the SVK version detection logic to work right on a branch: tolerate multiple "copied from" tags and only look at the first.


svn:r13959
2008-03-11 04:47:07 +00:00
Nick Mathewson
8b24e01599 r18723@catbus: nickm | 2008-03-11 00:25:30 -0400
Fix bug spotted by mwenge: a server_event should not be a sever_event.  Also, fix compile errors in config.c and control.c with --enable-gcc-warnings.


svn:r13957
2008-03-11 04:30:14 +00:00
Peter Palfrader
2704a2e129 And appease the whitespace nazis among us
svn:r13950
2008-03-10 12:43:47 +00:00
Peter Palfrader
79f1ee8a2d Implement LOADCONF control command
The LOADCONF control command allows posting a config file to Tor
over the control interface.  This config file is then loaded as if
it had been read from disk.  Sending a HUP signal to Tor will make
it try to load its old config from disk again, thereby forgetting
the config loaded with this command.


svn:r13948
2008-03-10 12:41:52 +00:00
Peter Palfrader
bc4095c70c different exit codes for options_init_from_string()
Change options_init_from_string() so that it returns different exit codes in the
error case, depending on what went wrong.  Also push the responsibility to log
the error to the caller.


svn:r13947
2008-03-10 12:41:49 +00:00
Peter Palfrader
8c71d7ea16 options_init_from_torrc(): split off options_init_from_string()
svn:r13946
2008-03-10 12:41:44 +00:00
Peter Palfrader
947fd064a3 Store options we got from commandline seperately from bare argv/argc
svn:r13945
2008-03-10 12:41:40 +00:00
Peter Palfrader
00d64fd213 options_init_from_torrc(): move code that loads torrc into its own function
move code that loads torrc from disk and sets torrc_fname into its own function


svn:r13944
2008-03-10 12:41:36 +00:00
Peter Palfrader
ded55fa296 options_init_from_torrc(): tread non-existing torrc like empty torrc.
Tread the case of a non-existing conffile, when allowed, exactly like the one
with an empty torrc.


svn:r13943
2008-03-10 12:41:33 +00:00
Peter Palfrader
e8f4d79ec1 options_init_from_torrc(): move code that looks for torrc into its own function
Part of options_init_from_torrc()'s job was looking for -f flags (to specify
an alternate config file) on the command line, complaining if more than one
is given or the given does not exist.  If none is given then use the compiled-in
default location, accepting if it does not exist.  This logic has been moved
into its own function in an attemped to make options_init_from_torrc() easier
to deal with.


svn:r13942
2008-03-10 12:41:29 +00:00
Peter Palfrader
4118e319c7 options_init_from_torrc(): Split argv processing into two parts
Split the argv processing loop into two poarts, one that deals with
figuring out which conffile to use, and the other that figures out
which "command" (hash fingerprint, verify config, list fpr, run tor)
the user asked for.

There is a third part further down that imports command line args
into the config but that is not touched.


svn:r13941
2008-03-10 12:41:26 +00:00
Peter Palfrader
8987bd2fd9 If we decrement incoming_cmd's length when receiving the ending CRLF "." CRLF for a multi-line control command, also truncate the string by nul-terminating it in the correct place.
svn:r13939
2008-03-10 12:13:43 +00:00
Roger Dingledine
0df1564298 forward-port recent changes
svn:r13935
2008-03-10 07:50:09 +00:00
Nick Mathewson
7587e16796 r18639@catbus: nickm | 2008-03-07 20:11:48 -0500
Change semantics of add-a-log functions to copy severity setup: that is way less error-prone.  Fix up config.c to act accordingly.


svn:r13888
2008-03-08 01:11:54 +00:00
Nick Mathewson
f56ba5f3d6 r18630@catbus: nickm | 2008-03-05 17:31:33 -0500
Implement domain-selection for logging.  Source is documented; needs documentation in manpage (maybe).  For now, see doxygen comment on parse_log_severity_config in log.c


svn:r13875
2008-03-05 22:31:39 +00:00
Peter Palfrader
9e7b4400dc minor cleanup
in options_act() we set running_tor to options->command == CMD_RUN_TOR
once and used that in all but one place.  Now we use running_tor in that
place also.


svn:r13819
2008-03-03 12:48:13 +00:00
Roger Dingledine
5bf0a01011 forward-port r13799 and the 0.2.0.21-rc changelog
svn:r13808
2008-03-02 22:29:04 +00:00
Roger Dingledine
cf3e1b1309 we should consider dumping the v1 directory stuff from 0.2.1.x.
perhaps we would even replace the v1 directory with a static
page saying 'this is a tor server, let me tell you what that is'.


svn:r13797
2008-03-01 17:47:41 +00:00
Roger Dingledine
c5a7ff8e43 forward-port r13777
svn:r13778
2008-02-29 01:45:06 +00:00