Commit Graph

8513 Commits

Author SHA1 Message Date
Nick Mathewson a4c5287e1b Clarify AssumeReachable semantics wrt hibernation 2010-08-18 11:31:19 -04:00
Nick Mathewson 5063a1c538 Add some braces to make arma happy 2010-08-18 11:28:51 -04:00
Sebastian Hahn 78e4aa63fb Backport END_STREAM_REASON_NOROUTE for client use.
(Partial backport of 150ed553df, 161b275028, and 4c948ffd6.)
2010-08-18 11:12:32 -04:00
Nick Mathewson a509dbba50 Merge commit 'karsten/dirbytes2'
Conflicts:
	src/or/rephist.h
2010-08-18 10:06:14 -04:00
Karsten Loesing 58b6195455 Correctly report written bytes on linked connections. 2010-08-18 13:54:41 +02:00
Karsten Loesing db94b7f46e Count bytes we spend on answering directory requests. 2010-08-18 13:54:41 +02:00
Sebastian Hahn d5c83f2014 Remove unused function declarations
Also remove some #if 0'd code from the unit tests for buffers. The
code was killed in e6794e5808 (5 years
ago), and is now broken anyways.
2010-08-17 23:49:39 +02:00
Nick Mathewson 5ffe105598 Merge branch 'maint-0.2.1'
Resolved conflict in
	src/or/networkstatus.c
2010-08-17 12:07:19 -04:00
Nick Mathewson fc66a2ad1b Merge branch 'bug1141_v3' into maint-0.2.1 2010-08-17 11:55:58 -04:00
Nick Mathewson 6f58481335 Scale CONSENSUS_MIN_SECONDS_BEFORE_CACHING by voting interval
If the voting interval was short enough, the two-minutes delay
of CONSENSUS_MIN_SECONDS_BEFORE_CACHING would confuse bridges
to the point where they would assert before downloading a consensus.
It it was even shorter (<4 minutes, I think), caches would
assert too.  This patch fixes that by having replacing the
two-minutes value with MIN(2 minutes, interval/16).

Bugfix for 1141; the cache bug could occur since 0.2.0.8-alpha, so
I'm calling this a bugfix on that.  Robert Hogan diagnosed this.
Done as a patch against maint-0.2.1, since it makes it hard to
run some kinds of testing networks.
2010-08-17 11:55:39 -04:00
Robert Hogan d6744d611f Fall back to direct descriptor request to bridges when
requests to authorities fail due to a network error.

Bug#1138
"When a Tor client starts up using a bridge, and UpdateBridgesFromAuthority
is set, Tor will go to the authority first and look up the bridge by
fingerprint. If the bridge authority is filtered, Tor will never notice that
the bridge authority lookup failed. So it will never fall back."

Add connection_dir_bridge_routerdesc_failed(), a function for unpacking
the bridge information from a failed request, and ensure
connection_dir_request_failed() calls it if the failed request
was for a bridge descriptor.

Test:

1. for ip in `grep -iR 'router ' cached-descriptors|cut -d ' ' -f 3`;
do sudo iptables -A OUTPUT -p tcp -d $ip -j DROP; done
2. remove all files from user tor directory
3. Put the following in torrc:

UseBridges 1
UpdateBridgesFromAuthority 1
Bridge 85.108.88.19:443 7E1B28DB47C175392A0E8E4A287C7CB8686575B7

4. Launch tor - it should fall back to downloading descriptors
   directly from the bridge.

