Andrea Shepard
2ee69bd5d7
Expose get_unique_circ_id_by_chan() to test suite
2014-09-30 23:09:14 -07:00
Andrea Shepard
ade60890d0
Make scheduler_channel_doesnt_want_writes() mockable
2014-09-30 23:09:14 -07:00
Andrea Shepard
fd57840a77
Make scheduler_channel_doesnt_want_writes() mockable
2014-09-30 22:54:10 -07:00
Andrea Shepard
85ee070852
Make scheduler_release_channel() mockable
2014-09-30 22:49:58 -07:00
Andrea Shepard
8907554cf3
Make channel_note_destroy_not_pending() mockable
2014-09-30 22:49:58 -07:00
Andrea Shepard
dabf4c33e2
Refactor channel_get_cell_queue_entry_size() to avoid an unreachable line for test coverage, and fix a nasty lurking memory bug in channel_flush_some_cells_from_outgoing_queue()
2014-09-30 22:49:58 -07:00
Andrea Shepard
ac1b627e85
Implement scheduler_touch_channel()
2014-09-30 22:49:58 -07:00
Andrea Shepard
ed1927d6bf
Use a non-stupid data structure in the scheduler
2014-09-30 22:49:56 -07:00
Andrea Shepard
3530825c53
Eliminate some unnecessary smartlists in scheduler.c
2014-09-30 22:49:36 -07:00
Andrea Shepard
63bb9a795e
Fix compiler warning
2014-09-30 22:49:36 -07:00
Andrea Shepard
55907da28d
Sort the scheduler's channel list by cmux comparisons
2014-09-30 22:49:36 -07:00
Andrea Shepard
700d6e7525
Add inter-cmux comparison support to circuitmux_ewma.c
2014-09-30 22:49:35 -07:00
Andrea Shepard
9db596d2ef
Add cmux support for inter-cmux comparisons
2014-09-30 22:49:35 -07:00
Andrea Shepard
1275002a46
Schedule according to a queue size heuristic
2014-09-30 22:49:35 -07:00
Andrea Shepard
4f567c8cc8
Let the new scheduler handle writes
2014-09-30 22:49:03 -07:00
Andrea Shepard
f314d9509c
Fix return values from channel_flush_some_cells() to correctly count cells directly written by channel_flush_from_first_active_circuit()
2014-09-30 22:49:03 -07:00
Andrea Shepard
2fc3da3ff5
Implement global queue size query in channel.c
2014-09-30 22:49:03 -07:00
Andrea Shepard
8852a1794c
Track total queue size per channel, with overhead estimates, and global queue total
2014-09-30 22:49:03 -07:00
Andrea Shepard
5e0a6d54d0
Add global cell/byte counters and per channel byte counters to channel.c
2014-09-30 22:49:02 -07:00
Andrea Shepard
f0533d8d22
Remove no-longer-used channel_tls_t functions
2014-09-30 22:49:02 -07:00
Andrea Shepard
b09f41424c
Actually call channel_flush_some_cells() from the scheduler
2014-09-30 22:49:01 -07:00
Andrea Shepard
2efbab2aaf
Provide generic mechanism for scheduler to query writeable cells on a channel
2014-09-30 22:48:26 -07:00
Nick Mathewson
472b62bfe4
Uglify scheduler init logic to avoid crash on startup.
...
Otherwise, when we authority try to do a self-test because of
init-keys, if that self-test can't be launched for whatever reason and
so we close the channel immediately, we crash.
Yes, this a silly way for initialization to work.
2014-09-30 22:48:26 -07:00
Nick Mathewson
85ee5b3095
Use event_active, not 0-length timeouts. It's idempotent, too.
2014-09-30 22:48:26 -07:00
Nick Mathewson
fc13184e44
Fix unused-arguments warnings
2014-09-30 22:48:26 -07:00
Nick Mathewson
08bea13c35
Temporarily disable scheduler_trigger as unused
2014-09-30 22:48:26 -07:00
Andrea Shepard
d438cf1ec9
Implement scheduler mechanism to track lists of channels wanting cells or writes; doesn't actually drive the cell flow from it yet
2014-09-30 22:48:24 -07:00
Nick Mathewson
b448ec195d
Clear the cached address from resolve_my_address() when our IP changes
...
Closes 11582; patch from "ra".
2014-09-29 13:47:58 -04:00
Nick Mathewson
ac9b0a3110
Try to make max_dl_per_request a bit smarter
2014-09-29 10:56:38 -04:00
Nick Mathewson
2b1b1def46
Merge remote-tracking branch 'teor/circuitstats-pareto-avoid-div-zero'
2014-09-29 09:48:02 -04:00
Nick Mathewson
11ebbf5e88
Merge branch 'bug12971_take2_squashed'
2014-09-29 09:18:03 -04:00
Nick Mathewson
fcebc8da95
Rename socks5 error code setting function again
...
I'd prefer not to use the name "send" for any function that doesn't
really send things.
2014-09-29 09:17:29 -04:00
rl1987
c5ad890904
Respond with 'Command not supported' SOCKS5 reply message upon reception of unsupported request.
2014-09-29 09:14:42 -04:00
Nick Mathewson
5e8cc766e6
Merge branch 'ticket961_squashed'
2014-09-29 09:05:18 -04:00
Nick Mathewson
4903ab1caa
Avoid frequent strcmp() calls for AccountingRule
...
Generally, we don't like to parse the same thing over and over; it's
best IMO to do it once at the start of the code.
2014-09-29 09:05:11 -04:00
Nick Mathewson
8527a29966
Add an "AccountingRule" feature to permit limiting bw usage by read+write
...
Patch from "chobe". Closes ticket 961.
2014-09-29 09:05:11 -04:00
Nick Mathewson
dc019b0654
Merge remote-tracking branch 'yawning/bug13213'
2014-09-29 08:57:19 -04:00
Nick Mathewson
b45bfba2ce
Whitespace fixes
2014-09-29 08:48:22 -04:00
teor
4d0ad34a92
Avoid division by zero in circuitstats pareto
...
In circuit_build_times_calculate_timeout() in circuitstats.c, avoid dividing
by zero in the pareto calculations.
If either the alpha or p parameters are 0, we would divide by zero, yielding
an infinite result; which would be clamped to INT32_MAX anyway. So rather
than dividing by zero, we just skip the offending calculation(s), and
use INT32_MAX for the result.
Division by zero traps under clang -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error.
2014-09-29 20:49:24 +10:00
teor
ff8fe38a2f
Stop spurious clang shallow analysis null pointer errors
...
Avoid 4 null pointer errors under clang shallow analysis (the default when
building under Xcode) by using tor_assert() to prove that the pointers
aren't null. Resolves issue 13284 via minor code refactoring.
2014-09-28 20:51:23 -04:00
Nick Mathewson
801f4d4384
Fix a double-free in failing case of handle_control_authenticate.
...
Bugfix on ed8f020e205267e6270494634346ab68d830e1d8; bug not in any
released version of Tor. Found by Coverity; this is CID 1239290.
[Yes, I used this commit message before, in 58e813d0fc
.
Turns out, that fix wasn't right, since I didn't look up a
screen. :P ]
2014-09-26 08:58:15 -04:00
Nick Mathewson
764e008092
Merge branch 'libscrypt_trunnel_squashed'
...
Conflicts:
src/test/test_crypto.c
2014-09-25 12:03:41 -04:00
Nick Mathewson
e84e1c9745
More generic passphrase hashing code, including scrypt support
...
Uses libscrypt when found; otherwise, we don't have scrypt and we
only support openpgp rfc2440 s2k hashing, or pbkdf2.
Includes documentation and unit tests; coverage around 95%. Remaining
uncovered code is sanity-checks that shouldn't be reachable fwict.
2014-09-25 11:58:13 -04:00
Yawning Angel
fa60a64088
Do not launch pluggable transport plugins when DisableNetwork is set.
...
When DisableNetwork is set, do not launch pluggable transport plugins,
and if any are running already, terminate the existing instances.
Resolves ticket 13213.
2014-09-24 09:39:15 +00:00
Roger Dingledine
ecab261641
two more typos
2014-09-23 18:30:02 -04:00
Nick Mathewson
6523eff9b3
Send long URLs when requesting ordinary server descriptors too.
2014-09-23 13:04:22 -04:00
Nick Mathewson
055ad9c5fb
fixup! Send more descriptor requests per attempt when using tunneled connections
...
Limit the number of simultaneous connections to a single router for
server descriptors too.
2014-09-23 12:57:10 -04:00
Nick Mathewson
0fdfdae7e3
fixup! Refactor initiate_descriptor_downloads() to be safer
...
Calculate digest_len correctly.
Also, refactor setting of initial variables to look a little nicer.
2014-09-23 12:56:16 -04:00
Nick Mathewson
55b21b366c
fixup! Make router_pick_directory_server respect PDS_NO_EXISTING_*
...
Document n_busy_out, and set it correctly when we goto retry_without_exclude.
2014-09-23 12:47:39 -04:00
Nick Mathewson
02464694b2
fixup! Send more descriptor requests per attempt when using tunneled connections
...
Compilation fixes
2014-09-23 12:34:51 -04:00