Commit Graph

16555 Commits

Author SHA1 Message Date
Nick Mathewson
a141430ec3 Rename log() to tor_log() for logging
This is meant to avoid conflict with the built-in log() function in
math.h.  It resolves ticket 7599.  First reported by dhill.

This was generated with the following perl script:

 #!/usr/bin/perl -w -i -p

 s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g;

 s/\blog\(/tor_log\(/g;
2013-02-01 15:43:37 -05:00
Nick Mathewson
abb5519d93 typo in crypto_curve25519.c comment, spotted by rransom 2013-01-31 13:53:29 -05:00
Nick Mathewson
294ce2ea87 whitespace fix 2013-01-31 13:26:25 -05:00
Nick Mathewson
b35b4d5a9a Merge branch 'double-0-check' 2013-01-31 13:19:27 -05:00
Nick Mathewson
b0dd355891 Use %d, not %02d, for decimal percentages
Cosmetic tweak on 5956; not in any released tor.
2013-01-30 17:35:28 -05:00
Nick Mathewson
73f85905aa Merge branch 'rename_queue_macros_squashed' 2013-01-30 12:58:59 -05:00
Nick Mathewson
35daf6f602 Rename all of the macros in tor_queue.h to start with TOR_ 2013-01-30 12:58:49 -05:00
Nick Mathewson
29136bd7e4 Merge branch 'bug5956_squashed' 2013-01-30 11:59:51 -05:00
Nick Mathewson
02c320916e Parameterize FRAC_USABLE_NEEDED for fraction of circuits
Instead of hardcoding the minimum fraction of possible paths to 0.6, we
take it from the user, and failing that from the consensus, and
failing that we fall back to 0.6.
2013-01-30 11:58:17 -05:00
Nick Mathewson
813a0f8c40 Compute whether we're ready to build circuits based on fraction of paths
Previously we did this based on the fraction of descriptors we
had. But really, we should be going based on what fraction of paths
we're able to build based on weighted bandwidth, since otherwise a
directory guard or two could make us behave quite oddly.

Implementation for feature 5956
2013-01-30 11:58:17 -05:00
Nick Mathewson
bc52e0488b Add an optional out-arg to count_usable_descriptors
This way we get the usable nodes themselves, so we can feed them into
frac_nodes_with_descriptors
2013-01-30 11:58:17 -05:00
Nick Mathewson
fcf906ec73 Add a function to compute fraction of nodes (by weighted bw) with descriptors 2013-01-30 11:58:17 -05:00
Nick Mathewson
73d605b0f7 Detect platforms where memset(0) doesn't set doubles to 0.0.
This is allowed by the C statndard, which permits you to represent
doubles any way you like, but in practice we have some code that
assumes that memset() clears doubles in structs.  Noticed as part of
7802 review; see 8081 for more info.
2013-01-29 17:38:15 -05:00
Nick Mathewson
a0351311ae Fix unit test to not expect v2 directory request geoip info
When we implemented #5823 and removed v2 directory request info, we
never actually changed the unit tests not to expect it.

Fixes bug 8084; bug not in any released version of Tor.
2013-01-29 12:01:41 -05:00
Andrea Shepard
123daffb60 Merge branch 'bug7802' of ssh://git-rw.torproject.org/mikeperry/tor 2013-01-28 16:16:45 -08:00
Andrea Shepard
dfbd19df41 Merge branch 'time_based_onionqueue_v2' of ssh://git-rw.torproject.org/nickm/tor 2013-01-24 08:10:12 -08:00
Mike Perry
a78542f0c3 Bug 8024: Check for null/closed channel before probing. 2013-01-22 21:03:28 -08:00
Nick Mathewson
b415aba5fa Merge remote-tracking branch 'public/bug8012' 2013-01-22 14:54:30 +00:00
Nick Mathewson
dd77b652f2 More of b30d06255c for #6826: fix compat_libevent compilation
It looks like there was a compilation error for 6826 on some
platforms.  Removing even more now-uncallable code to handle detecting
libevent versions before 1.3e.

Fixes bug 8012; bug not in any released Tor.
2013-01-21 18:24:10 +00:00
Mike Perry
b810d322bf squash! Remove a source of error during path bias scaling
Improve debug logs and fix a state fencepost error.
2013-01-20 14:32:56 -08:00
Mike Perry
06a1d0b044 squash! Implement Path use bias accounting.
Make a debug log more informative.
2013-01-20 14:32:56 -08:00
Mike Perry
f858370233 Prevent early close of path bias testing circuits.
We need to let them live long enough to perform the test.
2013-01-20 14:32:56 -08:00
Mike Perry
fb711e6d77 squash! Remove a source of error during path bias scaling
Move a log message about scaling to after we scale
2013-01-20 14:32:27 -08:00
Nick Mathewson
c71b7db8f3 Merge remote-tracking branch 'karsten/bug5823' 2013-01-19 09:36:55 -05:00
Mike Perry
38c7195a32 Bug 7802 changes file. 2013-01-18 21:23:37 -08:00
Mike Perry
a678ff9ec1 Document path use bias options in the manpage. 2013-01-18 21:23:37 -08:00
Mike Perry
d80b881a52 Remove a source of error during path bias scaling
If any circuits were opened during a scaling event, we were scaling attempts
and successes by different amounts. This leads to rounding error.

The fix is to record how many circuits are in a state that hasn't been fully
counted yet, and subtract that before scaling, and add it back afterwords.
2013-01-18 21:23:33 -08:00
Mike Perry
a2db17a1aa Don't immediately count cannibalized circs as used.
Since they use RELAY_EARLY (which can be seen by all hops on the path),
it's not safe to say they actually count as a successful use.

There are also problems with trying to allow them to finish extending due to
the circuit purpose state machine logic. It is way less complicated (and
possibly more semantically coherent) to simply wait until we actually try to
do something with them before claiming we 'used' them.

Also, we shouldn't call timed out circuits 'used' either, for semantic
consistency.
2013-01-18 19:46:29 -08:00
Mike Perry
24b9b9f791 Roll back the path_state for circs if we detatch a stream.
An adversary could let the first stream request succeed (ie the resolve), but
then tag and timeout the remainder (via cell dropping), forcing them on new
circuits.

Rolling back the state will cause us to probe such circuits, which should lead
to probe failures in the event of such tagging due to either unrecognized
cells coming in while we wait for the probe, or the cipher state getting out
of sync in the case of dropped cells.
2013-01-18 19:46:28 -08:00
Mike Perry
e13e30221e Implement Path use bias accounting.
Path use bias measures how often we can actually succeed using the circuits we
actually try to use. It is a subset of path bias accounting, but it is
computed as a separate statistic because the rate of client circuit use may
vary depending on use case.
2013-01-18 19:46:21 -08:00
Nick Mathewson
ee421e68d5 Remove -v flag from autoreconf by default
You can get it back by saying ./autogen.sh -v

Patch from onizuka; for bug 4664.

This isn't a complete fix, since starting from a clean checkout still
reports that it's installing stuff
2013-01-18 18:02:08 -05:00
Nick Mathewson
42c4418bed Split smartlist_choose_node_by_bandwidth_weights
This is a minimal refactoring to expose the weighted bandwidth
calculations for each node so I can use them to see what fraction of
nodes, weighted by bandwidth, we have descriptors for.
2013-01-18 12:24:54 -05:00
Nick Mathewson
e0581a4b57 Replace base-{16,32,64} with base{16,32,64} in the code
Patch from onizuka generated with

 find ./ -type f -perm -u+rw -exec sed -ri 's/(Base)-(16|32|64)/\1\2/gi' {} \;

Fixes issue 6875 on Tor.
2013-01-17 16:08:28 -05:00
Nick Mathewson
eea69b7020 Merge branch '024_msvc_more' 2013-01-17 15:54:51 -05:00
Nick Mathewson
cd80f6ee0f Another msvc changes entry 2013-01-17 15:54:21 -05:00
Nick Mathewson
213bd7760f For now, always use donna32 on msvc 2013-01-17 15:53:37 -05:00
Nick Mathewson
60a2aa8b00 Add ntor-related modules to the Makefiles.nmake 2013-01-17 15:53:36 -05:00
Nick Mathewson
1af89ce540 Fix an MSVC warning in onion.h prototypes 2013-01-17 14:42:37 -05:00
Nick Mathewson
ae58303d42 Even more code-removal for 6826
(Pull on a thread and the whole sweater unravels.)
2013-01-17 14:40:12 -05:00
Nick Mathewson
2386a98d46 Add a missing part of bug 7311's makefile.nmake tweaks
Fix by "ultramage".

This already has a changes entry.
2013-01-17 10:01:22 -05:00
Nick Mathewson
514d484597 Merge branch 'bug6826_squashed' 2013-01-17 09:23:07 -05:00
Nick Mathewson
b30d06255c Drop detection logic for pre-1.3 busted libevents
This won't actually break them any worse than they were broken before:
it just removes a set of warnings that nobody was actually seeing, I
hope.

Closes 6826
2013-01-17 09:22:57 -05:00
Nick Mathewson
d094a76cc8 Merge remote-tracking branch 'public/bug6302' 2013-01-17 09:20:24 -05:00
Karsten Loesing
da1e44ee51 Remove dirreq-v2-* lines from extra-info descriptors.
Implements the rest of #5823.
2013-01-17 10:46:34 +01:00
Jérémy Bobbio
aa01d0a183 Implement proposal 204: ignore subdomains in hidden service addresses
The implementation is pretty straightforward: parse_extended_hostname() is
modified to drop any leading components from an address like
'foo.aaaaaaaaaaaaaaaa.onion'.
2013-01-16 23:29:59 -05:00
Nick Mathewson
b998431a33 Merge branch '024_msvc_squashed'
Conflicts:
	src/or/or.h
	 srcwin32/orconfig.h
2013-01-16 22:32:12 -05:00
Nick Mathewson
b7cf7bd9ae Fix an instance of snprintf; don't use _snprintf directly 2013-01-16 22:29:39 -05:00
Nick Mathewson
65b90edbe4 Changes files for 024_msvc branch 2013-01-16 22:29:39 -05:00
Nick Mathewson
5e06c4ee32 When building with MSVC, call every enum bitfield unsigned
Fixes bug 7305.
2013-01-16 22:29:39 -05:00
Nick Mathewson
739e83ca69 Add HAVE_EVENT_BASE_LOOPEXIT to win32/orconfig.h
Fix for bug 7308
2013-01-16 22:29:39 -05:00