Initial patch reviewed and corrected by mingw-san.
2010-08-16 21:15:49 +01:00
Nick Mathewson bf8d66364f Merge commit 'public/warn1125' 2010-08-16 00:27:05 -04:00
Karsten Loesing 15379a7254 Fix compilation with --with-dmalloc
Fixes 1832; bugfix on 0.2.2.6-alpha
2010-08-16 00:14:06 -04:00
Roger Dingledine 4c948ffd6c 161b2750 didn't really retry the stream. this does. 2010-08-16 00:04:49 -04:00
Nick Mathewson b51f1a64e4 Make Sebastian's bug1831 branch build with --enable-gcc-warnings 2010-08-15 23:46:09 -04:00
Nick Mathewson a856f446c7 Merge commit 'sebastian/bug1831' 2010-08-15 23:43:36 -04:00
Nick Mathewson 6a77bde8d8 Make Sebastian's misc-reasons branch compile; frob the changes file 2010-08-15 21:32:06 -04:00
Nick Mathewson 9bcea4a8ef Merge commit 'sebastian/misc-reason' 2010-08-15 21:27:32 -04:00
Nick Mathewson 5757f47fc3 Make unit tests work when tests get run in subprocesses.
Apparently the way we handled cleaning up temporary directories with
atexit() meant that when the child process exited, it would remove the
temporary directory, thus making other tests in the main process fail.
2010-08-15 21:20:19 -04:00
Nick Mathewson 8394c70204 Rename rep_hist_exit_stats_history in test.c too 2010-08-15 20:55:24 -04:00
Nick Mathewson 8351881b2e Merge commit 'karsten/stats-tests' 2010-08-15 20:49:37 -04:00
Sebastian Hahn 561ca9b987 Fix misplaced labels 2010-08-16 00:46:44 +02:00
Sebastian Hahn b2dcff5766 Fix a memory leak in dirvote_compute_consensuses() 2010-08-16 00:46:44 +02:00
Sebastian Hahn 527581194c Fix a memory leak
It happened in dirvote_add_signatures_to_pending_consesus().
2010-08-16 00:46:42 +02:00
Sebastian Hahn 4c49d3c27e Refactor circuit_build_times_parse_state
Remove the msg parameter to pass an error message out. This
wasn't needed and made it harder to detect a memory leak.
2010-08-16 00:45:32 +02:00
Sebastian Hahn 70f0ba1495 Fix a memory leak in circuit_build_times_parse_state
Thanks weasel for noticing.
2010-08-16 00:33:29 +02:00
Karsten Loesing 0e8513d4c6 Run test_stats in a subprocess. 2010-08-15 14:30:37 +02:00
Karsten Loesing 69545efbaf Give rep_hist_exit_stats_history() a better name. 2010-08-15 14:15:58 +02:00
Karsten Loesing 3d77c67d93 Fix memory leak spotted by Nick. 2010-08-15 13:34:57 +02:00
Roger Dingledine 8d588e7b1a reinit per-conn token buckets on config or consensus change 2010-08-15 04:01:42 -04:00
Roger Dingledine 2bc1842aaa factor out rate/burst setting. no actual changes. 2010-08-15 02:27:07 -04:00
Roger Dingledine a207d9db4c fix another piece of 1741 2010-08-14 04:22:08 -04:00
Roger Dingledine e50857b67f changes entry for bug 1741 2010-08-13 20:50:51 -04:00
Mike Perry 5b0c0e1f89 Add check for CIRCUIT_PURPOSE_S_REND_JOINED.
These circuits stick around much longer than others on the server side for
performance reasons. Their lifetime is controlled by the client.
2010-08-13 20:46:33 -04:00
Roger Dingledine b1a5888553 fix a memory leak introduced by df1ef2f0f0 2010-08-13 17:30:50 -04:00
Roger Dingledine 1ac1f048ef minor formatting / comment fixes 2010-08-13 17:18:45 -04:00
Karsten Loesing acd25558b8 Refactor exit port statistics code and add unit tests. 2010-08-11 16:19:54 +02:00
Roger Dingledine 45c6b5de17 tiny change i found in my other sandbox 2010-08-11 01:48:29 -04:00
Nick Mathewson 8150e2ad24 Make buf_shrink_freelists warn, not crash, when n_to_skip is too high
This mitigates bug 1125, but doesn't fix its root cause (whatever
that is).
2010-08-10 15:58:41 -04:00
Roger Dingledine 0087a37bed tiny changes i found in my sandbox 2010-08-09 18:50:49 -04:00
Sebastian Hahn 162c8847de Update some documentation for the bug 1525 fix 2010-08-08 15:20:24 +02:00
Robert Hogan 462568674a Ensure controller RESOLVE commands respect __LeaveStreamsUnattached
https://trac.torproject.org/projects/tor/ticket/1525

"The codepath taken by the control port "RESOLVE" command to create a
synthetic SOCKS resolve request isn't the same as the path taken by
a real SOCKS request from 'tor-resolve'.
This prevents controllers who set LeaveStreamsUnattached=1 from
being able to attach RESOLVE streams to circuits of their choosing."

Create a new function connection_ap_rewrite_and_attach_if_allowed()
and call that when Tor needs to attach a stream to a circuit but
needs to know if the controller permits it.

No tests added.
2010-08-08 12:37:59 +01:00
Nick Mathewson f060b18e6c Fix a rare bug in rend_fn tests when the randomly generated port is 0
Since the rend code doesn't like the port to be 0, we shouldn't generate
the port by declaring crypto_rand_int(65536); instead we should
say crypto_rand_int(65535)+1.

Diagnosed by Matt Edman; fixes bug 1808.
2010-08-07 14:31:58 -04:00
Karsten Loesing 83626ec91c Move exit-stats code to the end of rephist.c. 2010-08-05 13:05:33 +02:00
Sebastian Hahn d365bc965d Only delay counting bridge users if we were a relay before 2010-08-05 13:05:32 +02:00
Karsten Loesing 166c2f4d92 Allow enabling or disabling *Statistics while Tor is running.
With this patch we stop scheduling when we should write statistics using a
single timestamp in run_scheduled_events(). Instead, we remember when a
statistics interval starts separately for each statistic type in geoip.c
and rephist.c. Every time run_scheduled_events() tries to write stats to
disk, it learns when it should schedule the next such attempt.

This patch also enables all statistics to be stopped and restarted at a
later time.

This patch comes with a few refactorings, some of which were not easily
doable without the patch.
2010-08-05 13:05:25 +02:00
Sebastian Hahn 161b275028 Retry streams that ended with NOROUTE error
Also add the NOROUTE reason to control-spec.
2010-08-04 00:51:39 +02:00
Nick Mathewson 51377ae1bb Merge commit 'sebastian/mlockall' 2010-08-03 10:50:18 -04:00
Sebastian Hahn 150ed553df Introduce END_STREAM_REASON_NOROUTE 2010-08-03 16:46:28 +02:00
Nick Mathewson b4e2d0607d Merge commit 'sebastian/distcheck' 2010-08-03 10:07:57 -04:00