Commit Graph

8513 Commits

Author SHA1 Message Date
Karsten Loesing f80672d747 Remove duplicate words and a duplicate newline. 2009-12-18 12:55:05 +01:00
Nick Mathewson 235f1e1a96 Refactor out the 'find string at start of any line' logic.
We do this in too many places throughout the code; it's time to start
clamping down.

Also, refactor Karsten's patch to use strchr-then-strndup, rather than
malloc-then-strlcpy-then-strchr-then-clear.
2009-12-17 18:29:37 -05:00
Karsten Loesing 498c293afe Make changes to latest bridge-stats fixes as suggested by Nick. 2009-12-17 11:20:31 +01:00
Karsten Loesing e1e5c1b3ab Fix bridge statistics.
Fix statistics on client numbers by country as seen by bridges that were
broken in 0.2.2.1-alpha. Also switch to reporting full 24-hour intervals
instead of variable 12-to-48-hour intervals.
2009-12-17 09:22:55 +01:00
Karsten Loesing d38268a8c7 Remove v0 hidden service statistics code.
The HSAuthorityRecordStats option was used to track statistics of overall
hidden service usage on the version 0 hidden service authorities. With the
version 2 hidden service directories being deployed and version 0
descriptors being phased out, these statistics are not as useful anymore.

Goodbye, you fine piece of software; my first major code contribution to
Tor.
2009-12-17 09:15:06 +01:00
Nick Mathewson 62c2a5a883 Merge commit 'karsten/fix-cell-stats'
Conflicts:
	ChangeLog
2009-12-16 21:59:25 -05:00
Nick Mathewson 350181529e Merge branch 'safelogging2'
Conflicts:
	ChangeLog
2009-12-15 17:26:09 -05:00
Nick Mathewson fcbd65b45c Refactor the safe_str_*() API to make more sense.
The new rule is: safe_str_X() means "this string is a piece of X
information; make it safe to log."  safe_str() on its own means
"this string is a piece of who-knows-what; make it safe to log".
2009-12-15 17:25:34 -05:00
Nick Mathewson 616cbb31c7 Merge commit 'origin/maint-0.2.1' 2009-12-15 17:11:40 -05:00
Nick Mathewson 3b896195cb Stop using lround in or.h, and check for bad values of RECENT_CIRCUITS 2009-12-15 17:11:27 -05:00
Nick Mathewson 1c87a27574 Fix bug 1173: remove an assert(unsigned >= 0). 2009-12-15 15:51:59 -05:00
Nick Mathewson d42c689b8e Merge commit 'sebastian/coverity' 2009-12-15 14:50:49 -05:00
Nick Mathewson 5db4b96089 Merge branch 'mathlog' 2009-12-15 14:42:09 -05:00
Nick Mathewson e56747f9cf Refactor a bit so that it is safe to include math.h, and mostly not needed. 2009-12-15 14:40:49 -05:00
Nick Mathewson 60b01c6d5e Change interface for configuring cell ewma algorithm.
The rule is now: take the value from the CircuitPriorityHalflife
config option if it is set.  If it zero, disable the cell_ewma
algorithm.  If it is set, use it to calculate the scaling factor.
If it is not set, look for a CircPriorityHalflifeMsec parameter in the
consensus networkstatus.  If *that* is zero, then disable the cell_ewma
algorithm; if it is set, use it to calculate the scaling factor.
If it is not set at all, disable the algorithm.
2009-12-15 13:58:24 -05:00
Nick Mathewson 296381eda0 Merge commit 'sebastian/ewma2' into ewma
Conflicts:
	src/or/relay.c
2009-12-15 13:23:27 -05:00
Nick Mathewson 1292a9ddfe Fix various comment typos in ewma patch; found by arma. 2009-12-15 13:20:22 -05:00
Nick Mathewson 2c672f73bf Fix comment typos in container.c 2009-12-15 13:20:02 -05:00
Sebastian Hahn d384f5e1ed Fix compile warning on Panther.
Apparently Panther doesn't like comparing ints and enums
2009-12-14 10:07:20 +01:00
Sebastian Hahn 182c583497 Remove some dead code found by coverity, cid 404
In connection_dir_client_reached_eof, we make sure that we either
return when we get an http status code of 503 or handle the problem
and set it to 200. Later we check if the status code is 503. Remove
that check.
2009-12-14 09:53:31 +01:00
Sebastian Hahn 27b7746c51 Fix Snow Leopard compile and a codestyle violation
When calculating the current tick, cap (tv_sec / EWMA_TICK_LEN) to an unsigned int.
2009-12-14 05:17:45 +01:00
Nick Mathewson 06e8370c33 Optimize cell-ewma circuit priority algorithm.
There are two big changes here:
  - We store active circuits in a priority queue for each or_conn,
    rather than doing a linear search over all the active circuits
    before we send each cell.
  - Rather than multiplying every circuit's cell-ewma by a decay
    factor every time we send a cell (thus normalizing the value of a
    current cell to 1.0 and a past cell to alpha^t), we instead
    only scale down the cell-ewma every tick (ten seconds atm),
    normalizing so that a cell sent at the start of the tick has
    value 1.0).
2009-12-13 21:05:53 -05:00
Roger Dingledine f7d99b62a3 New controller command "getinfo config-text"
It returns the contents that Tor would write if you send it a SAVECONF
command, so the controller can write the file to disk itself.
2009-12-13 19:21:06 -05:00
Nick Mathewson c43fee131d Adjust EWMA patch to conform to whitespace style. 2009-12-12 19:06:38 -05:00
Can Tang d3be00e0f4 Favor quiet circuits when choosing which order to relay cells in.
Each circuit is ranked in terms of how many cells from it have been
relayed recently, using a time-weighted average.

