aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.c
AgeCommit message (Collapse)Author
2014-09-09Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-09-05Correctly update channel local mark when address of incoming connection ↵Andrea Shepard
changes after handshake; fixes bug #12160
2014-09-02Another clang analyzer complaint wrt HT_GENERATENick Mathewson
We're calling mallocfn() and reallocfn() in the HT_GENERATE macro with the result of a product. But that makes any sane analyzer worry about overflow. This patch keeps HT_GENERATE having its old semantics, since we aren't the only project using ht.h. Instead, define a HT_GENERATE2 that takes a reallocarrayfn.
2014-08-13Merge remote-tracking branch 'public/bug12848_024' into maint-0.2.5Nick Mathewson
Conflicts: src/or/circuitbuild.c
2014-08-12Add an extra check in channel_send_destroy for circID==0Nick Mathewson
Prevents other cases of 12848.
2014-07-24fix typo that crept in to 0.2.4.4-alphaRoger Dingledine
2014-07-18Use safe_str in channel_dumpstats: improve 12184 diagnosticNick Mathewson
2014-06-11Merge remote-tracking branch 'public/ticket6799_024_v2_squashed'Nick Mathewson
Conflicts: src/or/channel.c src/or/circuitlist.c src/or/connection.c Conflicts involved removal of next_circ_id and addition of unusable-circid tracking.
2014-06-11Replace last_added_nonpadding with last_had_circuitsNick Mathewson
The point of the "idle timeout" for connections is to kill the connection a while after it has no more circuits. But using "last added a non-padding cell" as a proxy for that is wrong, since if the last circuit is closed from the other side of the connection, we will not have sent anything on that connection since well before the last circuit closed. This is part of fixing 6799. When applied to 0.2.5, it is also a fix for 12023.
2014-04-23Merge remote-tracking branch 'public/bug11553_024' into bug11553_025Nick Mathewson
Conflicts: src/or/circuitbuild.c
2014-04-23Improvements to #11553 fix based on reviewNick Mathewson
Use a per-channel ratelim_t to control the rate at which we report failures for each channel. Explain why I picked N=32. Never return a zero circID. Thanks to Andrea and to cypherpunks.
2014-04-18Merge remote-tracking branch 'public/bug11553_024' into bug11553_025Nick Mathewson
Conflicts: src/or/channel.h
2014-04-18Switch to random allocation on circuitIDs.Nick Mathewson
Fixes a possible root cause of 11553 by only making 64 attempts at most to pick a circuitID. Previously, we would test every possible circuit ID until we found one or ran out. This algorithm succeeds probabilistically. As the comment says: This potentially causes us to give up early if our circuit ID space is nearly full. If we have N circuit IDs in use, then we will reject a new circuit with probability (N / max_range) ^ MAX_CIRCID_ATTEMPTS. This means that in practice, a few percent of our circuit ID capacity will go unused. The alternative here, though, is to do a linear search over the whole circuit ID space every time we extend a circuit, which is not so great either. This makes new vs old clients distinguishable, so we should try to batch it with other patches that do that, like 11438.
2014-03-14Test code for implementation of faster circuit_unlink_all_from_channelNick Mathewson
This contains the obvious implementation using the circuitmux data structure. It also runs the old (slow) algorithm and compares the results of the two to make sure that they're the same. Needs review and testing.
2014-02-12Siphash-2-4 is now our hash in nearly all cases.Nick Mathewson
I've made an exception for cases where I'm sure that users can't influence the inputs. This is likely to cause a slowdown somewhere, but it's safer to siphash everything and *then* look for cases to optimize. This patch doesn't actually get us any _benefit_ from siphash yet, since we don't really randomize the key at any point.
2013-10-02Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-10-02Fix a bug in our bug 9776 fix.Nick Mathewson
By calling circuit_n_chan_done() unconditionally on close, we were closing pending connections that might not have been pending quite for the connection we were closing. Fix for bug 9880. Thanks to skruffy for finding this and explaining it patiently until we understood.
2013-09-24Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-09-24Always call circuit_n_chan_done(chan, 0) from channel_closed()Andrea Shepard
2013-08-22Separate mutable/const accessors for circuit_build_timesNick Mathewson
(These have proved invaluable for other global accessors.)
2013-08-22Make circ_times static and add accessor functions.vagrant
Change the global circ_times to a static variable and use accessor functions throughout the code, instead of accessing it directly.
2013-08-15Merge branch 'bug5040_4773_rebase_3'Nick Mathewson
2013-07-23Fix bug9309, and n_noncanonical count/continue codeNick Mathewson
When we moved channel_matches_target_addr_for_extend() into a separate function, its sense was inverted from what one might expect, and we didn't have a ! in one place where we should have. Found by skruffy.
2013-07-23Fix bug9309, and n_noncanonical count/continue codeNick Mathewson
When we moved channel_matches_target_addr_for_extend() into a separate function, its sense was inverted from what one might expect, and we didn't have a ! in one place where we should have. Found by skruffy.
2013-07-18Make a channel getter method to retrieve transport names.George Kadianakis
2013-07-18Add transport information to the GeoIP database.George Kadianakis
2013-06-17Fix bug 9082: avoid leak when freeing destroy cell queuesNick Mathewson
In my #7912 fix, there wasn't any code to remove entries from the (channel, circuit ID)->circuit map corresponding to queued but un-sent DESTROYs. Spotted by skruffy. Fixes bug 9082; bug not in any released Tor.
2013-06-13Add destroy balance tracking and logging to circuitmuxAndrea Shepard
2013-06-13Implementation of a fix for bug 7912Nick Mathewson
I added the code to pass a destroy cell to a queueing function rather than writing it immediately, and the code to remember that we shouldn't reuse the circuit id until the destroy is actually sent, and the code to release the circuit id once the destroy has been sent... and then I finished by hooking destroy_cell_queue into the rest of Tor.
2013-03-19Don't assert when writing a cell to a CLOSING connection.Nick Mathewson
Instead, drop the cell. Fixes another case of bug 7350; bugfix on 0.2.4.4-alpha
2013-03-10Fix 8447: use %u to format circid_t.Nick Mathewson
Now that circid_t is 4 bytes long, the default integer promotions will leave it alone when sizeof(int) == 4, which will leave us formatting an unsigned as an int. That's technically undefined behavior. Fixes bug 8447 on bfffc1f0fc7616a25c32da2eb759dade4651659e. Bug not in any released Tor.
2013-02-15Merge remote-tracking branch 'public/wide_circ_ids'Nick Mathewson
Conflicts: src/or/channel.h src/or/connection_or.c src/or/cpuworker.c
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
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-01-30Rename all of the macros in tor_queue.h to start with TOR_Nick Mathewson
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-11-13Add comment explaining different channel close functionsAndrea Shepard
2012-11-06Implement proposal-214 rules for CircID checking.Nick Mathewson
2012-11-06Check for closing channel in channel_send_destroy()Andrea Shepard
2012-10-31Fix whitespaceNick Mathewson
2012-10-30Merge branch 'bsd_queue' of ssh://git-rw.torproject.org/nickm/torAndrea Shepard
2012-10-22Merge branch 'split_circuitbuild'Nick Mathewson
Conflicts: src/or/circuitbuild.c There was a huge-looking conflict in circuitbuild.c, but the only change that had been made to circuitbuild.c since I forked off the split_circuitbuild branch was 17442560c44e8093f9a. So I took the split_circuitbuild version of the conflicting part, and manually re-applied the change from 17442560c44e8093f9a..
2012-10-17Fix a bug in channel_dump_statisticsNick Mathewson
We were calling channel_get_actual_remote_descr() before we used the output of a previous channel_get_canonical_remote_descr(), thus invalidating its output.
2012-10-17Document lifespan of return values of the _remote_descr() funcsNick Mathewson
2012-10-17Restore the 'address' value of tunneled connectionsNick Mathewson
When we merged the channel code, we made the 'address' field of linked directory connections created with begindir (and their associated edge connections) contain an address:port string, when they should only have contained the address part. This patch also tweaks the interface to the get_descr method of channels so that it takes a set of flags rather than a single flag.
2012-10-17Document return value of channel_get_addr_if_possibleNick Mathewson
2012-10-15Merge branch 'bug7087_2' of ssh://git-rw.torproject.org/user/andrea/torAndrea Shepard
2012-10-15Move the circuit build timeout code into its own file.Nick Mathewson
2012-10-15Merge remote-tracking branch 'public/bug1031'Nick Mathewson
2012-10-15Add debug logging to channel_listener_free()/channel_listener_force_free()Andrea Shepard
2012-10-15Add debug logging for channel_free() and channel_force_free()Andrea Shepard