This patch has been tested this on a private Tor network on PlanetLab,
and gotten improvements of 12-35% in time it takes to fetch a small
web page while there's a simultaneous large data transfer going on
simultaneously.

[Commit msg by nickm based on mail from Ian Goldberg.]
2009-12-12 19:06:38 -05:00
Nick Mathewson c210db0d41 Enhance pqueue so we can remove items from the middle.
This changes the pqueue API by requiring an additional int in every
structure that we store in a pqueue to hold the index of that structure
within the heap.
2009-12-12 19:06:38 -05:00
Nick Mathewson d086c9a7f7 Merge commit 'sebastian/fixes' 2009-12-12 02:10:57 -05:00
Nick Mathewson 9e6225ae16 Merge commit 'sebastian/coverity' 2009-12-12 02:10:19 -05:00
Nick Mathewson 0c1b3070cf Now that FOO_free(NULL) always works, remove checks before calling it. 2009-12-12 02:07:59 -05:00
Nick Mathewson 79f72d0ef6 Make rend_cache_entry_free() typecheck when possible. 2009-12-12 01:31:35 -05:00
Nick Mathewson a8190b09a3 Cache the parsed value of SafeLogging as an enum. 2009-12-12 01:12:47 -05:00
Sebastian Hahn 3807db001d *_free functions now accept NULL
Some *_free functions threw asserts when passed NULL. Now all of them
accept NULL as input and perform no action when called that way.

This gains us consistence for our free functions, and allows some
code simplifications where an explicit null check is no longer necessary.
2009-12-12 03:29:44 +01:00
Sebastian Hahn 28b29e0fd7 Fix typo in a comment 2009-12-12 02:53:27 +01:00
Sebastian Hahn f258647433 Allow SafeLogging to exclude client related information 2009-12-12 02:26:11 +01:00
Nick Mathewson b51a33e527 Merge commit 'origin/maint-0.2.1' 2009-12-04 14:31:17 -05:00
Martin Peck 3a2d677fa7 Improved workaround for disabled OpenSSL renegotiation.
It turns out that OpenSSL 0.9.8m is likely to take a completely
different approach for reenabling renegotiation than OpenSSL 0.9.8l
did, so we need to work with both. :p   Fixes bug 1158.

(patch by coderman; commit message by nickm)
2009-12-04 14:25:08 -05:00
Karsten Loesing 16fbb2f745 Minor fix to buffer stats.
Do not segfault when writing buffer stats when we haven't observed a
single circuit to report about.  This is a minor bug that would only show
up in testing environments with no traffic and with reduced stats
intervals.
2009-12-03 10:51:51 +01:00
Roger Dingledine cee9a28d1e Merge commit 'origin/maint-0.2.1' 2009-11-23 10:16:38 -05:00
Roger Dingledine a89f51c936 fix race condition that can cause crashes at client or exit relay
Avoid crashing if the client is trying to upload many bytes and the
circuit gets torn down at the same time, or if the flip side
happens on the exit relay. Bugfix on 0.2.0.1-alpha; fixes bug 1150.
2009-11-23 10:13:50 -05:00
Roger Dingledine 403f99eaa4 add a minimum for CircuitStreamTimeout, plus a man page
plus some other unrelated touchups that have been sitting in my
sandbox
2009-11-22 07:15:30 -05:00
Roger Dingledine 7f3f88bed3 New config option "CircuitStreamTimeout"
New config option "CircuitStreamTimeout" to override our internal
timeout schedule for how many seconds until we detach a stream from
a circuit and try a new circuit. If your network is particularly
slow, you might want to set this to a number like 60.
2009-11-21 23:36:36 -05:00
Roger Dingledine fdd58f3bd5 If somebody tries to overflow my dirport, don't log his IP by default.
aka Fix an instance where a Tor directory mirror might accidentally
log the IP address of a misbehaving Tor client. Bugfix on
0.1.0.1-rc.
2009-11-21 23:09:24 -05:00
Roger Dingledine 4f8b36a1e2 clobber connections with different number than we clobber circuits 2009-11-21 23:02:10 -05:00
Roger Dingledine 7b6b931ccc stop assuming that our downcasts have a struct offset of 0
shouldn't actually change anything, but who knows.
2009-11-21 22:59:18 -05:00
Roger Dingledine 01a9cc0413 bump to 0.2.2.6-alpha-dev 2009-11-21 22:57:05 -05:00
Nick Mathewson 2b1bb233b3 Use the same mlockall checks with tor_set_max_memlock 2009-11-20 14:45:29 -05:00
Nick Mathewson 444eff6286 Fix compilation on OSX 10.3.
On this OSX version, there is a stub mlockall() function
that doesn't work, *and* the declaration for it is hidden by
an '#ifdef _P1003_1B_VISIBLE'.  This would make autoconf
successfully find the function, but our code fail to build
when no declaration was found.

This patch adds an additional test for the declaration.
2009-11-20 13:28:16 -05:00
Roger Dingledine 1ee580407c bump to 0.2.2.6-alpha 2009-11-19 14:16:11 -05:00
Nick Mathewson 9be682942c Not everybody likes debugging printfs as much as I 2009-11-18 11:26:44 -05:00
Nick Mathewson e722ffa605 Do not report a partially-successful detached signature add as failed.
Also, regenerate the detached-signature document whenever any signatures are
successfully added.
2009-11-17 14:24:59 -05:00